Whamcloud - gitweb
LU-17517 lov: fix large shift in lov_update_statfs() 43/54043/4
authorTimothy Day <timday@amazon.com>
Wed, 14 Feb 2024 06:17:00 +0000 (06:17 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 23 Mar 2024 05:54:48 +0000 (05:54 +0000)
commitedbaee798b5e83b0c829cae40419a26f1b0d56c8
treec35d1115b89f727c01cf99bd770f8b8a4bcff239
parent36da06650079edf29192529457ffa0631427b84e
LU-17517 lov: fix large shift in lov_update_statfs()

UBSAN detected:

 shift exponent 65 is too large for
 64-bit type 'long long unsigned int'

in lov_update_statfs() in lov_request.c. This
patch caps shift at 32 since os_bsize is of
type u32. This avoids the invocation of
undefined behavior.

Reported-by: Ake Sandgren <ake.sandgren@hpc2n.umu.se>
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I9ed6dd145279631e8a362c85c6fd46f147ab6946
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54043
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_request.c