linux/fs/nfsd
Jeff Layton 781c2a5a5f nfsd: when reusing an existing repcache entry, unhash it first
The DRC code will attempt to reuse an existing, expired cache entry in
preference to allocating a new one. It'll then search the cache, and if
it gets a hit it'll then free the cache entry that it was going to
reuse.

The cache code doesn't unhash the entry that it's going to reuse
however, so it's possible for it end up designating an entry for reuse
and then subsequently freeing the same entry after it finds it.  This
leads it to a later use-after-free situation and usually some list
corruption warnings or an oops.

Fix this by simply unhashing the entry that we intend to reuse. That
will mean that it's not findable via a search and should prevent this
situation from occurring.

Cc: stable@vger.kernel.org # v3.10+
Reported-by: Christoph Hellwig <hch@infradead.org>
Reported-by: g. artim <gartim@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2013-12-10 20:34:44 -05:00
..
acl.h
auth.c
auth.h
cache.h
current_stateid.h
export.c nfsd: -EINVAL on invalid anonuid/gid instead of silent failure 2013-10-29 17:46:14 -04:00
fault_inject.c
idmap.h
Kconfig nfsd: fix Kconfig syntax 2013-10-26 15:37:26 -04:00
lockd.c
Makefile
netns.h
nfs2acl.c
nfs3acl.c
nfs3proc.c
nfs3xdr.c
nfs4acl.c
nfs4callback.c
nfs4idmap.c
nfs4proc.c
nfs4recover.c nfsd: switch to %p[dD] 2013-10-24 23:34:51 -04:00
nfs4state.c Merge branch 'nfsd-next' of git://linux-nfs.org/~bfields/linux 2013-11-16 12:04:02 -08:00
nfs4xdr.c nfsd4: fix xdr decoding of large non-write compounds 2013-11-19 18:06:54 -05:00
nfscache.c nfsd: when reusing an existing repcache entry, unhash it first 2013-12-10 20:34:44 -05:00
nfsctl.c
nfsd.h
nfsfh.c nfsd: fh_update should error out in unexpected cases 2013-10-29 17:43:52 -04:00
nfsfh.h nfsd: switch to %p[dD] 2013-10-24 23:34:51 -04:00
nfsproc.c
nfssvc.c
nfsxdr.c
state.h
stats.c
vfs.c nfsd: make sure to balance get/put_write_access 2013-11-18 12:06:48 -05:00
vfs.h
xdr3.h
xdr4.h
xdr4cb.h
xdr.h