Commit 0f5e4b83 authored by Eugene Syromiatnikov's avatar Eugene Syromiatnikov Committed by Jens Axboe

io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF

Similarly to the way it is done im mbind syscall.

Cc: stable@vger.kernel.org # 5.14
Fixes: fe76421d ("io_uring: allow user configurable IO thread CPU affinity")
Signed-off-by: default avatarEugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent cb318216
...@@ -11472,7 +11472,15 @@ static __cold int io_register_iowq_aff(struct io_ring_ctx *ctx, ...@@ -11472,7 +11472,15 @@ static __cold int io_register_iowq_aff(struct io_ring_ctx *ctx,
if (len > cpumask_size()) if (len > cpumask_size())
len = cpumask_size(); len = cpumask_size();
if (copy_from_user(new_mask, arg, len)) { if (in_compat_syscall()) {
ret = compat_get_bitmap(cpumask_bits(new_mask),
(const compat_ulong_t __user *)arg,
len * 8 /* CHAR_BIT */);
} else {
ret = copy_from_user(new_mask, arg, len);
}
if (ret) {
free_cpumask_var(new_mask); free_cpumask_var(new_mask);
return -EFAULT; return -EFAULT;
} }
......
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