Skip to content

Commit 3b78f50

Browse files
pvVudentz
authored andcommitted
Bluetooth: 6lowpan: reset link-local header on ipv6 recv path
Bluetooth 6lowpan.c netdev has header_ops, so it must set link-local header for RX skb, otherwise things crash, eg. with AF_PACKET SOCK_RAW Add missing skb_reset_mac_header() for uncompressed ipv6 RX path. For the compressed one, it is done in lowpan_header_decompress(). Log: (BlueZ 6lowpan-tester Client Recv Raw - Success) ------ kernel BUG at net/core/skbuff.c:212! Call Trace: <IRQ> ... packet_rcv (net/packet/af_packet.c:2152) ... <TASK> __local_bh_enable_ip (kernel/softirq.c:407) netif_rx (net/core/dev.c:5648) chan_recv_cb (net/bluetooth/6lowpan.c:294 net/bluetooth/6lowpan.c:359) ------ Fixes: 18722c2 ("Bluetooth: Enable 6LoWPAN support for BT LE devices") Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Pauli Virtanen <pav@iki.fi> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 23d22f2 commit 3b78f50

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/bluetooth/6lowpan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
289289
local_skb->pkt_type = PACKET_HOST;
290290
local_skb->dev = dev;
291291

292+
skb_reset_mac_header(local_skb);
292293
skb_set_transport_header(local_skb, sizeof(struct ipv6hdr));
293294

294295
if (give_skb_to_upper(local_skb, dev) != NET_RX_SUCCESS) {

0 commit comments

Comments
 (0)