public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/4] Syslog permissions, revised
@ 2006-11-13  6:40 Zack Weinberg
  2006-11-13  6:40 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Zack Weinberg @ 2006-11-13  6:40 UTC (permalink / raw)
  To: Chris Wright, Stephen Smalley, jmorris; +Cc: linux-kernel

This patchset revises my attempt from last week to allow running klogd
unprivileged without a root shim.  I believe I have addressed all
outstanding objections: in particular, the privilege model enforced by
SELinux is unchanged (you have to have system__syslog_mod to read
/proc/kmsg).  I have also included some nice refactorings (symbolic
constants for sys_syslog opcodes, that sort of thing) and a few
bugfixes (minor and unlikely to affect any live application, but
still).

I hope that this can be considered for 2.6.19; it is low risk in my
opinion and it would be nice to get this functionality into the hands
of the distributors sooner.

zw



^ permalink raw reply	[flat|nested] 18+ messages in thread
* [patch 0/4] /proc/kmsg permissions, take three
@ 2006-12-15  0:16 Zack Weinberg
  2006-12-15  0:16 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
  0 siblings, 1 reply; 18+ messages in thread
From: Zack Weinberg @ 2006-12-15  0:16 UTC (permalink / raw)
  To: Stephen Smalley, jmorris, Chris Wright; +Cc: linux-kernel

Here's a re-revised version of my patch set to allow klogd to drop
privileges and continue reading from /proc/kmsg (currently, even if klogd
has a legitimately opened fd on /proc/kmsg, it cannot read from it unless
it has CAP_SYS_ADMIN asserted).  SELinux's pickier and finer-grained
privilege rules for /proc/kmsg are unchanged.

The major change from the previous patchset
[q.v. http://comments.gmane.org/gmane.linux.kernel/466034 ] is that,
as Arjan van de Ven requested, the new header linux/klog.h contains only
userspace-visible definitions (the constants for sys_syslog()).  Thanks to
Alexey Dobriyan for telling me the proper place to put the KLOGSEC_*
constants (now renamed LSM_KLOG_* in keeping with other such constants).
They have also been rediffed versus yesterday's git.  They should be
applied in sequence; each step compiles, and the complete set has been
booted and tested to work as intended.

Any comments, as usual, appreciated.  I would very much like to see this
in 2.6.20.

zw


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [patch 1/4] Add <linux/klog.h>
@ 2006-12-20  0:34 Vincent Legoll
  0 siblings, 0 replies; 18+ messages in thread
From: Vincent Legoll @ 2006-12-20  0:34 UTC (permalink / raw)
  To: zackw; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

Hello,

what about something along the lines of the following,
on top of your patch ?

Or should the kernel-doc be put on another function
instead of that one ?

-- 
Vincent Legoll

[-- Attachment #2: do-syslog-kernel-doc --]
[-- Type: text/plain, Size: 1178 bytes --]

Add do_syslog() kernel-doc

---
commit 95b0721d8b4b46ddf83113fe49492810d7d92060
tree e2715a8cf7eb0d71b3bee2185a5cf98639d79d90
parent de794d2dfd6dd0c38dd552020ac00c46e1df5293
author Vincent Legoll <vincent.legoll@gmail.com> Wed, 20 Dec 2006 01:29:34 +0100
committer Vincent Legoll <vincent.legoll@gmail.com> Wed, 20 Dec 2006 01:29:34 +0100

 kernel/printk.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 232467e..5416d07 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -164,7 +164,16 @@ out:
 
 __setup("log_buf_len=", log_buf_len_setup);
 
-/* See linux/klog.h for the command numbers passed as the first argument.  */
+/**
+ * do_syslog - operate on kernel messages log
+ * @type: operation to perform
+ * @buf: user-space buffer to copy data into
+ * @len: length of data to copy from log into @buf
+ *
+ * See include/linux/klog.h for the command numbers passed as @type.
+ * Parameters @buf & @len are only used for operations of type %KLOG_READ,
+ * %KLOG_READ_HIST and %KLOG_READ_CLEAR_HIST.
+ */
 int do_syslog(int type, char __user *buf, int len)
 {
 	unsigned long i, j, limit, count;

^ permalink raw reply related	[flat|nested] 18+ messages in thread
* [patch 0/4] /proc/kmsg permissions, take four
@ 2006-12-24 20:22 Zack Weinberg
  2006-12-24 20:22 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
  0 siblings, 1 reply; 18+ messages in thread
From: Zack Weinberg @ 2006-12-24 20:22 UTC (permalink / raw)
  To: Stephen Smalley, jmorris, Chris Wright, Vincent Legoll; +Cc: linux-kernel

Here's yet another revision of the /proc/kmsg permissions patch
series.  To recap, the point is to allow klogd to drop privileges
and continue reading from /proc/kmsg (currently, even if klogd has a
legitimately opened fd on /proc/kmsg, it cannot read from it unless
it has CAP_SYS_ADMIN asserted).  SELinux's pickier and finer-grained
privilege rules for /proc/kmsg are unchanged.

There are two significant changes from the previous revision.  First,
in keeping with the recommended style, I have eliminated the
security_syslog_or_fail() macro.  Instead there is a static array mapping
KLOG_* opcodes to LSM_KLOG_* privilege classes.  This requires slightly
different coding in the security hooks but I think it's clearer overall.
Second, I've incorporated Vincent Legoll's kerneldoc comment for sys_syslog
(nee do_syslog) with some wording improvements and expansion to cover the
klog_* functions introduced part-way through the patch.  I don't think
proc/kmsg.c needs kerneldoc, it's very simple after this patch series.

I've been through Documentation/CodingStyle and satisfied myself that
everything is now in the proper mode.  I don't suppose anyone has comments
on the *content* of the changes...?

zw


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2006-12-27 23:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13  6:40 [patch 0/4] Syslog permissions, revised Zack Weinberg
2006-11-13  6:40 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
2006-11-13  6:40 ` [patch 2/4] permission mapping for sys_syslog operations Zack Weinberg
2006-11-13  9:25   ` Arjan van de Ven
2006-11-13  9:29     ` Zack Weinberg
2006-11-13  9:47       ` Arjan van de Ven
2006-11-13 17:17         ` Zack Weinberg
2006-11-13 17:22           ` Arjan van de Ven
2006-11-13 21:13             ` Alexey Dobriyan
2006-11-13  6:40 ` [patch 3/4] Refactor do_syslog interface Zack Weinberg
2006-11-13  6:40 ` [patch 4/4] Distinguish /proc/kmsg access from sys_syslog Zack Weinberg
  -- strict thread matches above, loose matches on Subject: below --
2006-12-15  0:16 [patch 0/4] /proc/kmsg permissions, take three Zack Weinberg
2006-12-15  0:16 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
2006-12-15  0:59   ` Randy Dunlap
2006-12-15  1:21     ` Zack Weinberg
2006-12-20  0:34 Vincent Legoll
2006-12-24 20:22 [patch 0/4] /proc/kmsg permissions, take four Zack Weinberg
2006-12-24 20:22 ` [patch 1/4] Add <linux/klog.h> Zack Weinberg
2006-12-24 21:00   ` Jan Engelhardt
2006-12-27 23:25   ` Vincent Legoll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox