Linux bluetooth development
 help / color / mirror / Atom feed
From: Christian Eggers <ceggers@arri.de>
To: <linux-bluetooth@vger.kernel.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: Re: [PATCH v2] Bluetooth: L2CAP: CoC: Disconnect if received packet size exceeds MPS
Date: Fri, 27 Feb 2026 16:44:56 +0100	[thread overview]
Message-ID: <2334032.vFx2qVVIhK@n9w6sw14> (raw)
In-Reply-To: <CABBYNZJPBRVE3t0Q-fYdZtCTt3QTxKp8t8Sd-BLrHr5Vv7GSWw@mail.gmail.com>

Hi Luiz,

On Thursday, 26 February 2026, 21:48:48 CET, Luiz Augusto von Dentz wrote:
> Hi Christian,
> 
> On Thu, Feb 26, 2026 at 3:44 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > From: Christian Eggers <ceggers@arri.de>
> >
> > 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>
> > ---
> > Note: due to lack of L2CAP CoC segmentation support in bthost the following
> > test as expected to fail:
> >
> > L2CAP LE Client - Read 32k Success
> > L2CAP LE Client - RX Timestamping 32k
> 
> I didn't have to introduce any new fields btw since the above tests
> confirm the MPS is working. I reverted to just using chan->mps, remote
> mps is tracked by remote_mps field and I check that the remote cannot
> actually set our own MPS. I wonder if something else was at play or if
> there is some specific requirement for L2CAP/LE/CFC/BV-27-C (e.g.
> reconfigure?)

Unfortunately I cannot tell anymore why simply checking chan->mps was not
sufficient for me. I have tested your simplified version and 
L2CAP/LE/CFC/BV-27-C runs fine. So you can add this to bluetooth-next.

BTW: In the description of the other patch 
"LE L2CAP: Disconnect if sum of payload sizes exceed SDU", the PTS test
seem to be wrong:

L2CAP/LE/CFC/BV-27-C --> L2CAP/LE/CFC/BV-28-C

Maybe you would like to fix this in bluetooth-next

regards,
Christian

> 
> >
> >  net/bluetooth/l2cap_core.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> > index f550ceceb618..14131e427efd 100644
> > --- a/net/bluetooth/l2cap_core.c
> > +++ b/net/bluetooth/l2cap_core.c
> > @@ -6669,6 +6669,13 @@ static int l2cap_ecred_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
> >                 return -ENOBUFS;
> >         }
> >
> > +       if (skb->len > chan->mps) {
> > +               BT_ERR("Too big LE L2CAP MPS: len %u > %u", skb->len,
> > +                      chan->mps);
> > +               l2cap_send_disconn_req(chan, ECONNRESET);
> > +               return -ENOBUFS;
> > +       }
> > +
> >         chan->rx_credits--;
> >         BT_DBG("chan %p: rx_credits %u -> %u",
> >                chan, chan->rx_credits + 1, chan->rx_credits);
> > --
> > 2.52.0
> >
> 
> 
> 





  reply	other threads:[~2026-02-27 15:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-26 20:43 [PATCH v2] Bluetooth: L2CAP: CoC: Disconnect if received packet size exceeds MPS Luiz Augusto von Dentz
2026-02-26 20:48 ` Luiz Augusto von Dentz
2026-02-27 15:44   ` Christian Eggers [this message]
2026-02-26 21:26 ` [v2] " bluez.test.bot
2026-02-27 16:30 ` [PATCH v2] " Christian Eggers
2026-02-27 18:40 ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2334032.vFx2qVVIhK@n9w6sw14 \
    --to=ceggers@arri.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox