Skip to content

Commit 5feaaa1

Browse files
jrjohansengregkh
authored andcommitted
apparmor: fix label can not be immediately before a declaration
[ Upstream commit 1ed40bd ] Fix error reported by kernel test robot security/apparmor/policy.c:1381:2: error: a label can only be part of a statement and a declaration is not a statement All errors (new ones prefixed by >>): security/apparmor/policy.c: In function 'aa_replace_profiles': >> security/apparmor/policy.c:1381:2: error: a label can only be part of a statement and a declaration is not a statement ssize_t udata_sz = udata->size; ^~~~~ Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202606150525.npax8WiH-lkp@intel.com/ Fixes: 7b42f95 ("apparmor: fix potential UAF in aa_replace_profiles") Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b8e8908 commit 5feaaa1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

security/apparmor/policy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,9 +1324,10 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label,
13241324
mutex_unlock(&ns->lock);
13251325

13261326
out:
1327+
aa_put_ns(ns);
1328+
13271329
ssize_t udata_sz = udata->size;
13281330

1329-
aa_put_ns(ns);
13301331
aa_put_profile_loaddata(udata);
13311332
kfree(ns_name);
13321333

0 commit comments

Comments
 (0)