lkml.org 
[lkml]   [2015]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] kernfs: Fix kernfs_name_compare
    On Fri, Dec 05, 2014 at 11:41:33PM +0100, Rasmus Villemoes wrote:
    > Returning a difference from a comparison functions is usually wrong
    > (see acbbe6fbb240 "kcmp: fix standard comparison bug" for the long
    > story). Here there is the additional twist that if the void pointers
    > ns and kn->ns happen to differ by a multiple of 2^32,
    > kernfs_name_compare returns 0, falsely reporting a match to the
    > caller.
    >
    > Technically 'hash - kn->hash' is ok since the hashes are restricted to
    > 31 bits, but it's better to avoid that subtlety.
    >
    > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

    Acked-by: Tejun Heo <tj@kernel.org>

    And this is a -stable material. Greg, can you please pick this one
    up?

    Thanks.

    --
    tejun


    \
     
     \ /
      Last update: 2015-01-05 15:21    [W:2.326 / U:1.236 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site