kernel_samsung_a53x/fs/nfs
Roberto Sassu b55da2e129 nfs: Fix KMSAN warning in decode_getfattr_attrs()
commit dc270d7159699ad6d11decadfce9633f0f71c1db upstream.

Fix the following KMSAN warning:

CPU: 1 UID: 0 PID: 7651 Comm: cp Tainted: G    B
Tainted: [B]=BAD_PAGE
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009)
=====================================================
=====================================================
BUG: KMSAN: uninit-value in decode_getfattr_attrs+0x2d6d/0x2f90
 decode_getfattr_attrs+0x2d6d/0x2f90
 decode_getfattr_generic+0x806/0xb00
 nfs4_xdr_dec_getattr+0x1de/0x240
 rpcauth_unwrap_resp_decode+0xab/0x100
 rpcauth_unwrap_resp+0x95/0xc0
 call_decode+0x4ff/0xb50
 __rpc_execute+0x57b/0x19d0
 rpc_execute+0x368/0x5e0
 rpc_run_task+0xcfe/0xee0
 nfs4_proc_getattr+0x5b5/0x990
 __nfs_revalidate_inode+0x477/0xd00
 nfs_access_get_cached+0x1021/0x1cc0
 nfs_do_access+0x9f/0xae0
 nfs_permission+0x1e4/0x8c0
 inode_permission+0x356/0x6c0
 link_path_walk+0x958/0x1330
 path_lookupat+0xce/0x6b0
 filename_lookup+0x23e/0x770
 vfs_statx+0xe7/0x970
 vfs_fstatat+0x1f2/0x2c0
 __se_sys_newfstatat+0x67/0x880
 __x64_sys_newfstatat+0xbd/0x120
 x64_sys_call+0x1826/0x3cf0
 do_syscall_64+0xd0/0x1b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The KMSAN warning is triggered in decode_getfattr_attrs(), when calling
decode_attr_mdsthreshold(). It appears that fattr->mdsthreshold is not
initialized.

Fix the issue by initializing fattr->mdsthreshold to NULL in
nfs_fattr_init().

Cc: stable@vger.kernel.org # v3.5.x
Fixes: 88034c3d88c2 ("NFSv4.1 mdsthreshold attribute xdr")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-30 02:33:25 +01:00
..
blocklayout
filelayout
flexfilelayout
cache_lib.c
cache_lib.h
callback.c Revert "nfsd: stop setting ->pg_stats for unused stats" 2024-11-24 00:23:44 +01:00
callback.h
callback_proc.c
callback_xdr.c Revert "SUNRPC: Fix integer overflow in decode_rc_list()" 2024-11-24 00:22:57 +01:00
client.c Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()" 2024-11-24 00:22:57 +01:00
delegation.c Revert "NFS: Avoid unnecessary rescanning of the per-server delegation list" 2024-11-24 00:23:35 +01:00
delegation.h
dir.c
direct.c
dns_resolve.c
dns_resolve.h
export.c
file.c
fs_context.c
fscache-index.c
fscache.c
fscache.h
getroot.c
inode.c nfs: Fix KMSAN warning in decode_getfattr_attrs() 2024-11-30 02:33:25 +01:00
internal.h
io.c
iostat.h
Kconfig
Makefile
mount_clnt.c
namespace.c
netns.h
nfs.h
nfs2super.c
nfs2xdr.c
nfs3_fs.h
nfs3acl.c
nfs3client.c
nfs3proc.c
nfs3super.c
nfs3xdr.c
nfs4_fs.h
nfs4client.c
nfs4file.c
nfs4getroot.c
nfs4idmap.c
nfs4idmap.h
nfs4namespace.c
nfs4proc.c
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c Revert "nfs: fix memory leak in error path of nfs4_do_reclaim" 2024-11-24 00:23:15 +01:00
nfs4super.c
nfs4sysctl.c
nfs4trace.c
nfs4trace.h
nfs4xdr.c
nfs42.h
nfs42proc.c Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()" 2024-11-24 00:22:57 +01:00
nfs42xattr.c
nfs42xdr.c
nfsroot.c
nfstrace.c
nfstrace.h
pagelist.c
pnfs.c
pnfs.h
pnfs_dev.c
pnfs_nfs.c
proc.c
read.c
super.c Revert "NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations" 2024-11-24 00:23:38 +01:00
symlink.c
sysctl.c
sysfs.c
sysfs.h
unlink.c
write.c