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 SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-11-19 12:27:20 +01:00
filelayout SUNRPC: Trace calls to .rpc_call_done 2024-11-19 12:27:47 +01:00
flexfilelayout SUNRPC: Trace calls to .rpc_call_done 2024-11-19 12:27:47 +01:00
cache_lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cache_lib.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
callback.c Revert "nfsd: stop setting ->pg_stats for unused stats" 2024-11-24 00:23:44 +01:00
callback.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
callback_proc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
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 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dir.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-11-19 12:27:20 +01:00
direct.c nfs: fix UAF in direct writes 2024-11-19 09:22:34 +01:00
dns_resolve.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dns_resolve.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
export.c nfsd: allow reaping files still under writeback 2024-11-19 12:28:32 +01:00
file.c nfs: don't allow reexport reclaims 2024-11-19 12:27:44 +01:00
fs_context.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache-index.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
getroot.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
inode.c nfs: Fix KMSAN warning in decode_getfattr_attrs() 2024-11-30 02:33:25 +01:00
internal.h nfs: fix undefined behavior in nfs_block_bits() 2024-11-19 12:27:19 +01:00
io.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iostat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mount_clnt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
namespace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netns.h nfs: make the rpc_stat per net namespace 2024-11-19 11:32:41 +01:00
nfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs2super.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs2xdr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3_fs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3acl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3client.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3proc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3super.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs3xdr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4_fs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4client.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4file.c NFSv4.2: Remove ifdef CONFIG_NFSD from NFSv4.2 client SSC code. 2024-11-19 12:27:37 +01:00
nfs4getroot.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4idmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4idmap.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4namespace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4proc.c NFS: Fix READ_PLUS when server doesn't support OP_READ_PLUS 2024-11-19 12:27:19 +01:00
nfs4renewd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4session.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4session.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4state.c Revert "nfs: fix memory leak in error path of nfs4_do_reclaim" 2024-11-24 00:23:15 +01:00
nfs4super.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs4xdr.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-11-19 12:27:20 +01:00
nfs42.h NFSv4.2: fix listxattr maximum XDR buffer size 2024-11-19 08:44:57 +01:00
nfs42proc.c Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()" 2024-11-24 00:22:57 +01:00
nfs42xattr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs42xdr.c SUNRPC: Add xdr_set_scratch_page() and xdr_reset_scratch_buffer() 2024-11-19 12:27:20 +01:00
nfsroot.c NFS: Fix an off by one in root_nfs_cat() 2024-11-19 08:44:57 +01:00
nfstrace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfstrace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pagelist.c SUNRPC: Trace calls to .rpc_call_done 2024-11-19 12:27:47 +01:00
pnfs.c NFS: avoid infinite loop in pnfs_update_layout. 2024-11-23 23:20:47 +01:00
pnfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnfs_dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnfs_nfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
proc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
read.c nfs: Leave pages in the pagecache if readpage failed 2024-11-19 14:19:35 +01:00
super.c Revert "NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations" 2024-11-24 00:23:38 +01:00
symlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unlink.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
write.c SUNRPC: Trace calls to .rpc_call_done 2024-11-19 12:27:47 +01:00