We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79012cf commit cebf9daCopy full SHA for cebf9da
fs/xfs/xfs_mount.c
@@ -132,11 +132,16 @@ xfs_sb_validate_fsb_count(
132
xfs_sb_t *sbp,
133
uint64_t nblocks)
134
{
135
+ uint64_t max_bytes;
136
+
137
ASSERT(PAGE_SHIFT >= sbp->sb_blocklog);
138
ASSERT(sbp->sb_blocklog >= BBSHIFT);
139
140
+ if (check_shl_overflow(nblocks, sbp->sb_blocklog, &max_bytes))
141
+ return -EFBIG;
142
143
/* Limited by ULONG_MAX of page cache index */
- if (nblocks >> (PAGE_SHIFT - sbp->sb_blocklog) > ULONG_MAX)
144
+ if (max_bytes >> PAGE_SHIFT > ULONG_MAX)
145
return -EFBIG;
146
return 0;
147
}
0 commit comments