* [PATCH v2] Bluetooth: bnep: linearize skb before sending
@ 2026-09-08 16:54 Adriano Cordova
2026-09-09 19:40 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 2+ messages in thread
From: Adriano Cordova @ 2026-09-08 16:54 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
linux-bluetooth
Cc: netdev, Adriano Cordova
kernel_sendmsg expects contiguous data. Linearize the skb in the
bnep_session() loop, before bnep_tx_frame builds its kvec, so it
is not split across non-linear pages. Drop the dead block and
FIXME.
Signed-off-by: Adriano Cordova <adrianox@gmail.com>
---
Changes since v1:
- Move linearization to bnep_session loop, before
bnep_tx_frame builds its kvec
net/bluetooth/bnep/core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 0dde82e9a085..e8b4672628dd 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -480,10 +480,7 @@ static int bnep_tx_frame(struct bnep_session *s, struct sk_buff *skb)
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) {
@@ -524,9 +521,12 @@ static int bnep_session(void *arg)
break;
/* TX */
- while ((skb = skb_dequeue(&sk->sk_write_queue)))
- if (bnep_tx_frame(s, skb))
+ while ((skb = skb_dequeue(&sk->sk_write_queue))) {
+ if (skb_linearize(skb))
+ kfree_skb(skb);
+ else if (bnep_tx_frame(s, skb))
break;
+ }
netif_wake_queue(dev);
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] Bluetooth: bnep: linearize skb before sending
2026-09-08 16:54 [PATCH v2] Bluetooth: bnep: linearize skb before sending Adriano Cordova
@ 2026-09-09 19:40 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2026-09-09 19:40 UTC (permalink / raw)
To: =?utf-8?q?Adriano_C=C3=B3rdova_=3Cadrianox=40gmail=2Ecom=3E?=
Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, netdev
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Tue, 8 Sep 2026 13:54:13 -0300 you wrote:
> kernel_sendmsg expects contiguous data. Linearize the skb in the
> bnep_session() loop, before bnep_tx_frame builds its kvec, so it
> is not split across non-linear pages. Drop the dead block and
> FIXME.
>
> Signed-off-by: Adriano Cordova <adrianox@gmail.com>
>
> [...]
Here is the summary with links:
- [v2] Bluetooth: bnep: linearize skb before sending
https://git.kernel.org/bluetooth/bluetooth-next/c/c2daf81dc275
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-09 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 16:54 [PATCH v2] Bluetooth: bnep: linearize skb before sending Adriano Cordova
2026-09-09 19:40 ` 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