android_kernel_samsung_a7y1.../net/sunrpc
NeilBrown 38cfdd8696 sunrpc: don't mark uninitialised items as VALID.
commit d58431eacb226222430940134d97bfd72f292fcd upstream.

A recent commit added a call to cache_fresh_locked()
when an expired item was found.
The call sets the CACHE_VALID flag, so it is important
that the item actually is valid.
There are two ways it could be valid:
1/ If ->update has been called to fill in relevant content
2/ if CACHE_NEGATIVE is set, to say that content doesn't exist.

An expired item that is waiting for an update will be neither.
Setting CACHE_VALID will mean that a subsequent call to cache_put()
will be likely to dereference uninitialised pointers.

So we must make sure the item is valid, and we already have code to do
that in try_to_negate_entry().  This takes the hash lock and so cannot
be used directly, so take out the two lines that we need and use them.

Now cache_fresh_locked() is certain to be called only on
a valid item.

Cc: stable@kernel.org # 2.6.35
Fixes: 4ecd55ea0742 ("sunrpc: fix cache_head leak due to queued request")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 16:38:50 +02:00
..
auth_gss A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xprtrdma A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
addr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
auth_generic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
auth_null.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
auth_unix.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
auth.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
backchannel_rqst.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cache.c sunrpc: don't mark uninitialised items as VALID. 2020-04-06 16:38:50 +02:00
clnt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debugfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netns.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rpc_pipe.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rpcb_clnt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sched.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
socklib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stats.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sunrpc_syms.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sunrpc.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
svc_xprt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
svc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
svcauth_unix.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
svcauth.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
svcsock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
timer.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xdr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xprt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xprtsock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30