]> git.baikalelectronics.ru Git - kernel.git/commit
staging: erofs: fix potential overflow in z_erofs_vle_normalaccess_readpage{,s}
authorGao Xiang <gaoxiang25@huawei.com>
Fri, 24 Aug 2018 02:02:40 +0000 (10:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Aug 2018 17:46:39 +0000 (19:46 +0200)
commit2300d6a66940e6b4f4c7f072639d19441f2c10b5
tree8ab1238b8b66d5e160fe1099a9ea339affe37318
parent9e160f1942c9cc3f4540310cec99b6524ca4a570
staging: erofs: fix potential overflow in z_erofs_vle_normalaccess_readpage{,s}

As Dan reported in the LKP mailing list:
https://lists.01.org/pipermail/kbuild-all/2018-August/051558.html

New smatch warnings:
drivers/staging/erofs/unzip_vle.c:1359 z_erofs_vle_normalaccess_readpages() warn: should '()->index << 12' be a 64 bit type?

Old smatch warnings:
drivers/staging/erofs/unzip_vle.c:1322 z_erofs_vle_normalaccess_readpage() warn: should 'page->index << 12' be a 64 bit type?

It needs to cast variable's type to erofs_off_t before left shifting.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/erofs/unzip_vle.c