Skip to content

Commit 0f5e4b8

Browse files
esyr-rhaxboe
authored andcommitted
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: fe76421 ("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>
1 parent cb31821 commit 0f5e4b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/io_uring.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11472,7 +11472,15 @@ static __cold int io_register_iowq_aff(struct io_ring_ctx *ctx,
1147211472
if (len > cpumask_size())
1147311473
len = cpumask_size();
1147411474

11475-
if (copy_from_user(new_mask, arg, len)) {
11475+
if (in_compat_syscall()) {
11476+
ret = compat_get_bitmap(cpumask_bits(new_mask),
11477+
(const compat_ulong_t __user *)arg,
11478+
len * 8 /* CHAR_BIT */);
11479+
} else {
11480+
ret = copy_from_user(new_mask, arg, len);
11481+
}
11482+
11483+
if (ret) {
1147611484
free_cpumask_var(new_mask);
1147711485
return -EFAULT;
1147811486
}

0 commit comments

Comments
 (0)