1
0
Fork 0
alistair23-linux/fs/nfs
Chuck Lever 1047ec8683 NFSv4: Fix leak of clp->cl_acceptor string
Our client can issue multiple SETCLIENTID operations to the same
server in some circumstances. Ensure that calls to
nfs4_proc_setclientid() after the first one do not overwrite the
previously allocated cl_acceptor string.

unreferenced object 0xffff888461031800 (size 32):
  comm "mount.nfs", pid 2227, jiffies 4294822467 (age 1407.749s)
  hex dump (first 32 bytes):
    6e 66 73 40 6b 6c 69 6d 74 2e 69 62 2e 31 30 31  nfs@klimt.ib.101
    35 67 72 61 6e 67 65 72 2e 6e 65 74 00 00 00 00  5granger.net....
  backtrace:
    [<00000000ab820188>] __kmalloc+0x128/0x176
    [<00000000eeaf4ec8>] gss_stringify_acceptor+0xbd/0x1a7 [auth_rpcgss]
    [<00000000e85e3382>] nfs4_proc_setclientid+0x34e/0x46c [nfsv4]
    [<000000003d9cf1fa>] nfs40_discover_server_trunking+0x7a/0xed [nfsv4]
    [<00000000b81c3787>] nfs4_discover_server_trunking+0x81/0x244 [nfsv4]
    [<000000000801b55f>] nfs4_init_client+0x1b0/0x238 [nfsv4]
    [<00000000977daf7f>] nfs4_set_client+0xfe/0x14d [nfsv4]
    [<0000000053a68a2a>] nfs4_create_server+0x107/0x1db [nfsv4]
    [<0000000088262019>] nfs4_remote_mount+0x2c/0x59 [nfsv4]
    [<00000000e84a2fd0>] legacy_get_tree+0x2d/0x4c
    [<00000000797e947c>] vfs_get_tree+0x20/0xc7
    [<00000000ecabaaa8>] fc_mount+0xe/0x36
    [<00000000f15fafc2>] vfs_kern_mount+0x74/0x8d
    [<00000000a3ff4e26>] nfs_do_root_mount+0x8a/0xa3 [nfsv4]
    [<00000000d1c2b337>] nfs4_try_mount+0x58/0xad [nfsv4]
    [<000000004c9bddee>] nfs_fs_mount+0x820/0x869 [nfs]

Fixes: f11b2a1cfb ("nfs4: copy acceptor name from context ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2019-10-10 16:14:02 -04:00
..
blocklayout treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
filelayout pNFS/filelayout: enable LAYOUTGET on OPEN 2019-09-24 16:28:38 -04:00
flexfilelayout pNFS/flexfiles: Don't time out requests on hard mounts 2019-08-26 15:31:29 -04:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile NFS: Create a root NFS directory in /sys/fs/nfs 2019-07-06 14:54:49 -04:00
cache_lib.c NFS client updates for Linux 4.15 2017-11-17 14:18:00 -08:00
cache_lib.h NFS client updates for Linux 4.15 2017-11-17 14:18:00 -08:00
callback.c SUNRPC: Cache the process user cred in the RPC server listener 2019-04-24 09:46:35 -04:00
callback.h NFS CB_OFFLOAD xdr 2018-08-09 12:56:38 -04:00
callback_proc.c NFS4: Add a trace event to record invalid CB sequence IDs 2019-07-09 10:30:25 -04:00
callback_xdr.c SUNRPC/nfs: Fix return value for nfs4_callback_compound() 2019-04-24 09:46:34 -04:00
client.c NFS: Cleanup if nfs_match_client is interrupted 2019-07-06 14:54:53 -04:00
delegation.c NFSv4.1: Only reap expired delegations 2019-08-04 22:35:40 -04:00
delegation.h NFSv4: Fix delegation state recovery 2019-08-04 22:35:40 -04:00
dir.c NFS Client Updates for Linux 5.3 2019-09-26 12:20:14 -07:00
direct.c NFS: Remove redundant mirror tracking in O_DIRECT 2019-10-09 11:45:59 -04:00
dns_resolve.c keys: Pass the network namespace into request_key mechanism 2019-06-27 23:02:12 +01:00
dns_resolve.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.c NFS: Pass the inode down to the getattr() callback 2018-06-04 12:07:07 -04:00
file.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
fscache-index.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
fscache.c NFS: Fix regression whereby fscache errors are appearing on 'nofsc' mounts 2019-08-04 22:35:41 -04:00
fscache.h NFS: Fix regression whereby fscache errors are appearing on 'nofsc' mounts 2019-08-04 22:35:41 -04:00
getroot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
inode.c NFS: Fix inode fileid checks in attribute revalidation code 2019-09-02 13:10:19 -04:00
internal.h NFS Client Updates for Linux 5.3 2019-09-26 12:20:14 -07:00
io.c NFS: Fix up documentation warnings 2019-02-20 15:14:21 -05:00
iostat.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mount_clnt.c SUNRPC: Cache cred of process creating the rpc_client 2019-04-26 16:00:48 -04:00
namespace.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
netns.h NFS: Add sysfs support for per-container identifier 2019-07-06 14:54:49 -04:00
nfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs2super.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs2xdr.c NFS: Record task, client ID, and XID in xdr_status trace points 2019-07-09 10:30:25 -04:00
nfs3_fs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs3acl.c nfs: fix xfstest generic/099 failed on nfsv3 2019-02-20 17:33:55 -05:00
nfs3client.c pNFS: Allow multiple connections to the DS 2019-07-06 14:54:50 -04:00
nfs3proc.c NFSv3: use nfs_add_or_obtain() to create and reference inodes 2019-09-20 15:15:24 -04:00
nfs3super.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs3xdr.c NFS: Record task, client ID, and XID in xdr_status trace points 2019-07-09 10:30:25 -04:00
nfs4_fs.h NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE 2019-09-20 15:56:19 -04:00
nfs4client.c NFSv4: Fix a potential sleep while atomic in nfs4_do_reclaim() 2019-08-04 22:35:40 -04:00
nfs4file.c NFSv4: Fix return values for nfs4_file_open() 2019-08-19 08:56:04 -04:00
nfs4getroot.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfs4idmap.c Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
nfs4idmap.h NFS: Move nfs_idmap.h into fs/nfs/ 2015-04-23 15:16:14 -04:00
nfs4namespace.c NFS: Fix up documentation warnings 2019-02-20 15:14:21 -05:00
nfs4proc.c NFSv4: Fix leak of clp->cl_acceptor string 2019-10-10 16:14:02 -04:00
nfs4renewd.c NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'. 2018-12-19 13:52:46 -05:00
nfs4session.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
nfs4session.h NFSv4.1: Bump the default callback session slot count to 16 2019-03-02 16:25:26 -05:00
nfs4state.c NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE 2019-09-20 15:56:19 -04:00
nfs4super.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
nfs4sysctl.c nfs: Do not convert nfs_idmap_cache_timeout to jiffies 2018-01-18 15:10:47 -05:00
nfs4trace.c pnfs/flexfiles: Add tracepoints for detecting pnfs fallback to MDS 2019-07-18 15:50:28 -04:00
nfs4trace.h pnfs/flexfiles: Add tracepoints for detecting pnfs fallback to MDS 2019-07-18 15:50:28 -04:00
nfs4xdr.c fs: nfs: Fix possible null-pointer dereferences in encode_attrs() 2019-08-20 09:30:50 -04:00
nfs42.h NFSv4.2: Add client support for the generic 'layouterror' RPC call 2019-03-01 16:20:16 -05:00
nfs42proc.c NFSv4.1 fix incorrect return value in copy_file_range 2019-04-11 15:23:48 -04:00
nfs42xdr.c NFSv4.2: Add client support for the generic 'layouterror' RPC call 2019-03-01 16:20:16 -05:00
nfsroot.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
nfstrace.c NFS: Add trace events to report non-zero NFS status codes 2019-02-13 12:03:21 -05:00
nfstrace.h kill LOOKUP_NO_EVAL, don't bother including namei.h from audit.h 2019-08-30 21:29:32 -04:00
pagelist.c NFS: Fix initialisation of I/O result struct in nfs_pgio_rpcsetup 2019-08-19 08:56:04 -04:00
pnfs.c pNFS: Handle NFS4ERR_OLD_STATEID on layoutreturn by bumping the state seqid 2019-09-20 15:48:35 -04:00
pnfs.h pNFS: Handle NFS4ERR_OLD_STATEID on layoutreturn by bumping the state seqid 2019-09-20 15:48:35 -04:00
pnfs_dev.c NFS/flexfiles: Speed up read failover when DSes are down 2019-03-01 22:37:38 -05:00
pnfs_nfs.c pNFS/flexfiles: Turn off soft RPC calls 2019-08-26 15:31:29 -04:00
proc.c NFSv2: Fix write regression 2019-08-27 10:24:56 -04:00
read.c NFS: Fix spurious EIO read errors 2019-08-26 15:31:29 -04:00
super.c NFS Client Updates for Linux 5.3 2019-09-26 12:20:14 -07:00
symlink.c nfs: pass the correct prototype to read_cache_page 2019-05-09 16:26:57 -04:00
sysctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sysfs.c NFS: Add sysfs support for per-container identifier 2019-07-06 14:54:49 -04:00
sysfs.h NFS: Add sysfs support for per-container identifier 2019-07-06 14:54:49 -04:00
unlink.c fsnotify: move fsnotify_nameremove() hook out of d_delete() 2019-06-20 14:47:44 +02:00
write.c nfs: Fix nfsi->nrequests count error on nfs_inode_remove_request 2019-10-02 08:52:17 -04:00