All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: check that data field is 0 in ringfd unregister
@ 2022-04-29 14:22 Eugene Syromiatnikov
  2022-04-29 14:40 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Syromiatnikov @ 2022-04-29 14:22 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov; +Cc: io-uring, linux-kernel

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 <esyr@redhat.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7625b29..4e32338 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10588,7 +10588,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;
 		}
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: check that data field is 0 in ringfd unregister
  2022-04-29 14:22 [PATCH] io_uring: check that data field is 0 in ringfd unregister Eugene Syromiatnikov
@ 2022-04-29 14:40 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-04-29 14:40 UTC (permalink / raw)
  To: esyr, asml.silence; +Cc: linux-kernel, io-uring

On Fri, 29 Apr 2022 16:22:18 +0200, Eugene Syromiatnikov wrote:
> Only allow data field to be 0 in struct io_uring_rsrc_update user
> arguments to allow for future possible usage.
> 
> 

Applied, thanks!

[1/1] io_uring: check that data field is 0 in ringfd unregister
      commit: 303cc749c8659d5f1ccf97973591313ec0bdacd3

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-29 14:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 14:22 [PATCH] io_uring: check that data field is 0 in ringfd unregister Eugene Syromiatnikov
2022-04-29 14:40 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.