linux/net/sunrpc
David S. Miller 676d23690f net: Fix use after free by removing length arg from sk_data_ready callbacks.
Several spots in the kernel perform a sequence like:

	skb_queue_tail(&sk->s_receive_queue, skb);
	sk->sk_data_ready(sk, skb->len);

But at the moment we place the SKB onto the socket receive queue it
can be consumed and freed up.  So this skb->len access is potentially
to freed up memory.

Furthermore, the skb->len can be modified by the consumer so it is
possible that the value isn't accurate.

And finally, no actual implementation of this callback actually uses
the length argument.  And since nobody actually cared about it's
value, lots of call sites pass arbitrary values in such as '0' and
even '1'.

So just remove the length argument from the callback, that way there
is no confusion whatsoever and all of these use-after-free cases get
fixed as a side effect.

Based upon a patch by Eric Dumazet and his suggestion to audit this
issue tree-wide.

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-04-11 16:15:36 -04:00
..
auth_gss SUNRPC: Fix a pipe_version reference leak 2014-02-16 13:28:01 -05:00
xprtrdma SUNRPC: remove KERN_INFO from dprintk() call sites 2014-03-17 15:30:38 -04:00
addr.c
auth_generic.c sunrpc: Add missing kuids conversion for printing 2013-09-12 10:16:06 -04:00
auth_null.c SUNRPC refactor rpcauth_checkverf error returns 2013-09-03 15:25:09 -04:00
auth_unix.c SUNRPC refactor rpcauth_checkverf error returns 2013-09-03 15:25:09 -04:00
auth.c shrinker: convert remaining shrinkers to count/scan API 2013-09-10 18:56:32 -04:00
backchannel_rqst.c SUNRPC: RPC callbacks may be split across several TCP segments 2014-02-11 14:01:20 -05:00
bc_svc.c
cache.c Merge branch 'for-3.14' of git://linux-nfs.org/~bfields/linux 2014-01-30 10:18:43 -08:00
clnt.c SUNRPC: rpc_restart_call/rpc_restart_call_prepare should clear task->tk_status 2014-03-20 13:38:44 -04:00
Kconfig
Makefile
netns.h Merge branch 'for-3.14' of git://linux-nfs.org/~bfields/linux 2014-01-30 10:18:43 -08:00
rpc_pipe.c rpc_pipe: fix cleanup of dummy gssd directory when notification fails 2013-12-10 19:39:53 +02:00
rpcb_clnt.c
sched.c SUNRPC: Don't let rpc_delay() clobber non-timeout errors 2014-03-20 13:38:43 -04:00
socklib.c
stats.c
sunrpc_syms.c sunrpc: create a new dummy pipe for gssd to hold open 2013-12-06 13:06:30 -05:00
sunrpc.h
svc_xprt.c net: Mark functions as static in net/sunrpc/svc_xprt.c 2014-02-09 17:32:50 -08:00
svc.c SUNRPC/NFSD: Support a new option for ignoring the result of svc_register 2014-01-03 18:18:49 -05:00
svcauth_unix.c
svcauth.c
svcsock.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
sysctl.c
timer.c
xdr.c
xprt.c NFS client updates for Linux 3.14 2014-01-28 08:46:44 -08:00
xprtsock.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00