aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromiatnikov <[email protected]>2022-04-29 16:22:18 +0200
committerJens Axboe <[email protected]>2022-04-29 08:39:43 -0600
commit303cc749c8659d5f1ccf97973591313ec0bdacd3 (patch)
tree38f0530dc123bfb1ea423537ab422eee8dc7e9e6
parent32452a3eb8b64e01e2be717f518c0be046975b9d (diff)
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: e7a6c00dc77a ("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]>
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index e3ae26ff5d1a..e01f595f5b7d 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;
}