From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796330791; b=17uY2vm9PI48OWpe3NI1/05wAqxq+BLmglEq+fxNmp7uzu7xurWlFy44y3EeypN4RyOs F7ueIsc0QSgPI1ZYRH7iJvlbKMG5CyiwPf0lGbnS7+FYPsj/8eMU7mENwPe98Eom3s/Ku lBPdWNf3KsT6uiZdIXdJ1SGrdF5CyBfnI8XIGu8n8IA4EluGtGHUfBbGrTvuFaZBrA6w9 u0rYLWwWbplsXK6dShCbX/A5MmXt50fuSXiCMLiQ7HsAVLgaaOzZfgMQ/dejBSMcSsg46 oiFPvsFByXwcTqCnPujLitAFWVCMJPdJGFW88kzp7goNTMbcsgt0nNLjSwh2UYECtbg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796330791; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=0RmXZO8T9wnVCZ26HiuuAbA1JZ5l6tIJ5gF+F83Id9Y=; b=JB2uKFCFyc+QQGZw5VRMRcEEQ59cWj/jhpOsZE8n8+2ud8co55AJHr1ysUrh141+ulcY IHHTzjmSaB0315iTjj9z13m5h3jlH3GXRMudmqhOJu5CCcm3w0hPz3BJumMBcQZoNLREO KRu7VO0kqhIL9jowk97heUzqfdcC1npDVTq0gvAUJBDqbgEB8mqtMcA/M6cUzEZD9V8Qq LvTCMNBb9tzQALwl0XjIPJQ6yA4lSWGUfk9QE060hB5M/YNYelie5nryulsiucvGhqzVT r6Gge/RH16pe348jdvOWqaZ1TjMXnB59VfG4bPOa6XFb4qQIvGUvwSuUW0bP/55T38Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jbJ48Hp8; arc=none smtp.remote-ip=209.85.222.41 Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89F79606A322 for ; Thu, 3 Dec 2026 20:46:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 89F79606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=jbJ48Hp8 Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-99c042cee7dso68997241.1 for ; Thu, 03 Dec 2026 12:46:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796330790; x=1796935590; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=0RmXZO8T9wnVCZ26HiuuAbA1JZ5l6tIJ5gF+F83Id9Y=; b=jbJ48Hp8syVvjesbJYbZ/M9Ap8u7Fe4Ox79Uf3TC3Clzc0qRwneiNanPF8wqzNz/za ojYRrZDzKge9x4TIDJbUVTQ8c3IXa+sB5OElmqcNDWpdpkM3uVpNlXlGieAnYwNuU/3u feoaQlfeh4HtRbQ4jmIR4nlijDOPAhrXtuXqwIBrhmCCgdnrb4vWHXMZWrtHSWBrMIBY 3FO2VJVm4h/71iAFqUefTnpXghnmCyIz/f/fAUZtLvkXt2UaFzSKVDyo5sYLWZkc2rhI zDI1zHemDplDrYMd+6rzXR/6Ia+Ltj66q7p2JZ4X/gwz0tbhe5B6lXbFwFtZ14+lgfAD GYCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796330790; x=1796935590; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=0RmXZO8T9wnVCZ26HiuuAbA1JZ5l6tIJ5gF+F83Id9Y=; b=SGTsSBTK9yR9gl1vUhB6jGIpRs2CoVaGpUqZw+rR/8TWBAVvqCyQyvcR9DO2E0cd8Q T5MqlmzIv4uBM/tJmKV3CrhlQaS5zZAkDrnagXnetZpV/199IIhwc4rr39jWCrNvzhVt QKksoOujM5M4Mwwpqzd2c/3getSDXM560Fg8DyRVxHwypdwVXSRrJvGFSLvncl+z8boc /NlrvzV82BVzTSdr19nosPvBtoxtgEYRbNH87fyhh2gXhmJG21r/StE5YM7W0DrHQWmI ekKfxQRYpxKNt8v5NtgTS/Ap9a8r4RDFE+bx9nQCFmCQmqMMmZ6/OXDNX40l3wfX5H2A u+iw== X-Gm-Message-State: APuU4Z+XXjb9lMm8xxtn/0PThUJO1h3o6AdEaJtJ/TzU/Myf/fAnCrKm /+5G+TbUWgydLORiDV25QkppTUDHineBoaK2bj4SY4JXVyPrE3oPF3r3GAnWjerY X-Gm-Gg: AZFdTZcfQvxqxBhr+nMO9OEVJ3UH22elpUWhwg/LDG/DYhpjTOzBISpfQF8mdwc1J7m d+p9jq9RA2ismWCVUmBLT803dThfTMlbZVFlm7u5oT08BSY5mQ60rVmPc3GBRpoTXHk3eqYuYeu 9AqPuh7M7Zsb1GyePsecHUSapIwOg87UJcfUj4uv8eBmuVdufwgtA78sVkXadkUGzztzjEYhIiu QCU9xDN35vgGvF199JROp8uCMuKPoiyDmQa0HylIXO1ET3hCfMxGKBBNDhfwnsimdl8LJkHwGH1 gGDml86baEiEtBnBrjR9ldDjrkwkyXu/NU/4oLRisNGvWPVPVcNncMe22BrELxwsOc7wSjFJu1J Ow3Tf3EsNQpZ7U+3JkhN/JBXQaQrycOmNe9Mh7x9cNg1tVOiBHUsoQZIogmaRUEcnswzwZx9oYT O0v00HYCb1IWQaiEKmZLy+ZIa1Mzut47caytRCofWaGGeHYqZCM8I0PY5EzKIRJeQx/AU5/cMQU thP8i92bpdHqgVtBra1umxkEbbGfMBYoy/g+Uk37+Ee53bYnKhmF8uDOagb87lvHC44fWx2aE9O TsFv4dkDUbdsqm1F+hPeGLOKiWCn6QBWVksBPFEVoONYJ//ExiIJfHZ079p/K+ZuzCM86wcTEEw /KiUhK4TZHx/m5Y2SfGuhklO3H4VkRqa9YZDELBEJhKzl0Q7jX9sd6PVa+vaBNX/l1gwQnJziPC xh X-Received: by 2002:a05:6102:a54:b0:7bc:1de3:39b0 with SMTP id ada2fe7eead31-7d7396670b7mr30610635137.32.1796330790450; Thu, 03 Dec 2026 12:46:30 -0800 (PST) Received: from lvondent-mobl5 ([72.188.211.115]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-7dae96e9d30sm36741137.6.2026.12.03.12.46.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 12:46:29 -0800 (PST) From: Luiz Augusto von Dentz 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 Message-ID: <20261203204620.930964-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz 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