Skip to content

/proc/kmsg permissions, take three

Zack Weinberg lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Add <linux/klog.h>fs/proc/kmsg.c include/linux/Kbuild include/linux/klog.h +1 more+47 -312 replies
2/4permission mapping for sys_syslog operationsinclude/linux/security.h kernel/printk.c security/commoncap.c +2 more+45 -243 replies
3/4Refactor do_syslog interfacefs/proc/kmsg.c include/linux/klog.h kernel/printk.c+139 -1130 replies
4/4Distinguish /proc/kmsg access from sys_syslogfs/proc/kmsg.c include/linux/security.h security/commoncap.c +1 more+20 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [patch 0/4] /proc/kmsg permissions, take three

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