Skip to contentSkip to conversation

io_uring: check that data field is 0 in ringfd unregister

PATCH Applied Eugene Syromiatnikov 2 participants 2 messages Apr 29, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 7625b29..4e32338 100644
@@ -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;
 		}
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 4 lines · Eugene Syromiatnikov

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,

Signature · 1 line
Jens Axboe