linux-uconsole/include/linux/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
..
addr.h sunrpc: move address copy/cmp/convert routines and prototypes from clnt.h to addr.h 2013-02-05 09:41:14 -05:00
auth.h SUNRPC new rpc_credops to test credential expiry 2013-09-03 15:25:08 -04:00
auth_gss.h
bc_xprt.h SUNRPC: RPC callbacks may be split across several TCP segments 2014-02-11 14:01:20 -05:00
cache.h sunrpc: prepare NFS for 2038 2013-08-19 09:55:01 -04:00
clnt.h SUNRPC: Add a helper to switch the transport of an rpc_clnt 2013-10-28 15:21:32 -04:00
debug.h
gss_api.h svcrpc: store gss mech in svc_cred 2013-07-01 17:23:06 -04:00
gss_asn1.h
gss_err.h
gss_krb5.h
gss_krb5_enctypes.h
metrics.h
msg_prot.h nfsd4: check backchannel attributes on create_session 2013-04-09 16:53:56 -04:00
rpc_pipe_fs.h sunrpc: replace sunrpc_net->gssd_running flag with a more reliable check 2013-12-06 13:06:31 -05:00
rpc_rdma.h
sched.h SUNRPC: Add RPC task and client level options to disable the resend timeout 2013-10-01 18:22:11 -04:00
stats.h
svc.h SUNRPC/NFSD: Support a new option for ignoring the result of svc_register 2014-01-03 18:18:49 -05:00
svc_rdma.h
svc_xprt.h
svcauth.h svcrpc: store gss mech in svc_cred 2013-07-01 17:23:06 -04:00
svcauth_gss.h
svcsock.h net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
timer.h
types.h
xdr.h sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer 2013-02-08 15:19:10 -05:00
xprt.h SUNRPC: Clean up - convert xprt_prepare_transmit to return a bool 2013-10-01 18:22:11 -04:00
xprtrdma.h
xprtsock.h