public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF
@ 2022-04-06 11:55 Eugene Syromiatnikov
  2022-04-06 12:48 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Syromiatnikov @ 2022-04-06 11:55 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov; +Cc: io-uring, linux-kernel, Artem Savkov

Similarly to the way it is done im mbind syscall.

Cc: [email protected] # 5.14
Fixes: fe76421d1da1dcdb ("io_uring: allow user configurable IO thread CPU affinity")
Signed-off-by: Eugene Syromiatnikov <[email protected]>
---
 fs/io_uring.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index de9c9de..83e194f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10803,7 +10803,15 @@ static __cold int io_register_iowq_aff(struct io_ring_ctx *ctx,
 	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;
 	}
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-06 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-06 11:55 [PATCH] io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF Eugene Syromiatnikov
2022-04-06 12:48 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox