/proc/kmsg permissions, take three
Subsystems (4)
cover /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
PATCH 1/4 Add <linux/klog.h>
This patch introduces <linux/klog.h> with symbolic constants for the various sys_syslog() opcodes, and changes all in-kernel references to those opcodes to use the constants. The header is added to the set of user/kernel interface headers. (Unlike the previous revision of this patch series, no kernel-private additions to this file are contemplated.)
zw
include/linux/Kbuild +1 -0
@@ -100,6 +100,7 @@ header-y += ixjuser.h header-y += jffs2.h header-y += keyctl.h +header-y += klog.h header-y += limits.h header-y += lock_dlm_plock.h header-y += magic.h
include/linux/klog.h new file +26 -0
@@ -0,0 +1,26 @@ +#ifndef _LINUX_KLOG_H +#define _LINUX_KLOG_H + +/* +* Constants for the first argument to the syslog() system call +* (aka klogctl()). These numbers are part of the user space ABI! +*/ +enum { +KLOG_CLOSE =0 ,/* close log */ +KLOG_OPEN =1 ,/* open log */ +KLOG_READ =2 ,/* read from log (klogd) */ + +KLOG_READ_HIST =3 ,/* read history of log messages (dmesg) */ +KLOG_READ_CLEAR_HIST =4 ,/* read and clear history */ +KLOG_CLEAR_HIST =5 ,/* just clear history */ + +KLOG_DISABLE_CONSOLE =6 ,/* disable printk to console */ +KLOG_ENABLE_CONSOLE =7 ,/* enable printk to console */ +KLOG_SET_CONSOLE_LVL =8 ,/* set minimum severity of messages to be +* printed to console */ + +KLOG_GET_UNREAD =9 ,/* return number of unread characters */ +KLOG_GET_SIZE =10 /* return size of log buffer */ +}; + +#endif /* klog.h */
kernel/printk.c +13 -26
@@ -32,6 +32,7 @@#include <linux/bootmem.h> #include <linux/syscalls.h> #include <linux/jiffies.h> +#include <linux/klog.h> #include <asm/uaccess.h>
@@ -163,21 +164,7 @@__setup ("log_buf_len=" , log_buf_len_setup); -/* -* Commands to do_syslog: -* -* 0 -- Close the log. Currently a NOP. -* 1 -- Open the log. Currently a NOP. -* 2 -- Read from the log. -* 3 -- Read all messages remaining in the ring buffer. -* 4 -- Read and clear all messages remaining in the ring buffer -* 5 -- Clear ring buffer. -* 6 -- Disable printk's to console -* 7 -- Enable printk's to console -* 8 -- Set level of messages printed to console -* 9 -- Return number of unread characters in the log buffer -* 10 -- Return size of the log buffer -*/ +/* See linux/klog.h for the command numbers passed as the first argument. */ int do_syslog (int type,char __user *buf,int len) {unsigned long i, j, limit, count;
@@ -190,11 +177,11 @@return error;switch (type) { -case 0 :/* Close log */ +case KLOG_CLOSE :break ; -case 1 :/* Open log */ +case KLOG_OPEN :break ; -case 2 :/* Read from log */ +case KLOG_READ : error = -EINVAL ;if (!buf || len <0 ) goto out;
@@ -225,10 +212,10 @@if (!error) error = i;break ; -case 4 :/* Read/clear last kernel messages */ +case KLOG_READ_CLEAR_HIST : do_clear =1 ;/* FALL THRU */ -case 3 :/* Read last kernel messages */ +case KLOG_READ_HIST : error = -EINVAL ;if (!buf || len <0 ) goto out;
@@ -281,16 +268,16 @@ } }break ; -case 5 :/* Clear ring buffer */ +case KLOG_CLEAR_HIST : logged_chars =0 ;break ; -case 6 :/* Disable logging to console */ +case KLOG_DISABLE_CONSOLE : console_loglevel = minimum_console_loglevel;break ; -case 7 :/* Enable logging to console */ +case KLOG_ENABLE_CONSOLE : console_loglevel = default_console_loglevel;break ; -case 8 :/* Set level of messages printed to console */ +case KLOG_SET_CONSOLE_LVL : error = -EINVAL ;if (len <1 || len >8 ) goto out;
@@ -299,10 +286,10 @@ console_loglevel = len; error =0 ;break ; -case 9 :/* Number of chars in the log buffer */ +case KLOG_GET_UNREAD : error = log_end - log_start;break ; -case 10 :/* Size of the log buffer */ +case KLOG_GET_SIZE : error = log_buf_len;break ;default :
fs/proc/kmsg.c +7 -5
@@ -11,6 +11,7 @@#include <linux/kernel.h> #include <linux/poll.h> #include <linux/fs.h> +#include <linux/klog.h> #include <asm/uaccess.h> #include <asm/io.h>
@@ -21,27 +22,28 @@static int kmsg_open (struct inode * inode,struct file * file) { -return do_syslog (1 ,NULL ,0 ); +return do_syslog (KLOG_OPEN ,NULL ,0 ); }static int kmsg_release (struct inode * inode,struct file * file) { - (void )do_syslog (0 ,NULL ,0 ); + (void )do_syslog (KLOG_CLOSE ,NULL ,0 );return 0 ; }static ssize_t kmsg_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) { -if ((file->f_flags &O_NONBLOCK ) && !do_syslog (9 ,NULL ,0 )) +if ((file->f_flags &O_NONBLOCK ) + && !do_syslog (KLOG_GET_UNREAD ,NULL ,0 ))return -EAGAIN ; -return do_syslog (2 , buf, count); +return do_syslog (KLOG_READ , buf, count); }static unsigned int kmsg_poll (struct file *file,poll_table *wait) {poll_wait (file, &log_wait, wait); -if (do_syslog (9 ,NULL ,0 )) +if (do_syslog (KLOG_GET_UNREAD ,NULL ,0 ))return POLLIN |POLLRDNORM ;return 0 ; }
--
Re: [patch 1/4] Add <linux/klog.h>
Quoted 5 lines · On Thu, 14 Dec 2006 16:16:40 -0800 Zack Weinberg wrote:
This patch introduces <
linux/klog.h> with symbolic constants for the varioussys_syslog()opcodes, and changes all in-kernel references to those opcodes to use the constants. The header is added to the set of user/kernel interface headers. (Unlike the previous revision of this patch series, no kernel-private additions to this file are contemplated.)
Hi Zack,
This patch looks good except for one nit:
Quoted 6 lines
fs/proc/kmsg.c +0
-0@@ -21,27 +22,28 @@static int kmsg_open (struct inode * inode,struct file * file) {
fs/proc/kmsg.c line 32
Quoted 10 lines
fs/proc/kmsg.c +2
-2-return do_syslog (1 ,NULL ,0 ); +return do_syslog (KLOG_OPEN ,NULL ,0 ); }static int kmsg_release (struct inode * inode,struct file * file) { - (void )do_syslog (0 ,NULL ,0 ); + (void )do_syslog (KLOG_CLOSE ,NULL ,0 );return 0 ; }
Please use a space after the commas (even though you just left it as it already was).
---
~Randy
Re: [patch 1/4] Add <linux/klog.h>
Quoted 5 lines · Randy Dunlap
fs/proc/kmsg.c line 30
Quoted 2 lines
fs/proc/kmsg.c +1
-1- (void )do_syslog (0 ,NULL ,0 ); + (void )do_syslog (KLOG_CLOSE ,NULL ,0 );Please use a space after the commas (even though you just left it as it already was).
Will change for the next revision.
zw
PATCH 2/4 permission mapping for sys_syslog operations
In reply to Zack WeinbergAs suggested by Stephen Smalley: map the various sys_syslog operations to a smaller set of privilege codes before calling security modules. This patch changes the security module interface! There should be no change in the actual security semantics enforced by dummy, capability, nor SELinux (with one exception, clearly marked in sys_syslog).
Change from previous version of patch: the privilege codes are now in linux/security.h instead of linux/klog.h, and use the LSM_* naming convention used for other such constants in that file.
zw
kernel/printk.c +24 -4
@@ -164,6 +164,12 @@__setup ("log_buf_len=" , log_buf_len_setup); +#define security_syslog_or_fail (type) do { \ + int error = security_syslog(type); \ + if (error) \ + return error; \ + } while (0) +/* See linux/klog.h for the command numbers passed as the first argument. */ int do_syslog (int type,char __user *buf,int len) {
@@ -172,16 +178,15 @@char c;int error =0 ; - error =security_syslog (type); -if (error) -return error; -switch (type) {case KLOG_CLOSE : +security_syslog_or_fail (LSM_KLOG_READ );break ;case KLOG_OPEN : +security_syslog_or_fail (LSM_KLOG_READ );break ;case KLOG_READ : +security_syslog_or_fail (LSM_KLOG_READ ); error = -EINVAL ;if (!buf || len <0 ) goto out;
@@ -213,9 +218,11 @@ error = i;break ;case KLOG_READ_CLEAR_HIST : +security_syslog_or_fail (LSM_KLOG_CLEARHIST ); do_clear =1 ;/* FALL THRU */ case KLOG_READ_HIST : +security_syslog_or_fail (LSM_KLOG_READHIST ); error = -EINVAL ;if (!buf || len <0 ) goto out;
@@ -269,15 +276,19 @@ }break ;case KLOG_CLEAR_HIST : +security_syslog_or_fail (LSM_KLOG_CLEARHIST ); logged_chars =0 ;break ;case KLOG_DISABLE_CONSOLE : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); console_loglevel = minimum_console_loglevel;break ;case KLOG_ENABLE_CONSOLE : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); console_loglevel = default_console_loglevel;break ;case KLOG_SET_CONSOLE_LVL : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); error = -EINVAL ;if (len <1 || len >8 ) goto out;
@@ -287,9 +298,18 @@ error =0 ;break ;case KLOG_GET_UNREAD : +security_syslog_or_fail (LSM_KLOG_READ ); error = log_end - log_start;break ;case KLOG_GET_SIZE : +/* This one is allowed if you have _either_ +LSM_KLOG_READ or LSM_KLOG_READHIST. */ + error =security_syslog (LSM_KLOG_READ ); +if (error) + error =security_syslog (LSM_KLOG_READHIST ); +if (error) +break ; + error = log_buf_len;break ;default :
security/commoncap.c +1 -1
@@ -311,7 +311,7 @@int cap_syslog (int type) { -if ((type !=3 && type !=10 ) && !capable (CAP_SYS_ADMIN )) +if (type !=LSM_KLOG_READHIST && !capable (CAP_SYS_ADMIN ))return -EPERM ;return 0 ; }
security/dummy.c +1 -1
@@ -96,7 +96,7 @@static int dummy_syslog (int type) { -if ((type !=3 && type !=10 ) && current->euid) +if (type !=LSM_KLOG_READHIST && current->euid)return -EPERM ;return 0 ; }
security/selinux/hooks.c +10 -18
@@ -1509,25 +1509,17 @@return rc;switch (type) { -case 3 :/* Read last kernel messages */ -case 10 :/* Return size of the log buffer */ - rc =task_has_system (current,SYSTEM__SYSLOG_READ ); -break ; -case 6 :/* Disable logging to console */ -case 7 :/* Enable logging to console */ -case 8 :/* Set level of messages printed to console */ - rc =task_has_system (current,SYSTEM__SYSLOG_CONSOLE ); -break ; -case 0 :/* Close log */ -case 1 :/* Open log */ -case 2 :/* Read from log */ -case 4 :/* Read/clear last kernel messages */ -case 5 :/* Clear ring buffer */ -default : - rc =task_has_system (current,SYSTEM__SYSLOG_MOD ); -break ; +case LSM_KLOG_READHIST : +return task_has_system (current,SYSTEM__SYSLOG_READ ); + +case LSM_KLOG_CONSOLE : +return task_has_system (current,SYSTEM__SYSLOG_CONSOLE ); + +case LSM_KLOG_READ : +case LSM_KLOG_CLEARHIST : +default : +return task_has_system (current,SYSTEM__SYSLOG_MOD ); } -return rc; }/*
include/linux/security.h +9 -0
@@ -86,6 +86,15 @@/* setfsuid or setfsgid, id0 == fsuid or fsgid */ #define LSM_SETID_FS 8 +/* +* Values passed to security_syslog to indicate which privilege is +* requested. +*/ +#define LSM_KLOG_READ 0/* read current messages (klogd) */ +#define LSM_KLOG_READHIST 1/* read message history (dmesg) */ +#define LSM_KLOG_CLEARHIST 2/* clear message history (dmesg -c) */ +#define LSM_KLOG_CONSOLE 3/* set console log level */ +/* forward declares to avoid warnings */ struct nfsctl_arg ;struct sched_param ;
--
Re: [patch 2/4] permission mapping for sys_syslog operations
Quoted 26 lines · On Thu, 14 Dec 2006 16:16:41 -0800 Zack Weinberg wrote:
As suggested by Stephen Smalley: map the various
sys_syslogoperations to a smaller set of privilege codes before calling security modules. This patch changes the security module interface! There should be no change in the actual security semantics enforced by dummy, capability, nor SELinux (with one exception, clearly marked insys_syslog).Change from previous version of patch: the privilege codes are now in
linux/security.hinstead oflinux/klog.h, and use the LSM_* naming convention used for other such constants in that file.Index:
linux-2.6/kernel/printk.c
===================================================================kernel/printk.c +6
-0@@ -164,6 +164,12 @@__setup ("log_buf_len=" , log_buf_len_setup); +#define security_syslog_or_fail (type) do { \ + int error = security_syslog(type); \ + if (error) \ + return error; \ + } while (0) +
Quoted 1 line
From
Documentation/CodingStyle:
Things to avoid when using macros:
1) macros that affect control flow: ...
Quoted 56 lines
/* See
linux/klog.hfor the command numbers passed as the first argument. */ intdo_syslog(int type, char __user *buf, int len)
{kernel/printk.c +9
-4@@ -172,16 +178,15 @@char c;int error =0 ; - error =security_syslog (type); -if (error) -return error; -switch (type) {case KLOG_CLOSE : +security_syslog_or_fail (LSM_KLOG_READ );break ;case KLOG_OPEN : +security_syslog_or_fail (LSM_KLOG_READ );break ;case KLOG_READ : +security_syslog_or_fail (LSM_KLOG_READ ); error = -EINVAL ;if (!buf || len <0 ) goto out;@@ -213,9 +218,11 @@ error = i;break ;case KLOG_READ_CLEAR_HIST : +security_syslog_or_fail (LSM_KLOG_CLEARHIST ); do_clear =1 ;/* FALL THRU */ case KLOG_READ_HIST : +security_syslog_or_fail (LSM_KLOG_READHIST ); error = -EINVAL ;if (!buf || len <0 ) goto out;@@ -269,15 +276,19 @@ }break ;case KLOG_CLEAR_HIST : +security_syslog_or_fail (LSM_KLOG_CLEARHIST ); logged_chars =0 ;break ;case KLOG_DISABLE_CONSOLE : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); console_loglevel = minimum_console_loglevel;break ;case KLOG_ENABLE_CONSOLE : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); console_loglevel = default_console_loglevel;break ;case KLOG_SET_CONSOLE_LVL : +security_syslog_or_fail (LSM_KLOG_CONSOLE ); error = -EINVAL ;if (len <1 || len >8 ) goto out;
kernel/printk.c line 303
Quoted 6 lines
kernel/printk.c +1
-0@@ -287,9 +298,18 @@ error =0 ;break ;case KLOG_GET_UNREAD : +security_syslog_or_fail (LSM_KLOG_READ ); error = log_end - log_start;break ;
---
~Randy
Re: [patch 2/4] permission mapping for sys_syslog operations
Quoted 9 lines · Randy Dunlap
kernel/printk.c line 172
Quoted 6 lines
kernel/printk.c +6
-0+#define security_syslog_or_fail (type) do { \ + int error = security_syslog(type); \ + if (error) \ + return error; \ + } while (0) +From
Documentation/CodingStyle:
Quoted 3 lines
Things to avoid when using macros:
1) macros that affect control flow: ...
It says "avoid", not "never use". If you can think of another way to code this function that won't completely obscure the actual operations with the security checks, I will be happy to change it.
zw
Re: [patch 2/4] permission mapping for sys_syslog operations
Quoted 10 lines · On Thu, 14 Dec 2006 17:21:25 -0800 Zack Weinberg wrote:
Quoted 9 lines · Randy Dunlap
kernel/printk.c line 172
Quoted 6 lines
kernel/printk.c +6
-0+#define security_syslog_or_fail (type) do { \ + int error = security_syslog(type); \ + if (error) \ + return error; \ + } while (0) +From
Documentation/CodingStyle:
Quoted 7 lines
Quoted 3 lines
Things to avoid when using macros:
1) macros that affect control flow: ...
It says "avoid", not "never use". If you can think of another way to code this function that won't completely obscure the actual operations with the security checks, I will be happy to change it.
The usual answer is to just open-code it. You may dislike that, but hiding control flow in macros is held as really bad by more than just me.
---
~Randy
PATCH 3/4 Refactor do_syslog interface
In reply to Zack WeinbergThis patch breaks out the read operations in do_syslog() into their own functions (klog_read, klog_readhist) and adds a klog_poll. klog_read grows the ability to do a nonblocking read, which I expose in the sys_syslog interface because there doesn't seem to be any reason not to. do_syslog itself is folded into sys_syslog. The security checks remain there, not in the subfunctions.
kmsg.c is then changed to use those functions instead of calling do_syslog and/or poll_wait itself.. This entails that it must call security_syslog as appropriate itself. In this patch I preserve the security checks exactly as they were with one exception: neither kmsg_close() nor sys_syslog(KLOG_CLOSE, ...) calls security_syslog at all anymore (close operations should never fail).
Finally, I fixed a couple of minor bugs. __put_user error handling in klog_read was slightly off: if __put_user returns an error, that character should not be consumed from the kernel buffer; if it returns an error after some characters have already been copied successfully, the read operation should return the count of already-copied characters, not the error code. Seeking on /proc/kmsg has never been meaningful, so kmsg_open() should call nonseekable_open() to enforce that.
Change from previous version of patch: proc/kmsg.c declares the kernel/printk.c interfaces itself, instead of getting them from klog.h which people want to be purely userspace-visible constants. kmsg.c has always had private declarations of printk.c functions (before, there were declarations of do_syslog and a wait queue there); as it is unlikely that more users of these functions will appear, I think this will do fine. (It might be reasonable to put declarations in console.h.)
zw
fs/proc/kmsg.c +16 -13
@@ -12,40 +12,43 @@#include <linux/poll.h> #include <linux/fs.h> #include <linux/klog.h> +#include <linux/security.h> #include <asm/uaccess.h> #include <asm/io.h> -extern wait_queue_head_t log_wait; - -extern int do_syslog (int type,char __user *bug,int count); +/* interfaces from kernel/printk.c */ +extern int klog_read (char __user *,int ,int ); +extern unsigned int klog_poll (struct file *,poll_table *);static int kmsg_open (struct inode * inode,struct file * file) { -return do_syslog (KLOG_OPEN ,NULL ,0 ); +int error =security_syslog (LSM_KLOG_READ ); +if (error) +return error; +return nonseekable_open (inode, file); }static int kmsg_release (struct inode * inode,struct file * file) { - (void )do_syslog (KLOG_CLOSE ,NULL ,0 );return 0 ; }static ssize_t kmsg_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) { -if ((file->f_flags &O_NONBLOCK ) - && !do_syslog (KLOG_GET_UNREAD ,NULL ,0 )) -return -EAGAIN ; -return do_syslog (KLOG_READ , buf, count); +int error =security_syslog (LSM_KLOG_READ ); +if (error) +return error; +return klog_read (buf, count, !(file->f_flags &O_NONBLOCK )); }static unsigned int kmsg_poll (struct file *file,poll_table *wait) { -poll_wait (file, &log_wait, wait); -if (do_syslog (KLOG_GET_UNREAD ,NULL ,0 )) -return POLLIN |POLLRDNORM ; -return 0 ; +int error =security_syslog (LSM_KLOG_READ ); +if (error) +return error; +return klog_poll (file, wait); }
include/linux/klog.h +3 -1
@@ -20,7 +20,9 @@* printed to console */ KLOG_GET_UNREAD =9 ,/* return number of unread characters */ -KLOG_GET_SIZE =10 /* return size of log buffer */ +KLOG_GET_SIZE =10 ,/* return size of log buffer */ + KLOG_READ_NONBLOCK = 11, /* read from log, don't block if empty + * -- new in 2.6.20 */ };#endif /* klog.h */
kernel/printk.c +120 -99
271 lines not on this page · raw message
--
PATCH 4/4 Distinguish /proc/kmsg access from sys_syslog
In reply to Zack WeinbergFinally, add a new security class for access to /proc/kmsg, distinct from the class used for the "read current messages" operations on sys_syslog. The dummy and capability modules permit access to /proc/kmsg to any user (who has somehow acquired an open fd on it); SELinux is unchanged. This accomplishes what I was trying to do in the first place, i.e. enable running klogd unprivileged without a root shim, in a non-SELinux installation. Please remember that the default DAC permissions for /proc/kmsg restrict it to root, so unless you chmod it in your installation or modify klogd to open the file and then drop privs, the actual restrictions are unchanged.
zw
fs/proc/kmsg.c +3 -3
@@ -23,7 +23,7 @@static int kmsg_open (struct inode * inode,struct file * file) { -int error =security_syslog (LSM_KLOG_READ ); +int error =security_syslog (LSM_KLOG_READ_PROC );if (error)return error;return nonseekable_open (inode, file);
@@ -37,7 +37,7 @@static ssize_t kmsg_read (struct file *file,char __user *buf,size_t count,loff_t *ppos) { -int error =security_syslog (LSM_KLOG_READ ); +int error =security_syslog (LSM_KLOG_READ_PROC );if (error)return error;return klog_read (buf, count, !(file->f_flags &O_NONBLOCK ));
@@ -45,7 +45,7 @@static unsigned int kmsg_poll (struct file *file,poll_table *wait) { -int error =security_syslog (LSM_KLOG_READ ); +int error =security_syslog (LSM_KLOG_READ_PROC );if (error)return error;return klog_poll (file, wait);
security/commoncap.c +8 -1
@@ -311,7 +311,14 @@int cap_syslog (int type) { -if (type !=LSM_KLOG_READHIST && !capable (CAP_SYS_ADMIN )) +/* +* Reading history is allowed to any user, and so is reading +* current messages via /proc/kmsg (by default that file is +* only readable by root, but root is allowed to change that, +* or open it and hand the fd to an unprivileged process). +*/ +if (type !=LSM_KLOG_READHIST && type !=LSM_KLOG_READ_PROC + && !capable (CAP_SYS_ADMIN ))return -EPERM ;return 0 ; }
security/selinux/hooks.c +7 -0
@@ -1515,7 +1515,14 @@case LSM_KLOG_CONSOLE :return task_has_system (current,SYSTEM__SYSLOG_CONSOLE ); +/* +* N.B. Unlike the default security model, with +* SELinux active you have to have SYSTEM__SYSLOG_MOD +* privilege to read current messages either with the +* system call or from /proc/kmsg. +*/ case LSM_KLOG_READ : +case LSM_KLOG_READ_PROC :case LSM_KLOG_CLEARHIST :default :return task_has_system (current,SYSTEM__SYSLOG_MOD );
include/linux/security.h +2 -0
@@ -94,6 +94,8 @@#define LSM_KLOG_READHIST 1/* read message history (dmesg) */ #define LSM_KLOG_CLEARHIST 2/* clear message history (dmesg -c) */ #define LSM_KLOG_CONSOLE 3/* set console log level */ +#define LSM_KLOG_READ_PROC 4/* read current messages, but from /proc/kmsg +rather than the system call */ /* forward declares to avoid warnings */ struct nfsctl_arg ;
--