Commit 303cc749 authored by Eugene Syromiatnikov's avatar Eugene Syromiatnikov Committed by Jens Axboe

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: e7a6c00d ("io_uring: add support for registering ring file descriptors")
Signed-off-by: default avatarEugene Syromiatnikov <esyr@redhat.com>
Link: https://lore.kernel.org/r/20220429142218.GA28696@asgard.redhat.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 32452a3e
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment