linux/net/ceph
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
..
crush crush: add SET_CHOOSELEAF_VARY_R step 2014-04-04 21:07:28 -07:00
armor.c
auth.c
auth_none.c
auth_none.h
auth_x.c
auth_x.h
auth_x_protocol.h
buffer.c libceph: add ceph_kv{malloc,free}() and switch to them 2014-01-26 12:34:23 +02:00
ceph_common.c libceph: add ceph_kv{malloc,free}() and switch to them 2014-01-26 12:34:23 +02:00
ceph_fs.c
ceph_hash.c
ceph_strings.c
crypto.c
crypto.h
debugfs.c libceph: dump pool {read,write}_tier to debugfs 2014-04-04 21:08:29 -07:00
Kconfig
Makefile
messenger.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
mon_client.c libceph: rename ceph_msg::front_max to front_alloc_len 2014-01-14 11:27:26 +02:00
msgpool.c
osd_client.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-04-07 11:09:13 -07:00
osdmap.c libceph: output primary affinity values on osdmap updates 2014-04-04 21:08:28 -07:00
pagelist.c
pagevec.c
snapshot.c