Commit d2347b96 authored by Dylan Yudaken's avatar Dylan Yudaken Committed by Jens Axboe

io_uring: verify pad field is 0 in io_get_ext_arg

Ensure that only 0 is passed for pad here.

Fixes: c73ebb68 ("io_uring: add timeout support for io_uring_enter()")
Signed-off-by: default avatarDylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220412163042.2788062-5-dylany@fb.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6fb53cf8
...@@ -10711,6 +10711,8 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz ...@@ -10711,6 +10711,8 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz
return -EINVAL; return -EINVAL;
if (copy_from_user(&arg, argp, sizeof(arg))) if (copy_from_user(&arg, argp, sizeof(arg)))
return -EFAULT; return -EFAULT;
if (arg.pad)
return -EINVAL;
*sig = u64_to_user_ptr(arg.sigmask); *sig = u64_to_user_ptr(arg.sigmask);
*argsz = arg.sigmask_sz; *argsz = arg.sigmask_sz;
*ts = u64_to_user_ptr(arg.ts); *ts = u64_to_user_ptr(arg.ts);
......
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