Skip to content

Commit 0934ad4

Browse files
Tetsuo Handacschaufler
authored andcommitted
smackfs: use netlbl_cfg_cipsov4_del() for deleting cipso_v4_doi
syzbot is reporting UAF at cipso_v4_doi_search() [1], for smk_cipso_doi() is calling kfree() without removing from the cipso_v4_doi_list list after netlbl_cfg_cipsov4_map_add() returned an error. We need to use netlbl_cfg_cipsov4_del() in order to remove from the list and wait for RCU grace period before kfree(). Link: https://syzkaller.appspot.com/bug?extid=93dba5b91f0fed312cbd [1] Reported-by: syzbot <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Fixes: 6c2e8ac ("netlabel: Update kernel configuration API") Signed-off-by: Casey Schaufler <[email protected]>
1 parent f91488e commit 0934ad4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/smack/smackfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static void smk_cipso_doi(void)
712712
if (rc != 0) {
713713
printk(KERN_WARNING "%s:%d map add rc = %d\n",
714714
__func__, __LINE__, rc);
715-
kfree(doip);
715+
netlbl_cfg_cipsov4_del(doip->doi, &nai);
716716
return;
717717
}
718718
}

0 commit comments

Comments
 (0)