{"id":"CVE-2026-64127","summary":"Bluetooth: L2CAP: ecred_reconfigure: send packed pdu, not stack pointer","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: L2CAP: ecred_reconfigure: send packed pdu, not stack pointer\n\nCommit 1c08108f3014 (\"Bluetooth: L2CAP: Avoid -Wflex-array-member-not-at-end\nwarnings\") converted the on-stack request PDU in l2cap_ecred_reconfigure()\nfrom an explicit packed struct to DEFINE_RAW_FLEX(), but did not adjust the\nsize and source-pointer arguments to l2cap_send_cmd():\n\n  -    struct {\n  -            struct l2cap_ecred_reconf_req req;\n  -            __le16 scid;\n  -    } pdu;\n  +    DEFINE_RAW_FLEX(struct l2cap_ecred_reconf_req, pdu, scid, 1);\n       ...\n       l2cap_send_cmd(conn, chan-\u003eident, L2CAP_ECRED_RECONF_REQ,\n                      sizeof(pdu), &pdu);\n\nAfter the conversion, DEFINE_RAW_FLEX() expands to declare an anonymous\nunion pdu_u plus a local pointer \"pdu\" pointing at it. Therefore:\n\n  - sizeof(pdu) is now sizeof(struct l2cap_ecred_reconf_req *) = 8 on\n    64-bit (4 on 32-bit), not the 6 bytes of (mtu, mps, scid[1]).\n  - &pdu is the address of the local pointer's stack storage, not the\n    address of the request payload.\n\nl2cap_send_cmd() forwards (data, count) to l2cap_build_cmd(), which calls\nskb_put_data(skb, data, count). The L2CAP_ECRED_RECONFIGURE_REQ packet\nbody therefore contains 8 bytes copied from the kernel stack starting at\n&pdu -- the 8 bytes overlap the pdu pointer's value, leaking a kernel\nstack address to the paired Bluetooth peer. The intended (mtu, mps, scid)\nfields are not transmitted at all, so the peer rejects the request as\nmalformed and the L2CAP_ECRED_RECONFIGURE feature itself has been broken\nfor the local-side initiator since the introducing commit landed.\n\nThe sibling site l2cap_ecred_conn_req() in the same commit was converted\ncorrectly (sizeof(*pdu) + len, pdu); only this site was missed.\n\nRestore the original semantics: pass the full flex-struct size via\nstruct_size(pdu, scid, 1) and the pdu pointer (the struct address) as\nthe source.\n\nValidated on a stock 7.0-based host kernel via the real call path:\nsetsockopt(SOL_BLUETOOTH, BT_RCVMTU, ...) on a BT_CONNECTED\nL2CAP_MODE_EXT_FLOWCTL socket emits an L2CAP_ECRED_RECONFIGURE_REQ\nwhose body is 8 bytes (the on-stack pdu local's value) rather than\nthe expected 6. Three captures from fresh socket / fresh hciemu peer\non the same host -- low bytes vary per call, high 0xffff confirms a\nkernel virtual address (KASLR-randomised stack slot, not a fixed\nstring):\n\n  RECONF_REQ body (ident=0x02 len=8): 42 fb 54 af 0e ca ff ff\n  RECONF_REQ body (ident=0x02 len=8): 52 3d 2e af 0e ca ff ff\n  RECONF_REQ body (ident=0x02 len=8): b2 fc 5b af 0e ca ff ff\n\nAfter this patch the body is 6 bytes carrying the expected\nlittle-endian (mtu, mps, scid).","modified":"2026-07-21T03:47:57.625673155Z","published":"2026-07-19T15:40:23.960Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64127.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/051922ab709c0a6917eae765c22481dfc68379e5"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3374ef8cf99368a40f7efd51a2a375a4c5dc6f0d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/356c9d1a1cbacd2a1640fff3c050e1c3472e924f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ed5fcd2a26f0c16fc289c8cd6b03328a0582a687"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/64xxx/CVE-2026-64127.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64127"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"1c08108f3014881ad5f4c35a2abaf9c65475035d"},{"fixed":"ed5fcd2a26f0c16fc289c8cd6b03328a0582a687"},{"fixed":"051922ab709c0a6917eae765c22481dfc68379e5"},{"fixed":"356c9d1a1cbacd2a1640fff3c050e1c3472e924f"},{"fixed":"3374ef8cf99368a40f7efd51a2a375a4c5dc6f0d"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64127.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.10.0"},{"fixed":"6.12.92"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.34"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.0.11"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-64127.json"}}],"schema_version":"1.7.5"}