lkml.org 
[lkml]   [2016]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: UBSAN: Undefined behaviour in block/blk-mq.c:1459:27 with pata_amd
    > Does the patch below help?
    >
    > From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
    > Subject: [PATCH] blk-mq: fix undefined behaviour in order_to_size()
    >
    > When this_order variable in blk_mq_init_rq_map() becomes zero
    > the code incorrectly decrements the variable and passes the result
    > to order_to_size() helper causing undefined behaviour:
    >
    > UBSAN: Undefined behaviour in block/blk-mq.c:1459:27
    > shift exponent 4294967295 is too large for 32-bit type 'unsigned int'
    > CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc6-00072-g33656a1 #22
    >
    > Fix the code by checking this_order variable for not having the zero
    > value first.
    >
    > Reported-by: Meelis Roos <mroos@linux.ee>
    > Fixes: 320ae51feed5 ("blk-mq: new multi-queue block IO queueing mechanism")
    > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

    It fixes the warning independently of the pata driver - ata_piix
    pata_via pata_serverworks pata_macio 3ware were fixed too.

    --
    Meelis Roos (mroos@linux.ee)

    \
     
     \ /
      Last update: 2016-05-18 08:01    [W:3.199 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site