aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanlong Gao2012-03-07 08:17:13 -0600
committerEric Paris2012-04-09 11:23:07 -0500
commit0b36e44cc680b355f0d1b34002b2a10c9e1cae60 (patch)
tree60e6a2800af2980b1b83206d2b6f6fd20baf4165 /security/selinux
parent899838b25f063a94594b1df6e0100aea1ec57fac (diff)
downloadam43-linux-kernel-0b36e44cc680b355f0d1b34002b2a10c9e1cae60.tar.gz
am43-linux-kernel-0b36e44cc680b355f0d1b34002b2a10c9e1cae60.tar.xz
am43-linux-kernel-0b36e44cc680b355f0d1b34002b2a10c9e1cae60.zip
SELinux: replace weak GFP_ATOMIC to GFP_KERNEL in avc_add_callback
avc_add_callback now only called from initcalls, so replace the weak GFP_ATOMIC to GFP_KERNEL, and mark this function __init to make a warning when not been called from initcalls. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/avc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index c03a964ffde..5c1326e1883 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -510,7 +510,7 @@ noinline int slow_avc_audit(u32 ssid, u32 tsid, u16 tclass,
510 * @perms based on @tclass. Returns %0 on success or 510 * @perms based on @tclass. Returns %0 on success or
511 * -%ENOMEM if insufficient memory exists to add the callback. 511 * -%ENOMEM if insufficient memory exists to add the callback.
512 */ 512 */
513int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid, 513int __init avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid,
514 u16 tclass, u32 perms, 514 u16 tclass, u32 perms,
515 u32 *out_retained), 515 u32 *out_retained),
516 u32 events, u32 ssid, u32 tsid, 516 u32 events, u32 ssid, u32 tsid,
@@ -519,7 +519,7 @@ int avc_add_callback(int (*callback)(u32 event, u32 ssid, u32 tsid,
519 struct avc_callback_node *c; 519 struct avc_callback_node *c;
520 int rc = 0; 520 int rc = 0;
521 521
522 c = kmalloc(sizeof(*c), GFP_ATOMIC); 522 c = kmalloc(sizeof(*c), GFP_KERNEL);
523 if (!c) { 523 if (!c) {
524 rc = -ENOMEM; 524 rc = -ENOMEM;
525 goto out; 525 goto out;