]> Git Repo - linux.git/commit
9p: only copy valid iattrs in 9P2000.L setattr implementation
authorChristian Brauner <[email protected]>
Mon, 29 Nov 2021 11:44:34 +0000 (12:44 +0100)
committerDominique Martinet <[email protected]>
Mon, 10 Jan 2022 01:00:09 +0000 (10:00 +0900)
commit3cb6ee991496b67ee284c6895a0ba007e2d7bac3
tree339b7a7986d0977d3799b58b81efbfec8c7366ca
parenta7a427d1543f89ad57fda5d6b9bb70f4cecb2fba
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/[email protected]
Link: https://lkml.kernel.org/r/000000000000a0d53f05d1c72a4c%40google.com
Cc: Eric Van Hensbergen <[email protected]>
Cc: Latchesar Ionkov <[email protected]>
Cc: Dominique Martinet <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reported-by: [email protected]
Signed-off-by: Christian Brauner <[email protected]>
[Dominique: do not set a/mtime with just ATTR_A/MTIME as discussed]
Signed-off-by: Dominique Martinet <[email protected]>
fs/9p/vfs_inode_dotl.c
This page took 0.051713 seconds and 4 git commands to generate.