Skip to content

/proc/kmsg permissions, take four

Zack Weinberg lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 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+62 -292 replies
2/4permission mapping for sys_syslog operationsinclude/linux/security.h kernel/printk.c security/commoncap.c +2 more+68 -230 replies
3/4Refactor do_syslog interfacefs/proc/kmsg.c include/linux/klog.h kernel/printk.c+180 -1340 replies
4/4Distinguish /proc/kmsg access from sys_syslogfs/proc/kmsg.c include/linux/security.h security/commoncap.c +2 more+28 -70 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchVincent Legoll
1/4A-b
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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