kernel-hacking-2024-linux-s.../fs/nfsd
Jeff Layton c5952338bf nfsd: return correct openowner when there is a race to put one in the hash
alloc_init_open_stateowner can return an already freed entry if there is
a race to put openowners in the hashtable.

In commit 7ffb588086, we changed it so that we allocate and initialize
an openowner, and then check to see if a matching one got stuffed into
the hashtable in the meantime. If it did, then we free the one we just
allocated and take a reference on the one already there. There is a bug
here though. The code will then return the pointer to the one that was
allocated (and has now been freed).

This wasn't evident before as this race almost never occurred. The Linux
kernel client used to serialize requests for a single openowner.  That
has changed now with v4.0 kernels, and this race can now easily occur.

Fixes: 7ffb588086
Cc: <stable@vger.kernel.org> # v3.17+
Cc: Trond Myklebust <trond.myklebust@primarydata.com>
Reported-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2015-03-25 21:06:06 -04:00
..
acl.h nfsd4: remove nfs4_acl_new 2014-07-08 17:14:27 -04:00
auth.c nfsd: silence sparse warning about accessing credentials 2014-07-17 16:15:35 -04:00
auth.h
blocklayout.c nfsd: pNFS block layout driver 2015-02-05 14:35:18 +01:00
blocklayoutxdr.c nfsd: pNFS block layout driver 2015-02-05 14:35:18 +01:00
blocklayoutxdr.h nfsd: pNFS block layout driver 2015-02-05 14:35:18 +01:00
cache.h nfsd: Remove the cache_hash list 2014-08-17 12:00:12 -04:00
current_stateid.h
export.c nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
export.h nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
fault_inject.c nfsd: remove old fault injection infrastructure 2014-08-05 10:55:10 -04:00
idmap.h nfsd4: use xdr_reserve_space in attribute encoding 2014-05-28 14:52:34 -04:00
Kconfig nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
lockd.c
Makefile nfsd: pNFS block layout driver 2015-02-05 14:35:18 +01:00
netns.h nfsd: add some comments to the nfsd4 object definitions 2014-08-05 16:09:20 -04:00
nfs2acl.c NFSD: Check acl returned from get_acl/posix_acl_from_mode 2014-07-11 15:03:53 -04:00
nfs3acl.c NFSD: Check acl returned from get_acl/posix_acl_from_mode 2014-07-11 15:03:53 -04:00
nfs3proc.c nfsd: allow turning off nfsv3 readdir_plus 2014-08-18 15:12:14 -04:00
nfs3xdr.c NFSD: Using min/max/min_t/max_t for calculate 2014-06-23 11:31:36 -04:00
nfs4acl.c NFSD: Check acl returned from get_acl/posix_acl_from_mode 2014-07-11 15:03:53 -04:00
nfs4callback.c nfsd: implement pNFS layout recalls 2015-02-02 18:09:43 +01:00
nfs4idmap.c NFSD: Full checking of authentication name 2014-09-03 17:43:03 -04:00
nfs4layouts.c NFSD: Check layout type when returning client layouts 2015-03-20 12:43:59 -04:00
nfs4proc.c NFSD: Put exports after nfsd4_layout_verify fail 2015-03-20 16:15:42 -04:00
nfs4recover.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
nfs4state.c nfsd: return correct openowner when there is a race to put one in the hash 2015-03-25 21:06:06 -04:00
nfs4xdr.c NFSD: Take care the return value from nfsd4_decode_stateid 2015-03-20 12:43:59 -04:00
nfscache.c NFSD: Error out when register_shrinker() fail 2015-03-20 12:44:00 -04:00
nfsctl.c nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
nfsd.h nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
nfsfh.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
nfsfh.h nfsd: fix comparison in fh_fsid_match() 2015-02-12 11:26:19 -05:00
nfsproc.c nfsd: print status when nfsd4_open fails to open file it just created 2014-07-29 23:08:38 -04:00
nfssvc.c nfsd: default NFSv4.2 to on 2015-02-09 14:58:50 -05:00
nfsxdr.c NFSD: Using min/max/min_t/max_t for calculate 2014-06-23 11:31:36 -04:00
pnfs.h nfsd4: fix v3-less build 2015-02-16 11:43:13 -05:00
state.h nfsd: implement pNFS layout recalls 2015-02-02 18:09:43 +01:00
stats.c nfsd: move <linux/nfsd/stats.h> to fs/nfsd 2014-05-06 17:54:55 -04:00
stats.h nfsd: move <linux/nfsd/stats.h> to fs/nfsd 2014-05-06 17:54:55 -04:00
trace.c nfsd: add trace events 2015-02-02 18:09:44 +01:00
trace.h nfsd: add trace events 2015-02-02 18:09:44 +01:00
vfs.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
vfs.h Merge branch 'for-3.19' of git://linux-nfs.org/~bfields/linux 2014-12-16 15:25:31 -08:00
xdr.h nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
xdr3.h nfsd: fix encode_entryplus_baggage stack usage 2014-01-23 13:50:27 -05:00
xdr4.h nfsd: implement pNFS operations 2015-02-02 18:09:42 +01:00
xdr4cb.h nfsd: implement pNFS layout recalls 2015-02-02 18:09:43 +01:00