diff options
author | John Johansen <john.johansen@canonical.com> | 2022-10-10 12:15:10 -0700 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-10-10 17:17:19 -0700 |
commit | 53991aedcd34760be23f1b0ef312e39b6add84af (patch) | |
tree | 608588c6eed0174e0f2c7e949ad88b4f41bf25e6 /security/smack/smackfs.c | |
parent | ee21a175ecfa821b74822881d354c7f848930738 (diff) | |
download | linux-stable-53991aedcd34760be23f1b0ef312e39b6add84af.tar.gz linux-stable-53991aedcd34760be23f1b0ef312e39b6add84af.tar.bz2 linux-stable-53991aedcd34760be23f1b0ef312e39b6add84af.zip |
apparmor: Fix unpack_profile() warn: passing zero to 'ERR_PTR'
unpack_profile() sets a default error on entry but this gets overridden
by error assignment by functions called in its body. If an error
check that was relying on the default value is triggered after one
of these error assignments then zero will be passed to ERR_PTR.
Fix this by setting up a default -EPROTO assignment in the error
path and while we are at it make sure the correct error is returned
in non-default cases.
Fixes: 217af7e2f4de ("apparmor: refactor profile rules and attachments")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/smack/smackfs.c')
0 files changed, 0 insertions, 0 deletions