sst-linux/fs/9p
Eric Van Hensbergen 18cf702635 fs/9p: fix uninitialized values during inode evict
[ Upstream commit 6630036b7c228f57c7893ee0403e92c2db2cd21d ]

If an iget fails due to not being able to retrieve information
from the server then the inode structure is only partially
initialized.  When the inode gets evicted, references to
uninitialized structures (like fscache cookies) were being
made.

This patch checks for a bad_inode before doing anything other
than clearing the inode from the cache.  Since the inode is
bad, it shouldn't have any state associated with it that needs
to be written back (and there really isn't a way to complete
those anyways).

Reported-by: syzbot+eb83fe1cce5833cd66a0@syzkaller.appspotmail.com
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
(cherry picked from commit 1b4cb6e91f19b81217ad98142ee53a1ab25893fd)
[Xiangyu: CVE-2024-36923 Minor conflict resolution due to missing 4eb31178 ]
Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-22 15:37:34 +01:00
..
acl.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
acl.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
cache.c mm, netfs, fscache: stop read optimisation when folio removed from pagecache 2024-01-10 17:10:31 +01:00
cache.h 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
fid.c 9p: Fix some kernel-doc comments 2022-07-02 18:52:21 +09:00
fid.h 9p fid refcount: cleanup p9_fid_put calls 2022-07-02 18:52:21 +09:00
Kconfig 9p: Convert to using the netfs helper lib to do reads and caching 2021-11-03 17:45:02 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v9fs_vfs.h 9p: Fix initialisation of netfs_inode for 9p 2024-02-05 20:12:59 +00:00
v9fs.c netfs: Fix gcc-12 warning by embedding vfs inode in netfs_i_context 2022-06-09 13:55:00 -07:00
v9fs.h netfs: Further cleanups after struct netfs_inode wrapper introduced 2022-06-10 20:55:21 +01:00
vfs_addr.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
vfs_dentry.c 9p: add missing locking around taking dentry fid list 2024-06-16 13:41:37 +02:00
vfs_dir.c use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
vfs_file.c 9p: explicitly deny setlease attempts 2024-05-17 11:56:09 +02:00
vfs_inode_dotl.c 9p: Fix initialisation of netfs_inode for 9p 2024-02-05 20:12:59 +00:00
vfs_inode.c fs/9p: fix uninitialized values during inode evict 2024-11-22 15:37:34 +01:00
vfs_super.c fs/9p: drop inodes immediately on non-.L too 2024-05-17 11:56:09 +02:00
xattr.c 9P FS: Fix wild-memory-access write in v9fs_get_acl 2024-08-29 17:30:17 +02:00
xattr.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00