Skip to content

Commit f91488e

Browse files
Tetsuo Handacschaufler
authored andcommitted
smackfs: use __GFP_NOFAIL for smk_cipso_doi()
syzbot is reporting kernel panic at smk_cipso_doi() due to memory allocation fault injection [1]. The reason for need to use panic() was not explained. But since no fix was proposed for 18 months, for now let's use __GFP_NOFAIL for utilizing syzbot resource on other bugs. Link: https://syzkaller.appspot.com/bug?extid=89731ccb6fec15ce1c22 [1] Reported-by: syzbot <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Signed-off-by: Casey Schaufler <[email protected]>
1 parent b57d020 commit f91488e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

security/smack/smackfs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,7 @@ static void smk_cipso_doi(void)
693693
printk(KERN_WARNING "%s:%d remove rc = %d\n",
694694
__func__, __LINE__, rc);
695695

696-
doip = kmalloc(sizeof(struct cipso_v4_doi), GFP_KERNEL);
697-
if (doip == NULL)
698-
panic("smack: Failed to initialize cipso DOI.\n");
696+
doip = kmalloc(sizeof(struct cipso_v4_doi), GFP_KERNEL | __GFP_NOFAIL);
699697
doip->map.std = NULL;
700698
doip->doi = smk_cipso_doi_value;
701699
doip->type = CIPSO_V4_MAP_PASS;

0 commit comments

Comments
 (0)