Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227783
b: refs/heads/master
c: ce6ada3
h: refs/heads/master
i:
  227781: f56577a
  227779: 67a31a6
  227775: f64e3ae
v: v3
  • Loading branch information
Serge E. Hallyn authored and James Morris committed Nov 28, 2010
1 parent bea5dfb commit 69ff118
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d6d75684d869406e5bb2ac5d3ed9454f52d0cab
refs/heads/master: ce6ada35bdf710d16582cc4869c26722547e6f11
7 changes: 5 additions & 2 deletions trunk/include/linux/capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ struct cpu_vfs_cap_data {
/* Allow configuration of the secure attention key */
/* Allow administration of the random device */
/* Allow examination and configuration of disk quotas */
/* Allow configuring the kernel's syslog (printk behaviour) */
/* Allow setting the domainname */
/* Allow setting the hostname */
/* Allow calling bdflush() */
Expand Down Expand Up @@ -352,7 +351,11 @@ struct cpu_vfs_cap_data {

#define CAP_MAC_ADMIN 33

#define CAP_LAST_CAP CAP_MAC_ADMIN
/* Allow configuring the kernel's syslog (printk behaviour) */

#define CAP_SYSLOG 34

#define CAP_LAST_CAP CAP_SYSLOG

#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)

Expand Down
8 changes: 7 additions & 1 deletion trunk/kernel/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/selinux/include/classmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct security_class_mapping secclass_map[] = {
"node_bind", "name_connect", NULL } },
{ "memprotect", { "mmap_zero", NULL } },
{ "peer", { "recv", NULL } },
{ "capability2", { "mac_override", "mac_admin", NULL } },
{ "capability2", { "mac_override", "mac_admin", "syslog", NULL } },
{ "kernel_service", { "use_as_override", "create_files_as", NULL } },
{ "tun_socket",
{ COMMON_SOCK_PERMS, NULL } },
Expand Down

0 comments on commit 69ff118

Please sign in to comment.