Skip to content

Commit f3c0675

Browse files
committed
apparmor: fix test error: WARNING in apparmor_unix_stream_connect
commit 88fec35 ("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: [email protected] Fixes: 88fec35 ("apparmor: make sure unix socket labeling is correctly updated.") Signed-off-by: John Johansen <[email protected]>
1 parent 8936125 commit f3c0675

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

security/apparmor/lsm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,8 +1205,9 @@ static int apparmor_unix_stream_connect(struct sock *sk, struct sock *peer_sk,
12051205
if (error)
12061206
return error;
12071207

1208-
/* newsk doesn't go through post_create */
1209-
AA_BUG(rcu_access_pointer(new_ctx->label));
1208+
/* newsk doesn't go through post_create, but does go through
1209+
* security_sk_alloc()
1210+
*/
12101211
rcu_assign_pointer(new_ctx->label,
12111212
aa_get_label(rcu_dereference_protected(peer_ctx->label,
12121213
true)));

0 commit comments

Comments
 (0)