Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -6082,12 +6082,9 @@ static int rbd_dev_v2_snap_context(struct rbd_device *rbd_dev,

/*
* Make sure the reported number of snapshot ids wouldn't go
* beyond the end of our buffer. But before checking that,
* make sure the computed size of the snapshot context we
* allocate is representable in a size_t.
* beyond the end of our buffer.
*/
if (snap_count > (SIZE_MAX - sizeof (struct ceph_snap_context))
/ sizeof (u64)) {
if (snap_count > RBD_MAX_SNAP_COUNT) {
ret = -EINVAL;
goto out;
}
Expand Down
Loading