Skip to content

Commit 0abd879

Browse files
dmikandidryomov
authored andcommitted
ceph: fix possible integer overflow in ceph_zero_objects()
In 'ceph_zero_objects', promote 'object_size' to 'u64' to avoid possible integer overflow. Compile tested only. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Kandybka <[email protected]> Reviewed-by: Viacheslav Dubeyko <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 0609092 commit 0abd879

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ceph/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,7 @@ static int ceph_zero_objects(struct inode *inode, loff_t offset, loff_t length)
26162616
s32 stripe_unit = ci->i_layout.stripe_unit;
26172617
s32 stripe_count = ci->i_layout.stripe_count;
26182618
s32 object_size = ci->i_layout.object_size;
2619-
u64 object_set_size = object_size * stripe_count;
2619+
u64 object_set_size = (u64) object_size * stripe_count;
26202620
u64 nearly, t;
26212621

26222622
/* round offset up to next period boundary */

0 commit comments

Comments
 (0)