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@cloud.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Alejandro Vallejo authored and Andrew Cooper committed 2023-10-11 06:36:49 +01:00
1 parent 37fc1e6c1c
commit ddc45e4eea
1 file changed
+1 -1
+1 -1
View File
@@ -61,7 +61,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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.