Commit 19e12876 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] SElinux interface for reporting size of printk buffer

From: Olaf Dabrunz <od@suse.de>

Add the necessary hooks so that a SELinux-enabled kernel will allow the new
"report the size of the printk buffer" query to work.
parent 110eecfb
...@@ -289,7 +289,7 @@ void cap_task_reparent_to_init (struct task_struct *p) ...@@ -289,7 +289,7 @@ void cap_task_reparent_to_init (struct task_struct *p)
int cap_syslog (int type) int cap_syslog (int type)
{ {
if ((type != 3) && !capable(CAP_SYS_ADMIN)) if ((type != 3 && type != 10) && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
return 0; return 0;
} }
......
...@@ -99,7 +99,7 @@ static int dummy_quota_on (struct file *f) ...@@ -99,7 +99,7 @@ static int dummy_quota_on (struct file *f)
static int dummy_syslog (int type) static int dummy_syslog (int type)
{ {
if ((type != 3) && current->euid) if ((type != 3 && type != 10) && current->euid)
return -EPERM; return -EPERM;
return 0; return 0;
} }
......
...@@ -1476,6 +1476,7 @@ static int selinux_syslog(int type) ...@@ -1476,6 +1476,7 @@ static int selinux_syslog(int type)
switch (type) { switch (type) {
case 3: /* Read last kernel messages */ case 3: /* Read last kernel messages */
case 10: /* Return size of the log buffer */
rc = task_has_system(current, SYSTEM__SYSLOG_READ); rc = task_has_system(current, SYSTEM__SYSLOG_READ);
break; break;
case 6: /* Disable logging to console */ case 6: /* Disable logging to console */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment