Patch "erofs: fix order >= MAX_ORDER warning due to crafted negative i_size" has been added to the 5.15-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

    erofs: fix order >= MAX_ORDER warning due to crafted negative i_size

to the 5.15-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:
     erofs-fix-order-max_order-warning-due-to-crafted-neg.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 40a68780653bd91ebbf658469175f3e189cdd685
Author: Gao Xiang <xiang@xxxxxxxxxx>
Date:   Fri Sep 9 10:39:48 2022 +0800

    erofs: fix order >= MAX_ORDER warning due to crafted negative i_size
    
    [ Upstream commit 1dd73601a1cba37a0ed5f89a8662c90191df5873 ]
    
    As syzbot reported [1], the root cause is that i_size field is a
    signed type, and negative i_size is also less than EROFS_BLKSIZ.
    As a consequence, it's handled as fast symlink unexpectedly.
    
    Let's fall back to the generic path to deal with such unusual i_size.
    
    [1] https://lore.kernel.org/r/000000000000ac8efa05e7feaa1f@xxxxxxxxxx
    
    Reported-by: syzbot+f966c13b1b4fc0403b19@xxxxxxxxxxxxxxxxxxxxxxxxx
    Fixes: 431339ba9042 ("staging: erofs: add inode operations")
    Reviewed-by: Yue Hu <huyue2@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220909023948.28925-1-hsiangkao@xxxxxxxxxxxxxxxxx
    Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index a552399e211d..0c293ff6697b 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -222,7 +222,7 @@ static int erofs_fill_symlink(struct inode *inode, void *data,
 
 	/* if it cannot be handled with fast symlink scheme */
 	if (vi->datalayout != EROFS_INODE_FLAT_INLINE ||
-	    inode->i_size >= PAGE_SIZE) {
+	    inode->i_size >= PAGE_SIZE || inode->i_size < 0) {
 		inode->i_op = &erofs_symlink_iops;
 		return 0;
 	}



[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