Skip to content

Commit

Permalink
ceph: fix possible integer overflow in ceph_zero_objects()
Browse files Browse the repository at this point in the history
[ Upstream commit 0abd879 ]

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 <d.kandybka@gmail.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dmitry Kandybka authored and Greg Kroah-Hartman committed Jul 6, 2025
1 parent bb78405 commit 12a7802
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,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 */
Expand Down

0 comments on commit 12a7802

Please sign in to comment.