Patch "fs/ufs: avoid potential u32 multiplication overflow" has been added to the 4.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

    fs/ufs: avoid potential u32 multiplication overflow

to the 4.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:
     fs-ufs-avoid-potential-u32-multiplication-overflow.patch
and it can be found in the queue-4.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 2663441081806f11595dc7edad06b1ea50885601
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Tue Aug 11 18:35:53 2020 -0700

    fs/ufs: avoid potential u32 multiplication overflow
    
    [ Upstream commit 88b2e9b06381551b707d980627ad0591191f7a2d ]
    
    The 64 bit ino is being compared to the product of two u32 values,
    however, the multiplication is being performed using a 32 bit multiply so
    there is a potential of an overflow.  To be fully safe, cast uspi->s_ncg
    to a u64 to ensure a 64 bit multiplication occurs to avoid any chance of
    overflow.
    
    Fixes: f3e2a520f5fb ("ufs: NFS support")
    Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Cc: Evgeniy Dushistov <dushistov@xxxxxxx>
    Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
    Link: http://lkml.kernel.org/r/20200715170355.1081713-1-colin.king@xxxxxxxxxxxxx
    Addresses-Coverity: ("Unintentional integer overflow")
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 10f364490833e..be68b48de1cc6 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -99,7 +99,7 @@ static struct inode *ufs_nfs_get_inode(struct super_block *sb, u64 ino, u32 gene
 	struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi;
 	struct inode *inode;
 
-	if (ino < UFS_ROOTINO || ino > uspi->s_ncg * uspi->s_ipg)
+	if (ino < UFS_ROOTINO || ino > (u64)uspi->s_ncg * uspi->s_ipg)
 		return ERR_PTR(-ESTALE);
 
 	inode = ufs_iget(sb, ino);



[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