Bluetooth: bnep: linearize skb before sending

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>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Adriano Cordova 2026-09-08 13:54:13 -03:00 committed by Luiz Augusto von Dentz
parent 3889a5fcd0
commit 9cc144d95e

View File

@ -495,10 +495,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) {
@ -539,9 +536,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);
/*