public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] Bluetooth: 6lowpan: reset link-local header on ipv6 recv path
@ 2025-11-03 18:29 Pauli Virtanen
  2025-11-03 18:29 ` [PATCH v2 2/5] Bluetooth: 6lowpan: fix BDADDR_LE vs ADDR_LE_DEV address type confusion Pauli Virtanen
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Pauli Virtanen @ 2025-11-03 18:29 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: Pauli Virtanen, marcel, johan.hedberg, luiz.dentz, linux-kernel,
	Paul Menzel

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: 18722c247023 ("Bluetooth: Enable 6LoWPAN support for BT LE devices")
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Pauli Virtanen <pav@iki.fi>
---

Notes:
    v2:
    - no changes

 net/bluetooth/6lowpan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index f0c862091bff..f1d29fa4b411 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -289,6 +289,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 		local_skb->pkt_type = PACKET_HOST;
 		local_skb->dev = dev;
 
+		skb_reset_mac_header(local_skb);
 		skb_set_transport_header(local_skb, sizeof(struct ipv6hdr));
 
 		if (give_skb_to_upper(local_skb, dev) != NET_RX_SUCCESS) {
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-07 19:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 18:29 [PATCH v2 1/5] Bluetooth: 6lowpan: reset link-local header on ipv6 recv path Pauli Virtanen
2025-11-03 18:29 ` [PATCH v2 2/5] Bluetooth: 6lowpan: fix BDADDR_LE vs ADDR_LE_DEV address type confusion Pauli Virtanen
2025-11-03 18:29 ` [PATCH v2 3/5] Bluetooth: L2CAP: export l2cap_chan_hold for modules Pauli Virtanen
2025-11-04 10:44   ` Paul Menzel
2025-11-03 18:29 ` [PATCH v2 4/5] Bluetooth: 6lowpan: Don't hold spin lock over sleeping functions Pauli Virtanen
2025-11-03 18:29 ` [PATCH v2 5/5] Bluetooth: 6lowpan: add missing l2cap_chan_lock() Pauli Virtanen
2025-11-03 19:07 ` [v2,1/5] Bluetooth: 6lowpan: reset link-local header on ipv6 recv path bluez.test.bot
2025-11-07 19:10 ` [PATCH v2 1/5] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox