aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 12:26:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 12:26:18 -0400
commitbea803183e12a1c78a12ec70907174d13d958333 (patch)
tree56a720b1eb02bb15ce5135078d9bbcbf06b74235 /kernel
parentcd6362befe4cc7bf589a5236d2a780af2d47bcc9 (diff)
parentf64410ec665479d7b4b77b7519e814253ed0f686 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem updates from James Morris: "Apart from reordering the SELinux mmap code to ensure DAC is called before MAC, these are minor maintenance updates" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (23 commits) selinux: correctly label /proc inodes in use before the policy is loaded selinux: put the mmap() DAC controls before the MAC controls selinux: fix the output of ./scripts/get_maintainer.pl for SELinux evm: enable key retention service automatically ima: skip memory allocation for empty files evm: EVM does not use MD5 ima: return d_name.name if d_path fails integrity: fix checkpatch errors ima: fix erroneous removal of security.ima xattr security: integrity: Use a more current logging style MAINTAINERS: email updates and other misc. changes ima: reduce memory usage when a template containing the n field is used ima: restore the original behavior for sending data with ima template Integrity: Pass commname via get_task_comm() fs: move i_readcount ima: use static const char array definitions security: have cap_dentry_init_security return error ima: new helper: file_inode(file) kernel: Mark function as static in kernel/seccomp.c capability: Use current logging styles ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/capability.c29
-rw-r--r--kernel/seccomp.c2
2 files changed, 11 insertions, 20 deletions
diff --git a/kernel/capability.c b/kernel/capability.c
index 34019c57888d..a8d63df0c322 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -7,6 +7,8 @@
7 * 30 May 2002: Cleanup, Robert M. Love <rml@tech9.net> 7 * 30 May 2002: Cleanup, Robert M. Love <rml@tech9.net>
8 */ 8 */
9 9
10#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11
10#include <linux/audit.h> 12#include <linux/audit.h>
11#include <linux/capability.h> 13#include <linux/capability.h>
12#include <linux/mm.h> 14#include <linux/mm.h>
@@ -42,15 +44,10 @@ __setup("no_file_caps", file_caps_disable);
42 44
43static void warn_legacy_capability_use(void) 45static void warn_legacy_capability_use(void)
44{ 46{
45 static int warned; 47 char name[sizeof(current->comm)];
46 if (!warned) { 48
47 char name[sizeof(current->comm)]; 49 pr_info_once("warning: `%s' uses 32-bit capabilities (legacy support in use)\n",
48 50 get_task_comm(name, current));
49 printk(KERN_INFO "warning: `%s' uses 32-bit capabilities"
50 " (legacy support in use)\n",
51 get_task_comm(name, current));
52 warned = 1;
53 }
54} 51}
55 52
56/* 53/*
@@ -71,16 +68,10 @@ static void warn_legacy_capability_use(void)
71 68
72static void warn_deprecated_v2(void) 69static void warn_deprecated_v2(void)
73{ 70{
74 static int warned; 71 char name[sizeof(current->comm)];
75 72
76 if (!warned) { 73 pr_info_once("warning: `%s' uses deprecated v2 capabilities in a way that may be insecure\n",
77 char name[sizeof(current->comm)]; 74 get_task_comm(name, current));
78
79 printk(KERN_INFO "warning: `%s' uses deprecated v2"
80 " capabilities in a way that may be insecure.\n",
81 get_task_comm(name, current));
82 warned = 1;
83 }
84} 75}
85 76
86/* 77/*
@@ -380,7 +371,7 @@ bool has_capability_noaudit(struct task_struct *t, int cap)
380bool ns_capable(struct user_namespace *ns, int cap) 371bool ns_capable(struct user_namespace *ns, int cap)
381{ 372{
382 if (unlikely(!cap_valid(cap))) { 373 if (unlikely(!cap_valid(cap))) {
383 printk(KERN_CRIT "capable() called with invalid cap=%u\n", cap); 374 pr_crit("capable() called with invalid cap=%u\n", cap);
384 BUG(); 375 BUG();
385 } 376 }
386 377
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index 4f18e754c23e..fd609bd9d6dd 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -290,7 +290,7 @@ free_prog:
290 * 290 *
291 * Returns 0 on success and non-zero otherwise. 291 * Returns 0 on success and non-zero otherwise.
292 */ 292 */
293long seccomp_attach_user_filter(char __user *user_filter) 293static long seccomp_attach_user_filter(char __user *user_filter)
294{ 294{
295 struct sock_fprog fprog; 295 struct sock_fprog fprog;
296 long ret = -EFAULT; 296 long ret = -EFAULT;