android_kernel_samsung_sm8650/fs/9p
Christian Brauner 3cb6ee9914 9p: only copy valid iattrs in 9P2000.L setattr implementation
The 9P2000.L setattr method v9fs_vfs_setattr_dotl() copies struct iattr
values without checking whether they are valid causing unitialized
values to be copied. The 9P2000 setattr method v9fs_vfs_setattr() method
gets this right. Check whether struct iattr fields are valid first
before copying in v9fs_vfs_setattr_dotl() too and make sure that all
other fields are set to 0 apart from {g,u}id which should be set to
INVALID_{G,U}ID. This ensure that they can be safely sent over the wire
or printed for debugging later on.

Link: https://lkml.kernel.org/r/20211129114434.3637938-1-brauner@kernel.org
Link: https://lkml.kernel.org/r/000000000000a0d53f05d1c72a4c%40google.com
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: stable@kernel.org
Cc: v9fs-developer@lists.sourceforge.net
Reported-by: syzbot+dfac92a50024b54acaa4@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
[Dominique: do not set a/mtime with just ATTR_A/MTIME as discussed]
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
2022-01-10 10:00:09 +09: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 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
cache.h 9p: Convert to using the netfs helper lib to do reads and caching 2021-11-03 17:45:02 +09:00
fid.c fs/9p: fix indentation and Add missing a blank line after declaration 2021-11-03 17:45:03 +09:00
fid.h 9p: apply review requests for fid refcounting 2020-11-19 17:21:34 +01: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 a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
v9fs.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
v9fs.h fs/9p: fix warnings found by checkpatch.pl 2021-11-03 17:45:03 +09:00
vfs_addr.c netfs, 9p, afs, ceph: Use folios 2021-11-10 21:16:56 +00:00
vfs_dentry.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_dir.c 9p: fix file headers 2021-11-03 17:45:04 +09:00
vfs_file.c 9p: Use BUG_ON instead of if condition followed by BUG. 2022-01-10 10:00:09 +09:00
vfs_inode_dotl.c 9p: only copy valid iattrs in 9P2000.L setattr implementation 2022-01-10 10:00:09 +09:00
vfs_inode.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_super.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
xattr.c 9p: fix file headers 2021-11-03 17:45:04 +09:00
xattr.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00