Netdev List
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: bnep: linearize skb before sending
@ 2026-09-05 19:47 Adriano Cordova
  2026-09-08 15:50 ` Luiz Augusto von Dentz
  2026-09-09  6:49 ` netdev-bot+sashiko
  0 siblings, 2 replies; 4+ messages in thread
From: Adriano Cordova @ 2026-09-05 19:47 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	linux-bluetooth
  Cc: netdev, Adriano Cordova

kernel_sendmsg expects contiguous data. Check the skb is linear
before building its kvec. Should be already linearized by the
stack, so this is defensive, but drops the dead block and the
FIXME.

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
---
 net/bluetooth/bnep/core.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 5a6a49885ab6..497eb1d2d6ee 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -457,13 +457,15 @@ static int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
 	}
 
 send:
+	if (skb_linearize(skb)) {
+		kfree_skb(skb);
+		return -ENOMEM;
+	}
+
 	iv[il++] = (struct kvec) { skb->data, skb->len };
 	len += skb->len;
 
-	/* FIXME: linearize skb */
-	{
-		len = kernel_sendmsg(sock, &s->msg, iv, il, len);
-	}
+	len = kernel_sendmsg(sock, &s->msg, iv, il, len);
 	kfree_skb(skb);
 
 	if (len > 0) {
-- 
2.51.0


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

end of thread, other threads:[~2026-09-09  6:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-05 19:47 [PATCH] Bluetooth: bnep: linearize skb before sending Adriano Cordova
2026-09-08 15:50 ` Luiz Augusto von Dentz
2026-09-08 16:55   ` Adriano Córdova
2026-09-09  6:49 ` netdev-bot+sashiko

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