kernel-ark/net/core
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
..
datagram.c
dev_addr_lists.c
dev_ioctl.c
dev.c netdev: remove potentially harmful checks 2014-04-07 15:52:07 -04:00
drop_monitor.c
dst.c
ethtool.c net: add busy_poll device feature 2014-04-03 14:31:34 -04:00
fib_rules.c
filter.c net: filter: be more defensive on div/mod by X==0 2014-04-07 12:54:39 -04:00
flow_dissector.c net: Rename skb->rxhash to skb->hash 2014-03-26 15:58:20 -04:00
flow.c CPU hotplug notifiers registration fixes for 3.15-rc1 2014-04-07 14:55:46 -07:00
gen_estimator.c
gen_stats.c
iovec.c
link_watch.c
Makefile net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
neighbour.c
net_namespace.c
net-procfs.c
net-sysfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
net-sysfs.h
net-traces.c
netclassid_cgroup.c
netevent.c
netpoll.c netpoll: Use skb_irq_freeable to make zap_completion_queue safe. 2014-04-01 17:53:36 -04:00
netprio_cgroup.c cgroup: drop const from @buffer of cftype->write_string() 2014-03-19 10:23:54 -04:00
pktgen.c pktgen: fix xmit test for BQL enabled devices 2014-04-07 15:20:44 -04:00
ptp_classifier.c net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
request_sock.c
rtnetlink.c net-sysfs: expose number of carrier on/off changes 2014-03-31 16:24:52 -04:00
scm.c
secure_seq.c
skbuff.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
sock_diag.c net: filter: keep original BPF program around 2014-03-31 00:45:09 -04:00
sock.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
stream.c
sysctl_net_core.c
timestamping.c net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
user_dma.c
utils.c