lkml.org 
[lkml]   [2020]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 040/114] blktrace: fix trace mutex deadlock
    Date
    From: Jens Axboe <axboe@kernel.dk>

    commit 2967acbb257a6a9bf912f4778b727e00972eac9b upstream.

    A previous commit changed the locking around registration/cleanup,
    but direct callers of blk_trace_remove() were missed. This means
    that if we hit the error path in setup, we will deadlock on
    attempting to re-acquire the queue trace mutex.

    Fixes: 1f2cac107c59 ("blktrace: fix unlocked access to init/start-stop/teardown")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    kernel/trace/blktrace.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/kernel/trace/blktrace.c
    +++ b/kernel/trace/blktrace.c
    @@ -591,7 +591,7 @@ static int __blk_trace_setup(struct requ
    return ret;

    if (copy_to_user(arg, &buts, sizeof(buts))) {
    - blk_trace_remove(q);
    + __blk_trace_remove(q);
    return -EFAULT;
    }
    return 0;
    @@ -637,7 +637,7 @@ static int compat_blk_trace_setup(struct
    return ret;

    if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
    - blk_trace_remove(q);
    + __blk_trace_remove(q);
    return -EFAULT;
    }


    \
     
     \ /
      Last update: 2020-05-18 19:48    [W:4.559 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site