Skip to content

Commit 303cc74

Browse files
esyr-rhaxboe
authored andcommitted
io_uring: check that data field is 0 in ringfd unregister
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 <esyr@redhat.com> Link: https://lore.kernel.org/r/20220429142218.GA28696@asgard.redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 32452a3 commit 303cc74

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10593,7 +10593,7 @@ static int io_ringfd_unregister(struct io_ring_ctx *ctx, void __user *__arg,
1059310593
ret = -EFAULT;
1059410594
break;
1059510595
}
10596-
if (reg.resv || reg.offset >= IO_RINGFD_REG_MAX) {
10596+
if (reg.resv || reg.data || reg.offset >= IO_RINGFD_REG_MAX) {
1059710597
ret = -EINVAL;
1059810598
break;
1059910599
}

0 commit comments

Comments
 (0)