]> git.karo-electronics.de Git - linux-beck.git/commitdiff
apparmor: fix arg_size computation for when setprocattr is null terminated
authorJohn Johansen <john.johansen@canonical.com>
Sun, 10 Jul 2016 06:46:33 +0000 (23:46 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Tue, 12 Jul 2016 15:43:10 +0000 (08:43 -0700)
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c

index c6921a0145ed543dd3300f2941a26c0083cad5e9..3be30c701bfab4030f11a652992c26423aba4ddf 100644 (file)
@@ -529,7 +529,7 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,
        if (!*args)
                goto out;
 
-       arg_size = size - (args - (char *) value);
+       arg_size = size - (args - (largs ? largs : (char *) value));
        if (strcmp(name, "current") == 0) {
                if (strcmp(command, "changehat") == 0) {
                        error = aa_setprocattr_changehat(args, arg_size,