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 BlueZ v4 0/6] Add tests for security of deferred setup
Date: Wed, 25 Nov 2026 16:11:54 -0500	[thread overview]
Message-ID: <20261125211200.1955466-1-luiz.dentz@gmail.com> (raw)

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

This adds tests for listeners using BT_DEFER_SETUP when the security
of the link changes, or is still pending, while a connection waits to be
authorized, along with the emulator helpers they need.

The following tests depend on the kernel series "[PATCH v7 0/4]
L2CAP: Fix channels being established with insufficient security" and
fail without it:

L2CAP BR/EDR Server - Security Block Downgrade
L2CAP BR/EDR Server - Defer Encryption Off
L2CAP BR/EDR Server - Defer Early Accept
L2CAP Ext-Flowctl Server - Accept 1 Refuse 1
L2CAP Ext-Flowctl Server - Refuse 1 Accept 1

The remaining tests pass with and without the kernel changes, they
cover paths that had no tests: deferred setup with BR/EDR, LE and
RFCOMM, and a connection being blocked when pairing fails after the
request has been responded as pending.

With the kernel series a channel is refused if encryption completes
below its security level, so L2CAP BR/EDR Client SSP - Success 2, which
requires BT_SECURITY_HIGH, now sets an IO capability that makes pairing
result in an authenticated key.

v4:
 - Add L2CAP Ext-Flowctl Server - Accept 1 Refuse 1 and Refuse 1 Accept 1,
   which check the response to an Enhanced Credit Based request when the
   listener refuses only some of its channels.
 - L2CAP BR/EDR Server - Defer Early Accept and Basic RFCOMM Socket
   Server - Defer Early Accept check how accepting while the security is
   pending ended, an empty queue or an accepted connection, instead of
   only that it was attempted, and fail on any other accept() error.
 - L2CAP LE Server - Defer Success no longer expects a response, so it
   only passes once the socket is connected instead of passing with the
   response.
v3:
 - L2CAP BR/EDR Server - Defer Early Accept and Defer Encryption Off
   fail if the final Security Block response is received before the
   connection was accepted or encryption was disabled, instead of
   passing with it.
v2:
 - Add L2CAP BR/EDR Server - Security Block Downgrade and
   btdev_set_link_key_type() which it uses.
 - L2CAP BR/EDR Server - Defer Success no longer expects a response,
   so it only passes once the socket is connected instead of passing
   with the first, pending, response.
 - bthost: A request kept while its response is pending is only called
   with Connection Responses, other requests may use the same
   identifier.
 - Set the IO capability in L2CAP BR/EDR Client SSP - Success 2.

Luiz Augusto von Dentz (6):
  emulator/bthost: Add helpers to test security of deferred setup
  emulator/btdev: Add btdev_set_link_key_type
  l2cap-tester: Add tests for security of deferred setup
  rfcomm-tester: Add tests for deferred setup
  l2cap-tester: Set IO capability in Client SSP - Success 2
  l2cap-tester: Add tests for partially accepting Ext-Flowctl requests

 emulator/btdev.c      |  13 +-
 emulator/btdev.h      |   5 +
 emulator/bthost.c     |  86 +++++++++
 emulator/bthost.h     |   6 +
 tools/l2cap-tester.c  | 432 ++++++++++++++++++++++++++++++++++++++++++
 tools/rfcomm-tester.c | 167 ++++++++++++++++
 6 files changed, 708 insertions(+), 1 deletion(-)

-- 
2.56.0


             reply	other threads:[~2026-11-25 21:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 21:11 Luiz Augusto von Dentz [this message]
2026-11-25 21:11 ` [PATCH BlueZ v4 1/6] emulator/bthost: Add helpers to test security of deferred setup Luiz Augusto von Dentz
2026-11-25 23:46   ` Add tests for " bluez.test.bot
2026-11-25 21:11 ` [PATCH BlueZ v4 2/6] emulator/btdev: Add btdev_set_link_key_type Luiz Augusto von Dentz
2026-11-25 21:11 ` [PATCH BlueZ v4 3/6] l2cap-tester: Add tests for security of deferred setup Luiz Augusto von Dentz
2026-11-25 21:11 ` [PATCH BlueZ v4 4/6] rfcomm-tester: Add tests for " Luiz Augusto von Dentz
2026-11-25 21:11 ` [PATCH BlueZ v4 5/6] l2cap-tester: Set IO capability in Client SSP - Success 2 Luiz Augusto von Dentz
2026-11-25 21:12 ` [PATCH BlueZ v4 6/6] l2cap-tester: Add tests for partially accepting Ext-Flowctl requests 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=20261125211200.1955466-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