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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 32452a3 commit 303cc74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)