lkml.org 
[lkml]   [2015]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 06/20] staging/lustre: fix comparison between signed and unsigned
    Date
    From: Dmitry Eremin <dmitry.eremin@intel.com>

    Expression if (size != (ssize_t)size) is always false.
    Therefore no bounds check errors detected.

    Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
    Reviewed-on: http://review.whamcloud.com/11376
    Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5417
    Reviewed-by: John L. Hammond <john.hammond@intel.com>
    Reviewed-by: Fan Yong <fan.yong@intel.com>
    Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
    ---
    drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
    index 89794fd..176bd46 100644
    --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
    +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
    @@ -1012,7 +1012,7 @@ static inline ssize_t hur_len(struct hsm_user_request *hur)
    (__u64)hur->hur_request.hr_itemcount *
    sizeof(hur->hur_user_item[0]) + hur->hur_request.hr_data_len;

    - if (size != (ssize_t)size)
    + if (size > ~((size_t)0)>>1)
    return -1;

    return size;
    --
    2.1.0


    \
     
     \ /
      Last update: 2015-02-02 04:21    [W:2.855 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site