apparmor: fix test error: WARNING in apparmor_unix_stream_connect
authorJohn Johansen <john.johansen@canonical.com>
Wed, 30 Jul 2025 10:08:29 +0000 (03:08 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Wed, 30 Jul 2025 12:00:47 +0000 (05:00 -0700)
commitf3c0675bb9e0a3a472dd519ec7ccde23bdcf180b
tree8ecefcd761fe3aee6a658488b43e9ed19438c3e6
parent8936125e232803e64cb29e107326a942981188d6
apparmor: fix test error: WARNING in apparmor_unix_stream_connect

commit 88fec3526e84 ("apparmor: make sure unix socket labeling is correctly updated.")
added the use of security_sk_alloc() which ensures the sk label is
initialized.

This means that the AA_BUG in apparmor_unix_stream_connect() is no
longer correct, because while the sk is still not being initialized
by going through post_create, it is now initialize in sk_alloc().
Remove the now invalid check.

Reported-by: syzbot+cd38ee04bcb3866b0c6d@syzkaller.appspotmail.com
Fixes: 88fec3526e84 ("apparmor: make sure unix socket labeling is correctly updated.")
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c