summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2016-07-09 23:46:33 -0700
committerJohn Johansen <john.johansen@canonical.com>2016-07-12 08:43:10 -0700
commitd4d03f74a73f3b8b2801d4d02011b6b69778cbcc (patch)
tree47f8751de4824ffe3def8e782cba942998a26843 /security
parente89b8081327ac9efbf273e790b8677e64fd0361a (diff)
downloadop-kernel-dev-d4d03f74a73f3b8b2801d4d02011b6b69778cbcc.zip
op-kernel-dev-d4d03f74a73f3b8b2801d4d02011b6b69778cbcc.tar.gz
apparmor: fix arg_size computation for when setprocattr is null terminated
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/lsm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index c6921a0..3be30c7 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -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,
OpenPOWER on IntegriCloud