android_kernel_samsung_msm8976/fs/nfsd
Jeff Layton fbaa929d86 nfsd: when reusing an existing repcache entry, unhash it first
commit 781c2a5a5f75eacc04663aced0f0f1a648d4f308 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-20 07:45:08 -08:00
..
acl.h nfsd: Remove declaration of nonexistent nfs4_acl_permisison 2013-02-13 06:15:35 -08:00
auth.c nfsd: Properly compare and initialize kuids and kgids 2013-02-13 06:16:09 -08:00
auth.h nfsd: Remove nfsd_luid, nfsd_lgid, nfsd_ruid and nfsd_rgid 2013-02-13 06:15:51 -08:00
cache.h nfsd: add new reply_cache_stats file in nfsdfs 2013-04-03 11:47:24 -04:00
current_stateid.h nfsd41: use current stateid by value 2012-02-15 11:20:45 -05:00
export.c nfsd: return better errors to exportfs 2013-11-29 11:11:49 -08:00
fault_inject.c Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
idmap.h nfsd: Convert idmap to use kuids and kgids 2013-02-13 06:15:49 -08:00
Kconfig fs/nfsd: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:05 -08:00
lockd.c
Makefile NFSD: Added fault injection 2011-11-07 21:10:47 -05:00
netns.h nfsd4: make del_recall_lru per-network-namespace 2013-04-04 13:25:16 -04:00
nfs2acl.c nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
nfs3acl.c nfsd4: cleanup: replace rq_resused count by rq_next_page pointer 2012-12-17 22:00:16 -05:00
nfs3proc.c switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
nfs3xdr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
nfs4acl.c nfsd: Handle kuids and kgids in the nfs4acl to posix_acl conversion 2013-02-13 06:16:06 -08:00
nfs4callback.c nfsd4: check backchannel attributes on create_session 2013-04-09 16:53:56 -04:00
nfs4idmap.c Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
nfs4proc.c nfsd4: don't allow owner override on 4.1 CLAIM_FH opens 2013-05-03 16:36:14 -04:00
nfs4recover.c nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error 2013-05-09 12:58:36 -04:00
nfs4state.c Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux 2013-05-03 10:59:39 -07:00
nfs4xdr.c nfsd4: fix decoding of compounds across page boundaries 2013-07-13 11:42:27 -07:00
nfscache.c nfsd: when reusing an existing repcache entry, unhash it first 2013-12-20 07:45:08 -08:00
nfsctl.c Merge branch 'for-3.10' of git://linux-nfs.org/~bfields/linux 2013-05-03 10:59:39 -07:00
nfsd.h fs/nfsd: change type of max_delegations, nfsd_drc_max_mem and nfsd_drc_mem_used 2013-02-23 17:50:22 -08:00
nfsfh.c exportfs: add FILEID_INVALID to indicate invalid fid_type 2012-11-07 19:22:30 -05:00
nfsfh.h fs: propagate umode_t, misc bits 2012-01-03 22:55:10 -05:00
nfsproc.c switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
nfssvc.c Merge branch 'for-3.9' of git://linux-nfs.org/~bfields/linux 2013-02-28 18:02:55 -08:00
nfsxdr.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
state.h nfsd4: implement SEQ4_STATUS_RECALLABLE_STATE_REVOKED 2013-04-16 10:59:30 -04:00
stats.c SUNRPC: register service stats /proc entries in passed network namespace context 2012-01-31 19:28:18 -05:00
vfs.c nfsd: make sure to balance get/put_write_access 2013-11-29 11:11:49 -08:00
vfs.h switch vfs_getattr() to struct path 2013-02-26 02:46:08 -05:00
xdr.h nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
xdr3.h nfsd: handle vfs_getattr errors in acl protocol 2013-02-26 02:46:09 -05:00
xdr4.h nfsd4: cleanup handling of nfsv4.0 closed stateid's 2013-04-08 09:55:32 -04:00
xdr4cb.h nfsd4: check backchannel attributes on create_session 2013-04-09 16:53:56 -04:00