Commit 0abd8794 authored by Dmitry Kandybka's avatar Dmitry Kandybka Committed by Ilya Dryomov
Browse files

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: default avatarDmitry Kandybka <d.kandybka@gmail.com>
Reviewed-by: default avatarViacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 06090927
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2616,7 +2616,7 @@ static int ceph_zero_objects(struct inode *inode, loff_t offset, loff_t length)
	s32 stripe_unit = ci->i_layout.stripe_unit;
	s32 stripe_count = ci->i_layout.stripe_count;
	s32 object_size = ci->i_layout.object_size;
	u64 object_set_size = object_size * stripe_count;
	u64 object_set_size = (u64) object_size * stripe_count;
	u64 nearly, t;

	/* round offset up to next period boundary */