mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF
commit0f5e4b83b3upstream. Similarly to the way it is done im mbind syscall. Cc: stable@vger.kernel.org # 5.14 Fixes:fe76421d1d("io_uring: allow user configurable IO thread CPU affinity") Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ae6cba337c
commit
fe223dd2f1
@@ -10683,7 +10683,15 @@ static int io_register_iowq_aff(struct io_ring_ctx *ctx, void __user *arg,
|
||||
if (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);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user