Patch "erofs: fix potential overflow calculating xattr_isize" has been added to the 6.1-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 potential overflow calculating xattr_isize

to the 6.1-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-potential-overflow-calculating-xattr_isize.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 0790bd40e77bea6ceb002d6cb39bfb5a591ce1aa
Author: Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx>
Date:   Fri Apr 14 14:18:10 2023 +0800

    erofs: fix potential overflow calculating xattr_isize
    
    [ Upstream commit 1b3567a1969b26f709d82a874498c0754ea841c3 ]
    
    Given on-disk i_xattr_icount is 16 bits and xattr_isize is calculated
    from i_xattr_icount multiplying 4, xattr_isize has a theoretical maximum
    of 256K (64K * 4).
    
    Thus declare xattr_isize as unsigned int to avoid the potential overflow.
    
    Fixes: bfb8674dc044 ("staging: erofs: add erofs in-memory stuffs")
    Signed-off-by: Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx>
    Reviewed-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230414061810.6479-1-jefflexu@xxxxxxxxxxxxxxxxx
    Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 4868000806d8b..340bd56a57559 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -311,7 +311,7 @@ struct erofs_inode {
 
 	unsigned char datalayout;
 	unsigned char inode_isize;
-	unsigned short xattr_isize;
+	unsigned int xattr_isize;
 
 	unsigned int xattr_shared_count;
 	unsigned int *xattr_shared_xattrs;



[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