WSL2-Linux-Kernel/fs/hfsplus
Dongliang Mu 07db5e247a fs: hfsplus: fix UAF issue in hfsplus_put_super
The current hfsplus_put_super first calls hfs_btree_close on
sbi->ext_tree, then invokes iput on sbi->hidden_dir, resulting in an
use-after-free issue in hfsplus_release_folio.

As shown in hfsplus_fill_super, the error handling code also calls iput
before hfs_btree_close.

To fix this error, we move all iput calls before hfsplus_btree_close.

Note that this patch is tested on Syzbot.

Link: https://lkml.kernel.org/r/20230226124948.3175736-1-mudongliangabcd@gmail.com
Reported-by: syzbot+57e3e98f7e3b80f64d56@syzkaller.appspotmail.com
Tested-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-03-02 21:54:23 -08:00
..
Kconfig fs: build the legacy direct I/O code conditionally 2023-01-26 10:30:56 -07:00
Makefile
attributes.c
bfind.c
bitmap.c
bnode.c
brec.c
btree.c
catalog.c
dir.c fs: port ->rename() to pass mnt_idmap 2023-01-19 09:24:26 +01:00
extents.c fs: hfsplus: initialize fsdata in hfsplus_file_truncate() 2023-02-02 22:50:06 -08:00
hfsplus_fs.h fs: port ->fileattr_set() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
hfsplus_raw.h
inode.c fs: port inode_init_owner() to mnt_idmap 2023-01-19 09:24:28 +01:00
ioctl.c
options.c
part_tbl.c
super.c fs: hfsplus: fix UAF issue in hfsplus_put_super 2023-03-02 21:54:23 -08:00
tables.c
unicode.c
wrapper.c
xattr.c There is no particular theme here - mainly quick hits all over the tree. 2023-02-23 17:55:40 -08:00
xattr.h
xattr_security.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_trusted.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00
xattr_user.c fs: port xattr to mnt_idmap 2023-01-19 09:24:28 +01:00