Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bluetooth: L2CAP: CoC: Disconnect if received packet size exceeds MPS

Core 6.0, Vol 3, Part A, 3.4.3:
"... If the payload size of any K-frame exceeds the receiver's MPS, the
receiver shall disconnect the channel..."

This fixes L2CAP/LE/CFC/BV-27-C (running together with 'l2test -r -P
0x0027 -V le_public -I 100').

Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tested-by: Christian Eggers <ceggers@arri.de>

authored by

Christian Eggers and committed by
Luiz Augusto von Dentz
728a3d12 7f2c3c49

+7
+7
net/bluetooth/l2cap_core.c
··· 6705 6705 return -ENOBUFS; 6706 6706 } 6707 6707 6708 + if (skb->len > chan->mps) { 6709 + BT_ERR("Too big LE L2CAP MPS: len %u > %u", skb->len, 6710 + chan->mps); 6711 + l2cap_send_disconn_req(chan, ECONNRESET); 6712 + return -ENOBUFS; 6713 + } 6714 + 6708 6715 chan->rx_credits--; 6709 6716 BT_DBG("chan %p: rx_credits %u -> %u", 6710 6717 chan, chan->rx_credits + 1, chan->rx_credits);