diff options
| author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-14 11:00:36 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-04-14 11:00:36 -0400 |
| commit | 277a163c83d7ba93fba1e8980d29a9f8bfcfba6c (patch) | |
| tree | ccfd357d152292958957b6b8a993892e7a8cc95f /kernel/capability.c | |
| parent | a83b93a7480441a47856dc9104bea970e84cda87 (diff) | |
| parent | c9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff) | |
Merge tag 'v3.15-rc1' into patchwork
Linux 3.15-rc1
* tag 'v3.15-rc1': (12180 commits)
Linux 3.15-rc1
mm: Initialize error in shmem_file_aio_read()
cifs: Use min_t() when comparing "size_t" and "unsigned long"
sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue
powerpc: Don't try to set LPCR unless we're in hypervisor mode
futex: update documentation for ordering guarantees
ceph: fix pr_fmt() redefinition
vti: don't allow to add the same tunnel twice
gre: don't allow to add the same tunnel twice
drivers: net: xen-netfront: fix array initialization bug
missing bits of "splice: fix racy pipe->buffers uses"
cifs: fix the race in cifs_writev()
ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure
pktgen: be friendly to LLTX devices
r8152: check RTL8152_UNPLUG
net: sun4i-emac: add promiscuous support
net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
blackfin: cleanup board files
bf609: clock: drop unused clock bit set/clear functions
Blackfin: bf537: rename "CONFIG_ADT75"
...
Diffstat (limited to 'kernel/capability.c')
| -rw-r--r-- | kernel/capability.c | 29 |
1 files changed, 10 insertions, 19 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 | ||
| 43 | static void warn_legacy_capability_use(void) | 45 | static 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 | ||
| 72 | static void warn_deprecated_v2(void) | 69 | static 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) | |||
| 380 | bool ns_capable(struct user_namespace *ns, int cap) | 371 | bool 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 | ||
