lkml.org 
[lkml]   [2022]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.17 278/343] io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF
    Date
    From: Eugene Syromiatnikov <esyr@redhat.com>

    commit 0f5e4b83b37a96e3643951588ed7176b9b187c0a upstream.

    Similarly to the way it is done im mbind syscall.

    Cc: stable@vger.kernel.org # 5.14
    Fixes: fe76421d1da1dcdb ("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>
    ---
    fs/io_uring.c | 10 +++++++++-
    1 file changed, 9 insertions(+), 1 deletion(-)

    --- a/fs/io_uring.c
    +++ b/fs/io_uring.c
    @@ -10860,7 +10860,15 @@ static __cold int io_register_iowq_aff(s
    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;
    }

    \
     
     \ /
      Last update: 2022-04-12 11:00    [W:4.057 / U:0.192 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site