Skip to content

Commit

Permalink
io_uring: check that data field is 0 in ringfd unregister
Browse files Browse the repository at this point in the history
Only allow data field to be 0 in struct io_uring_rsrc_update user
arguments to allow for future possible usage.

Fixes: e7a6c00 ("io_uring: add support for registering ring file descriptors")
Signed-off-by: Eugene Syromiatnikov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
esyr-rh authored and axboe committed Apr 29, 2022
1 parent 32452a3 commit 303cc74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -10593,7 +10593,7 @@ static int io_ringfd_unregister(struct io_ring_ctx *ctx, void __user *__arg,
ret = -EFAULT;
break;
}
if (reg.resv || reg.offset >= IO_RINGFD_REG_MAX) {
if (reg.resv || reg.data || reg.offset >= IO_RINGFD_REG_MAX) {
ret = -EINVAL;
break;
}
Expand Down

0 comments on commit 303cc74

Please sign in to comment.