Bluetooth: L2CAP: Fix type confusion in l2cap_ecred_reconf_rsp()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 15f02b91056253e8cdc592888f431da0731337b8 · < 5a1ea296f8589ce8f1e3141b2b123b34ad010e19| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: Fix type confusion in l2cap_ecred_reconf_rsp()
l2cap_ecred_reconf_rsp() casts the incoming data to struct l2cap_ecred_conn_rsp (the ECRED *connection* response, 8 bytes with result at offset 6) instead of struct l2cap_ecred_reconf_rsp (2 bytes with result at offset 0).
This causes two problems:
- The sizeof(*rsp) length check requires 8 bytes instead of the correct 2, so valid L2CAP_ECRED_RECONF_RSP packets are rejected with -EPROTO.
- rsp->result reads from offset 6 instead of offset 0, returning wrong data when the packet is large enough to pass the check.
Fix by using the correct type. Also pass the already byte-swapped result variable to BT_DBG instead of the raw __le16 field.
From the CVE record · Linux
The Linux kernel’s Bluetooth L2CAP handler uses the wrong response type for ECRED reconfiguration responses. A sender of Bluetooth L2CAP responses can cause valid packets to be rejected or an incorrect result to be read when a packet is large enough; the input does not specify authentication or user-interaction requirements.
Engineers running Linux kernels with the affected Bluetooth L2CAP code should check their versions; affected versions are not specified.