linux-stable/fs/erofs
Gao Xiang 1266b4a7ec erofs: fix double free of 'copied'
Dan reported a new smatch warning [1]
"fs/erofs/inode.c:210 erofs_read_inode() error: double free of 'copied'"

Due to new chunk-based format handling logic, the error path can be
called after kfree(copied).

Set "copied = NULL" after kfree(copied) to fix this.

[1] https://lore.kernel.org/r/202108251030.bELQozR7-lkp@intel.com

Link: https://lore.kernel.org/r/20210825120757.11034-1-hsiangkao@linux.alibaba.com
Fixes: c5aa903a59 ("erofs: support reading chunk-based uncompressed files")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2021-08-25 22:05:58 +08:00
..
compress.h erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
data.c erofs: support reading chunk-based uncompressed files 2021-08-20 22:38:01 +08:00
decompressor.c erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
dir.c erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
erofs_fs.h erofs: introduce chunk-based file on-disk format 2021-08-20 22:38:01 +08:00
inode.c erofs: fix double free of 'copied' 2021-08-25 22:05:58 +08:00
internal.h erofs: support reading chunk-based uncompressed files 2021-08-20 22:38:01 +08:00
Kconfig erofs: iomap support for non-tailpacking DIO 2021-08-10 00:14:42 +08:00
Makefile erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
namei.c erofs: add fiemap support with iomap 2021-08-19 00:13:43 +08:00
pcpubuf.c erofs: introduce multipage per-CPU buffers 2021-04-10 03:19:59 +08:00
super.c erofs: remove the mapping parameter from erofs_try_to_free_cached_page() 2021-08-11 09:47:39 +08:00
tagptr.h erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
utils.c erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
xattr.c erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
xattr.h erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
zdata.c erofs: remove the mapping parameter from erofs_try_to_free_cached_page() 2021-08-11 09:47:39 +08:00
zdata.h erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00
zmap.c erofs: add fiemap support with iomap 2021-08-19 00:13:43 +08:00
zpvec.h erofs: clean up file headers & footers 2021-06-08 00:41:24 +08:00