linux/drivers/staging/erofs
Chao Yu eed276c040 staging: erofs: fix potential overflow in erofs_grab_bio()
As Dan reported in LKP's mailing list:

https://lists.01.org/pipermail/kbuild-all/2018-August/051419.html

New smatch warnings:
drivers/staging/erofs/internal.h:446 erofs_grab_bio() warn: should 'blkaddr << (12 - 9)' be a 64 bit type?
drivers/staging/erofs/data.c:78 __erofs_get_meta_page() error: 'bio' dereferencing possible ERR_PTR()
drivers/staging/erofs/internal.h:446 erofs_grab_bio() warn: should 'blkaddr << (12 - 9)' be a 64 bit type?

Old smatch warnings:
drivers/staging/erofs/unzip_vle.c:989 z_erofs_vle_unzip() error: double unlock 'mutex:&z_pagemap_global_lock'
drivers/staging/erofs/unzip_vle.c:1318 z_erofs_vle_normalaccess_readpage() warn: should 'page->index << 12' be a 64 bit type?
drivers/staging/erofs/unzip_vle.c:1351 __z_erofs_vle_normalaccess_readpages() warn: should '()->index << 12' be a 64 bit type?

It needs to cast varable's type to sector_t before left shifting.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-27 19:46:13 +02:00
..
include staging: erofs: <linux/tagptr.h>: introduce tagged pointer 2018-07-27 17:24:08 +02:00
data.c staging: erofs: separate erofs_get_meta_page 2018-08-27 19:46:12 +02:00
dir.c staging: erofs: add directory operations 2018-07-27 17:22:00 +02:00
erofs_fs.h staging: erofs: rearrange vle clustertype definitions 2018-08-27 19:46:13 +02:00
inode.c staging: erofs: introduce VLE decompression support 2018-07-27 17:24:10 +02:00
internal.h staging: erofs: fix potential overflow in erofs_grab_bio() 2018-08-27 19:46:13 +02:00
Kconfig staging: erofs: separate erofs_get_meta_page 2018-08-27 19:46:12 +02:00
lz4defs.h staging: erofs: introduce a customized LZ4 decompression 2018-07-27 17:24:09 +02:00
Makefile staging: erofs: add a generic z_erofs VLE decompressor 2018-07-27 17:24:09 +02:00
namei.c staging: erofs: use the wrapped PTR_ERR_OR_ZERO instead of open code 2018-07-30 09:38:34 +02:00
super.c staging: erofs: fix compile error without built-in decompression support 2018-07-29 08:05:02 +02:00
TODO staging: erofs: add a TODO and update MAINTAINERS for staging 2018-07-27 17:24:10 +02:00
unzip_lz4.c staging: erofs: introduce a customized LZ4 decompression 2018-07-27 17:24:09 +02:00
unzip_pagevec.h staging: erofs: introduce pagevec for unzip subsystem 2018-07-27 17:24:08 +02:00
unzip_vle_lz4.c staging: erofs: add a generic z_erofs VLE decompressor 2018-07-27 17:24:09 +02:00
unzip_vle.c staging: erofs: fix compression mapping beyond EOF 2018-08-27 19:46:13 +02:00
unzip_vle.h staging: erofs: fix a compile warning of Z_EROFS_VLE_VMAP_ONSTACK_PAGES 2018-07-28 09:21:30 +02:00
utils.c staging: erofs: fix compile error without built-in decompression support 2018-07-29 08:05:02 +02:00
xattr.c staging: erofs: add error handling for xattr submodule 2018-08-27 19:46:12 +02:00
xattr.h staging: erofs: introduce xattr & acl support 2018-07-27 17:24:08 +02:00