Patch "smackfs: use __GFP_NOFAIL for smk_cipso_doi()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    smackfs: use __GFP_NOFAIL for smk_cipso_doi()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     smackfs-use-__gfp_nofail-for-smk_cipso_doi.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d70b24cd745e10b7268187c15bf715d6b9186637
Author: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Date:   Tue Oct 19 20:54:31 2021 +0900

    smackfs: use __GFP_NOFAIL for smk_cipso_doi()
    
    [ Upstream commit f91488ee15bd3cac467e2d6a361fc2d34d1052ae ]
    
    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 <syzbot+89731ccb6fec15ce1c22@xxxxxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Casey Schaufler <casey@xxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index cec3f56739dc2..fdf5f336f834a 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -693,9 +693,7 @@ static void smk_cipso_doi(void)
 		printk(KERN_WARNING "%s:%d remove rc = %d\n",
 		       __func__, __LINE__, rc);
 
-	doip = kmalloc(sizeof(struct cipso_v4_doi), GFP_KERNEL);
-	if (doip == NULL)
-		panic("smack:  Failed to initialize cipso DOI.\n");
+	doip = kmalloc(sizeof(struct cipso_v4_doi), GFP_KERNEL | __GFP_NOFAIL);
 	doip->map.std = NULL;
 	doip->doi = smk_cipso_doi_value;
 	doip->type = CIPSO_V4_MAP_PASS;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux