Whamcloud - gitweb
LU-9862 lov: Correct bounds checking 84/28484/16
authorNathaniel Clark <nclark@whamcloud.com>
Thu, 4 Jul 2019 15:34:05 +0000 (11:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 12 Jul 2019 05:40:31 +0000 (05:40 +0000)
commit31ff883c7b0cb4ffbea2cffeb853ea4acc9688d6
tree8d6cd236a3fa946dcb469420368b33a31ef0fd59
parent23cbeb6e31a77ea2face6fdd947aac5ad3c4e099
LU-9862 lov: Correct bounds checking

While Dan Carpenter ran his smatch tool against the lustre code
base he encountered the following static checker warning:

lustre/lov/lov_ea.c:207 lsm_unpackmd_common()
warn: signed overflow undefined. 'min_stripe_maxbytes * stripe_count < min_stripe_maxbytes'

The current code doesn't properly handle the potential overflow
with the min_stripe_maxbytes * stripe_count. This fixes the
overflow detection for maxbytes in lsme_unpack().

Change-Id: I34646df3d59cadcb42a4defb58e16cb840acc99
Fixes: 3ddcf5b4a138 ("LU-7890 lov: Ensure correct operation for large object sizes")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/28484
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_ea.c