Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: use mem_is_zero to check ring params

mem_is_zero() does the job without hand rolled loops, use that to verify
reserved fields of ring params.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
01405895 7bb21a52

+3 -5
+3 -5
io_uring/io_uring.c
··· 3684 3684 static long io_uring_setup(u32 entries, struct io_uring_params __user *params) 3685 3685 { 3686 3686 struct io_uring_params p; 3687 - int i; 3688 3687 3689 3688 if (copy_from_user(&p, params, sizeof(p))) 3690 3689 return -EFAULT; 3691 - for (i = 0; i < ARRAY_SIZE(p.resv); i++) { 3692 - if (p.resv[i]) 3693 - return -EINVAL; 3694 - } 3690 + 3691 + if (!mem_is_zero(&p.resv, sizeof(p.resv))) 3692 + return -EINVAL; 3695 3693 3696 3694 if (p.flags & ~IORING_SETUP_FLAGS) 3697 3695 return -EINVAL;