[lkml]   [2011]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[146/146] AppArmor: fix oops in apparmor_setprocattr
2.6.38-stable review patch.  If anyone has any objections, please let us know.


From: Kees Cook <>

commit a5b2c5b2ad5853591a6cac6134cd0f599a720865 upstream.

When invalid parameters are passed to apparmor_setprocattr a NULL deref
oops occurs when it tries to record an audit message. This is because
it is passing NULL for the profile parameter for aa_audit. But aa_audit
now requires that the profile passed is not NULL.

Fix this by passing the current profile on the task that is trying to

Signed-off-by: Kees Cook <>
Signed-off-by: John Johansen <>
Signed-off-by: James Morris <>
Signed-off-by: Greg Kroah-Hartman <>

security/apparmor/lsm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -592,7 +592,8 @@ static int apparmor_setprocattr(struct t
sa.aad.op = OP_SETPROCATTR; = name;
sa.aad.error = -EINVAL;
+ return aa_audit(AUDIT_APPARMOR_DENIED,
+ __aa_current_profile(), GFP_KERNEL,
&sa, NULL);
} else if (strcmp(name, "exec") == 0) {

 \ /
  Last update: 2011-06-01 10:55    [W:0.334 / U:1.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site