]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
io_uring: verify pad field is 0 in io_get_ext_arg
authorDylan Yudaken <dylany@fb.com>
Tue, 12 Apr 2022 16:30:42 +0000 (09:30 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:42:20 +0000 (14:42 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969857
[ Upstream commit d2347b9695dafe5c388a5f9aeb70e27a7a4d29cf ]

Ensure that only 0 is passed for pad here.

Fixes: c73ebb685fb6 ("io_uring: add timeout support for io_uring_enter()")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220412163042.2788062-5-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/io_uring.c

index 66671c0bd864658d3c83861c6befe162d27a80ee..cc0a07a9fe9cf7366394af17ead8501b23d11d11 100644 (file)
@@ -9981,6 +9981,8 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz
                return -EINVAL;
        if (copy_from_user(&arg, argp, sizeof(arg)))
                return -EFAULT;
+       if (arg.pad)
+               return -EINVAL;
        *sig = u64_to_user_ptr(arg.sigmask);
        *argsz = arg.sigmask_sz;
        *ts = u64_to_user_ptr(arg.ts);