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

[xen stable-4.17] libfsimage/xfs: Amend mask32lo() to allow the value 32



commit f1cd620cc3572c858e276463e05f695d949362c5
Author:     Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
AuthorDate: Thu Sep 14 13:22:51 2023 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Sep 27 16:29:27 2023 +0100

    libfsimage/xfs: Amend mask32lo() to allow the value 32
    
    agblklog could plausibly be 32, but that would overflow this shift.
    Perform the shift as ULL and cast to u32 at the end instead.
    
    This is part of XSA-443 / CVE-2023-34325
    
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    (cherry picked from commit ddc45e4eea946bb373a4b4a60c84bf9339cf413b)
---
 tools/libfsimage/xfs/fsys_xfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libfsimage/xfs/fsys_xfs.c b/tools/libfsimage/xfs/fsys_xfs.c
index 2800699f59..4720bb4505 100644
--- a/tools/libfsimage/xfs/fsys_xfs.c
+++ b/tools/libfsimage/xfs/fsys_xfs.c
@@ -60,7 +60,7 @@ static struct xfs_info xfs;
 #define inode          ((xfs_dinode_t *)((char *)FSYS_BUF + 8192))
 #define icore          (inode->di_core)
 
-#define        mask32lo(n)     (((xfs_uint32_t)1 << (n)) - 1)
+#define        mask32lo(n)     ((xfs_uint32_t)((1ull << (n)) - 1))
 
 #define        XFS_INO_MASK(k)         ((xfs_uint32_t)((1ULL << (k)) - 1))
 #define        XFS_INO_OFFSET_BITS     xfs.inopblog
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.