]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
apparmor/lsm: Fix aa_dfa_unpack's error handling in aa_setup_dfa_engine
authorGONG Ruiqi <gongruiqi1@huawei.com>
Thu, 23 Apr 2026 03:10:56 +0000 (11:10 +0800)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 23 Apr 2026 03:11:08 +0000 (20:11 -0700)
commit11b7df0952663f20ce72c9a22a3cf9278cf84db7
tree5a568bc2a666d4d7bcf4b9cc6f73e89bc7150d5c
parent828bf7929bedcb79b560b5b4e44f22abee07d31b
apparmor/lsm: Fix aa_dfa_unpack's error handling in aa_setup_dfa_engine

aa_dfa_unpack returns ERR_PTR not NULL when it fails, but aa_put_dfa
only checks NULL for its input, which would cause invalid memory access
in aa_put_dfa. Set nulldfa to NULL explicitly to fix that.

Fixes: 98b824ff8984 ("apparmor: refcount the pdb")
Signed-off-by: GONG Ruiqi <gongruiqi1@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c