Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v18 0/2] Bluetooth: L2CAP: Fix LE credits resuming channels pending security
Date: Thu,  3 Dec 2026 15:46:18 -0500	[thread overview]
Message-ID: <20261203204620.930964-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

An LE Flow Control Credit packet resumes the channel, which on a CoC
waiting for a security upgrade requested with BT_SECURITY drains queued
data and clears the socket suspension before the upgrade completes.

While the upgrade is pending, an established CoC is now moved to
BT_CONFIG with FLAG_PENDING_SECURITY set, like ATT, so credits are only
accounted, not acted upon, and the existing l2cap_security_cfm() path
resumes or closes the channel once the upgrade completes.

This set has a companion userspace set for BlueZ adding l2cap-tester
cases covering it:

  [PATCH BlueZ v1 0/2] l2cap-tester: Add tests for changing LE security
  with SMP pending

Changes in v18:
- Ignore credits on non connection oriented channels, and don't resume
  an Enhanced Credit Based channel whose response has not been sent.
- Don't move an Enhanced Credit Based channel whose response has not
  been sent to BT_CONFIG.
- Let senders racing with BT_SECURITY queue data while the upgrade is
  pending instead of failing with ENOTCONN.
- Return the RX credits not returned while the upgrade was pending, and
  only resume the socket once the held data is sent and credits remain.
- Complete a pending upgrade when BT_SECURITY sets a level the link
  already meets.
- Don't claim key size and MIC are enforced in the commit message.

v17: https://lore.kernel.org/linux-bluetooth/20261203181401.774560-1-luiz.dentz@gmail.com/

Kyle Pepper (2):
  Bluetooth: L2CAP: Restrict LE credits to connected CoCs
  Bluetooth: L2CAP: Keep credits from completing security upgrades

 include/net/bluetooth/l2cap.h | 13 ++++++++
 net/bluetooth/l2cap_core.c    | 60 ++++++++++++++++++++++++++++++++---
 net/bluetooth/l2cap_sock.c    | 32 +++++++++++++++++--
 3 files changed, 97 insertions(+), 8 deletions(-)

-- 
2.56.1


             reply	other threads:[~2026-12-03 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 20:46 Luiz Augusto von Dentz [this message]
2026-12-03 20:46 ` [PATCH v18 1/2] Bluetooth: L2CAP: Restrict LE credits to connected CoCs Luiz Augusto von Dentz
2026-12-03 20:46 ` [PATCH v18 2/2] Bluetooth: L2CAP: Keep credits from completing security upgrades Luiz Augusto von Dentz

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=20261203204620.930964-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /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