mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
security: Define CAP_SYSLOG
Privileged syslog operations currently require CAP_SYS_ADMIN. Split this off into a new CAP_SYSLOG privilege which we can sanely take away from a container through the capability bounding set. With this patch, an lxc container can be prevented from messing with the host's syslog (i.e. dmesg -c). Changelog: mar 12 2010: add selinux capability2:cap_syslog perm Changelog: nov 22 2010: . port to new kernel . add a WARN_ONCE if userspace isn't using CAP_SYSLOG Signed-off-by: Serge Hallyn <[email protected]> Acked-by: Andrew G. Morgan <[email protected]> Acked-By: Kees Cook <[email protected]> Cc: James Morris <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Stephen Smalley <[email protected]> Cc: "Christopher J. PeBenito" <[email protected]> Cc: Eric Paris <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
1d6d75684d
commit
ce6ada35bd
3 changed files with 13 additions and 4 deletions
|
|
@ -283,8 +283,14 @@ int do_syslog(int type, char __user *buf, int len, bool from_file)
|
|||
return -EPERM;
|
||||
if ((type != SYSLOG_ACTION_READ_ALL &&
|
||||
type != SYSLOG_ACTION_SIZE_BUFFER) &&
|
||||
!capable(CAP_SYS_ADMIN))
|
||||
!capable(CAP_SYSLOG)) {
|
||||
/* remove after 2.6.38 */
|
||||
if (capable(CAP_SYS_ADMIN))
|
||||
WARN_ONCE(1, "Attempt to access syslog with "
|
||||
"CAP_SYS_ADMIN but no CAP_SYSLOG "
|
||||
"(deprecated and denied).\n");
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
|
||||
error = security_syslog(type);
|
||||
|
|
|
|||
Loading…
Reference in a new issue