android_kernel_asus_sm8350/fs
Miklos Szeredi e3df45eef8 fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):

The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory.  After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which, among other things does:

          inode->i_mode = S_IFREG;

This then confuses dnotify which doesn't tear down its structures
properly and eventually crashes.

Avoid calling make_bad_inode() on a live inode: switch to a private flag on
the fuse inode.  Also add the test to ops which the bad_inode_ops would
have caught.

This change goes back to the initial merge of fuse in 2.6.14...

Change-Id: Iec8f3c66e1ee214e641d71cf01e6f0c2755c3cef
Reported-by: syzbot+f427adf9324b92652ccc@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Tested-by: Jan Kara <jack@suse.cz>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Git-commit: 732251cabe
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Pradeep P V K <pragalla@codeaurora.org>
2021-08-23 22:25:08 -07:00
..
9p This is the 5.4.75 stable release 2020-11-05 13:27:24 +01:00
adfs Merge branch 'work.adfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 11:33:22 -07:00
affs affs: fix basic permission bits to actually work 2020-09-09 19:12:34 +02:00
afs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
autofs autofs: fix a leak in autofs_expire_indirect() 2019-10-25 00:03:11 -04:00
befs fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
bfs fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
btrfs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
cachefiles cachefiles: Handle readpage error correctly 2020-11-05 11:43:36 +01:00
ceph This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
cifs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
coda y2038: add inode timestamp clamping 2019-09-19 09:42:37 -07:00
configfs FROMGIT: configfs: fix a use-after-free in __configfs_open_file 2021-03-13 14:31:17 +00:00
cramfs cramfs: fix usage on non-MTD device 2019-11-23 21:44:49 -05:00
crypto UPSTREAM: fscrypt: restrict IV_INO_LBLK_* to AES-256-XTS 2020-11-14 16:29:45 +01:00
debugfs debugfs: Fix module state check condition 2020-09-17 13:47:55 +02:00
devpts devpts_pty_kill(): don't bother with d_delete() 2019-09-03 09:30:56 -04:00
dlm fs: dlm: fix configfs memory leak 2020-10-29 09:58:03 +01:00
ecryptfs This is the 5.4.23 stable release 2020-03-01 10:17:44 +01:00
efivarfs efivarfs: revert "fix memory leak in efivarfs_create()" 2020-12-02 08:49:53 +01:00
efs fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
erofs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
exfat exfat: Avoid allocating upcase table using kcalloc() 2021-02-22 11:23:23 +08:00
exportfs exportfs_decode_fh(): negative pinned may become positive without the parent locked 2019-11-10 11:56:05 -05:00
ext2 This is the 5.4.64 stable release 2020-09-14 13:00:56 +02:00
ext4 This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
f2fs UPSTREAM: f2fs: fix double free of unicode map 2021-05-03 20:55:42 -07:00
fat fat: don't allow to mount if the FAT length == 0 2020-06-17 16:40:36 +02:00
freevxfs fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
fscache Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
fuse fuse: fix bad inode 2021-08-23 22:25:08 -07:00
gfs2 This is the 5.4.83 stable release 2020-12-11 15:00:01 +01:00
hfs FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00
hfsplus This is the 5.4.33 stable release 2020-04-17 11:26:58 +02:00
hostfs
hpfs fs: hpfs: Initialize filesystem timestamp ranges 2019-08-30 08:11:25 -07:00
hugetlbfs Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
incfs ANDROID: Incremental fs: Set credentials before reading/writing 2021-04-22 22:34:21 +00:00
iomap This is the 5.4.73 stable release 2020-10-29 11:38:08 +01:00
isofs y2038: add inode timestamp clamping 2019-09-19 09:42:37 -07:00
jbd2 jbd2: fix up sparse warnings in checkpoint code 2020-11-18 19:20:30 +01:00
jffs2 This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
jfs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
kernfs This is the 5.4.59 stable release 2020-08-19 08:40:57 +02:00
lockd lockd: don't use interval-based rebinding over TCP 2020-12-30 11:51:16 +01:00
minix Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
nfs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
nfs_common nfs_common: need lock during iterate through the list 2020-12-30 11:51:22 +01:00
nfsd nfsd: Fix message level for normal termination 2020-12-30 11:51:22 +01:00
nilfs2 nilfs2: fix null pointer dereference at nilfs_segctor_do_construct() 2020-06-17 16:40:29 +02:00
nls
notify ANDROID: vfs: add d_canonical_path for stacked filesystem support 2020-10-30 10:02:25 +01:00
ntfs ntfs: add check for mft record size in superblock 2020-10-29 09:58:03 +01:00
ocfs2 This is the 5.4.78 stable release 2020-11-19 08:52:52 +01:00
omfs fs: omfs: Initialize filesystem timestamp ranges 2019-08-30 08:11:25 -07:00
openpromfs Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
orangefs Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
overlayfs This is the 5.4.53 stable release 2020-07-23 12:36:54 +02:00
proc Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
pstore pstore: Add buffer start check during init 2020-12-10 15:38:51 +08:00
qnx4 fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
qnx6 fs: Fill in max and min timestamps in superblock 2019-08-30 07:27:17 -07:00
quota quota: Sanity-check quota file headers on load 2020-12-30 11:51:00 +01:00
ramfs ramfs: fix nommu mmap with gaps in the page cache 2020-10-29 09:57:53 +01:00
reiserfs This is the 5.4.73 stable release 2020-10-29 11:38:08 +01:00
romfs romfs: fix uninitialized memory leak in romfs_dev_read() 2020-08-26 10:40:51 +02:00
squashfs FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00
sysfs Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
sysv fs: sysv: Initialize filesystem timestamp ranges 2019-08-30 07:27:18 -07:00
tracefs tracing: Do not create tracefs files if tracefs lockdown is in effect 2019-10-12 20:49:07 -04:00
ubifs This is the 5.4.86 stable release 2020-12-30 12:31:14 +01:00
udf udf: Fix memory leak when mounting 2020-11-05 11:43:29 +01:00
ufs Revert "ANDROID: Revert: Merge 5.4.60 into android11-5.4" 2020-08-23 13:12:51 +02:00
unicode FROMLIST: unicode: Add utf8_casefold_hash 2020-02-20 21:21:02 +00:00
verity fs-verity: remove unnecessary extern keywords 2020-06-16 14:06:46 -07:00
xfs This is the 5.4.80 stable release 2020-11-25 12:46:13 +01:00
aio.c Revert "aio: only use blk plugs for > 2 depth submissions" 2021-06-07 20:02:39 -07:00
anon_inodes.c Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
attr.c Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions" 2020-05-29 14:48:38 +02:00
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c
binfmt_elf.c fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info() 2020-06-03 08:21:27 +02:00
binfmt_em86.c
binfmt_flat.c binfmt_flat: revert "binfmt_flat: don't offset the data start" 2020-09-03 11:26:39 +02:00
binfmt_misc.c Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
binfmt_script.c
block_dev.c bdev: Reduce time holding bd_mutex in sync in blkdev_close() 2020-10-01 13:17:55 +02:00
buffer.c Merge android11-5.4.86+ (75c93eb) into msm-5.4 2021-04-22 09:44:51 +05:30
char_dev.c chardev: Avoid potential use-after-free in 'chrdev_open()' 2020-01-14 20:08:18 +01:00
compat_binfmt_elf.c
compat_ioctl.c fix compat handling of FICLONERANGE, FIDEDUPERANGE and FS_IOC_FIEMAP 2020-01-09 10:20:05 +01:00
compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
coredump.c coredump: fix core_pattern parse error 2020-12-11 13:23:30 +01:00
d_path.c fs: fix NULL dereference due to data race in prepend_path() 2020-12-15 11:43:16 +05:30
dax.c dax: pass NOWAIT flag to iomap_apply 2020-03-05 16:43:36 +01:00
dcache.c fix dget_parent() fastpath race 2020-10-01 13:17:19 +02:00
dcookies.c
direct-io.c ANDROID: fscrypt: handle direct I/O with IV_INO_LBLK_32 2020-05-21 11:52:18 -07:00
drop_caches.c fs: avoid softlockups in s_inodes iterators 2020-01-12 12:21:37 +01:00
eventfd.c eventfd: track eventfd_signal() recursion depth 2020-02-11 04:35:37 -08:00
eventpoll.c This is the 5.4.70 stable release 2020-10-07 08:50:29 +02:00
exec.c This is the 5.4.75 stable release 2020-11-05 13:27:24 +01:00
fcntl.c
fhandle.c fs/handle.c - fix up kerneldoc 2019-08-07 21:51:47 -04:00
file_table.c vfs: Export flush_delayed_fput for use by knfsd. 2019-08-19 11:00:39 -04:00
file.c fix multiplication overflow in copy_fdtable() 2020-05-27 17:46:12 +02:00
filesystems.c fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() 2020-04-17 10:50:21 +02:00
fs_context.c vfs: subtype handling moved to fuse 2019-09-06 21:28:49 +02:00
fs_parser.c vfs: Make fs_parse() handle fs_param_is_fd-type params better 2019-09-12 21:06:14 -04:00
fs_pin.c switch the remnants of releasing the mountpoint away from fs_pin 2019-07-16 22:52:37 -04:00
fs_struct.c Revert "ANDROID: sdcardfs: Enable modular sdcardfs" 2020-05-29 15:08:00 +02:00
fs_types.c
fs-writeback.c writeback: Fix sync livelock due to b_dirty_time processing 2020-09-03 11:27:04 +02:00
fsopen.c Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-07-19 10:42:02 -07:00
inode.c Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions" 2020-05-29 14:48:38 +02:00
internal.h Revert "ANDROID: fs: Restore vfs_path_lookup() export" 2020-05-29 14:48:37 +02:00
io_uring.c io_uring: Fix double list add in io_queue_async_work() 2020-10-14 10:32:57 +02:00
ioctl.c compat_ioctl: add compat_ptr_ioctl() 2019-12-17 19:55:30 +01:00
Kconfig exfat: add Kconfig and Makefile 2020-11-10 14:30:28 +08:00
Kconfig.binfmt binfmt_flat: make support for old format binaries optional 2019-06-24 09:16:47 +10:00
libfs.c This is the 5.4.80 stable release 2020-11-25 12:46:13 +01:00
locks.c locks: reinstate locks_delete_block optimization 2020-03-25 08:25:41 +01:00
Makefile exfat: add Kconfig and Makefile 2020-11-10 14:30:28 +08:00
mbcache.c
mount.h switch the remnants of releasing the mountpoint away from fs_pin 2019-07-16 22:52:37 -04:00
mpage.c This is the 5.4.13 stable release 2020-01-17 23:38:39 +01:00
namei.c ANDROID: GKI: set vfs-only exports into their own namespace 2020-07-07 18:07:10 +02:00
namespace.c Linux 5.4-rc8 2019-11-18 08:31:11 +01:00
no-block.c
nsfs.c
open.c ANDROID: GKI: set vfs-only exports into their own namespace 2020-07-07 18:07:10 +02:00
OWNERS ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS 2021-04-01 13:45:14 +00:00
pipe.c
pnode.c This is the 5.4.37 stable release 2020-05-02 09:01:51 +02:00
pnode.h ANDROID: mnt: Add filesystem private data to mount points 2019-07-19 12:39:18 -07:00
posix_acl.c FROMLIST: Add flags option to get xattr method paired to __vfs_getxattr 2019-11-05 13:50:57 -08:00
proc_namespace.c Merge 5.4-rc1-prelrease into android-mainline 2019-10-02 17:58:47 +02:00
read_write.c ANDROID: GKI: set vfs-only exports into their own namespace 2020-07-07 18:07:10 +02:00
readdir.c readdir: be more conservative with directory entry names 2020-01-29 16:45:31 +01:00
select.c fs/select.c: use struct_size() in kmalloc() 2019-07-16 19:23:25 -07:00
seq_file.c seq_file: fix problem when seeking mid-record 2019-08-13 16:06:52 -07:00
signalfd.c fs/signalfd.c: fix inconsistent return codes for signalfd4 2020-08-26 10:40:58 +02:00
splice.c splice: only read in as much information as there is pipe buffer space 2019-12-17 19:56:52 +01:00
stack.c
stat.c ANDROID: GKI: set vfs-only exports into their own namespace 2020-07-07 18:07:10 +02:00
statfs.c vfs: Fix EOVERFLOW testing in put_compat_statfs64 2019-10-03 14:21:35 -07:00
super.c vfs: remove lockdep bogosity in __sb_start_write 2020-11-24 13:29:01 +01:00
sync.c
timerfd.c timerfd: Prepare for PREEMPT_RT 2019-08-01 20:51:23 +02:00
userfaultfd.c mm: protect VMA modifications using VMA sequence count 2020-06-09 10:55:00 +05:30
utimes.c Revert "ANDROID: vfs: Add setattr2 for filesystems with per mount permissions" 2020-05-29 14:48:38 +02:00
xattr.c This is the 5.4.58 stable release 2020-08-11 18:37:58 +02:00