Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: L2CAP: Fix missing key size check for L2CAP_ECRED_CONN_REQ
@ 2026-11-27 12:12 Simon Mikuda
  2026-11-27 14:03 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-27 12:12 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

The encryption key size of L2CAP_LE_CONN_REQ is checked since
commit 138d7eca445e ("Bluetooth: L2CAP: Fix missing key size check for
L2CAP_LE_CONN_REQ"), but the one of L2CAP_ECRED_CONN_REQ is not: a
channel of the enhanced credit based mode is accepted over an encrypted
link whose key is shorter than the minimum.

PTS L2CAP/ECFC/BV-15-C, the twin of L2CAP/LE/CFC/BV-15-C, pairs with a
15-octet key and expects an IUT that requires 16 octets to refuse the
channel with L2CAP_CR_LE_BAD_KEY_SIZE (0x0007). It gets Connection
Successful (0x0000).

Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/l2cap_core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index da947b65d26a..a9ac91e03fbb 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5525,6 +5525,12 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn,
 		goto unlock;
 	}
 
+	/* Check if Key Size is sufficient for the security level */
+	if (!l2cap_check_enc_key_size(conn->hcon, pchan)) {
+		result = L2CAP_CR_LE_BAD_KEY_SIZE;
+		goto unlock;
+	}
+
 	/* Check if the listening channel has set an output MTU then the
 	 * requested MTU shall be less than or equal to that value.
 	 */

base-commit: 77bc0f253ff9fe1656f6e0fe9e9f5d3da91faf60
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: L2CAP: Fix missing key size check for L2CAP_ECRED_CONN_REQ
  2026-11-27 12:12 [PATCH] Bluetooth: L2CAP: Fix missing key size check for L2CAP_ECRED_CONN_REQ Simon Mikuda
@ 2026-11-27 14:03 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-27 14:03 UTC (permalink / raw)
  To: linux-bluetooth, simon.mikuda

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1224428/

---Test result---

Test Summary:
CheckPatch                    PASS      0.59 seconds
VerifyFixes                   PASS      0.06 seconds
VerifySignedoff               PASS      0.06 seconds
GitLint                       PASS      0.21 seconds
SubjectPrefix                 PASS      0.06 seconds
BuildKernel                   PASS      31.88 seconds
CheckAllWarning               PASS      35.89 seconds
CheckSparse                   PASS      38.81 seconds
BuildKernel32                 PASS      31.86 seconds
CheckKernelLLVM               PASS      33.05 seconds
TestRunnerSetup               PASS      760.81 seconds
TestRunner_l2cap-tester       PASS      14.79 seconds
IncrementalBuild              PASS      30.09 seconds



https://github.com/bluez/bluetooth-next/pull/1242

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-27 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 12:12 [PATCH] Bluetooth: L2CAP: Fix missing key size check for L2CAP_ECRED_CONN_REQ Simon Mikuda
2026-11-27 14:03 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox