kernel-ark/net/bluetooth
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
..
bnep
cmtp
hidp Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-linus 2014-04-01 19:05:09 +02:00
rfcomm net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
6lowpan.c
6lowpan.h
a2mp.c Bluetooth: Convert uses of __constant_<foo> to <foo> 2014-03-12 11:10:17 -07:00
a2mp.h
af_bluetooth.c
amp.c
amp.h
hci_conn.c Bluetooth: Enforce strict Secure Connections Only mode security 2014-03-19 23:30:32 +02:00
hci_core.c Bluetooth: Convert uses of __constant_<foo> to <foo> 2014-03-12 11:10:17 -07:00
hci_event.c Bluetooth: Add missing cmd_status handler for LE_Start_Encryption 2014-03-24 07:51:55 -07:00
hci_sock.c Bluetooth: Convert uses of __constant_<foo> to <foo> 2014-03-12 11:10:17 -07:00
hci_sysfs.c
Kconfig Bluetooth: make sure 6LOWPAN_IPHC is built-in if needed 2014-03-13 07:05:10 -07:00
l2cap_core.c Bluetooth: Convert uses of __constant_<foo> to <foo> 2014-03-12 11:10:17 -07:00
l2cap_sock.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
lib.c
Makefile
mgmt.c Bluetooth: Fix address value for early disconnection events 2014-03-20 09:14:26 -07:00
sco.c net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
smp.c Bluetooth: Remove unnecessary assignment in SMP 2014-03-24 08:43:50 -07:00
smp.h Bluetooth: Remove LTK re-encryption procedure 2014-03-24 07:51:56 -07:00