Bluetooth: RFCOMM: Validate MTU in rfcomm_apply_pn() to prevent infinite loop
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < aeee917a4878af95f0c63e18c5f22eaf6299c7b8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: RFCOMM: Validate MTU in rfcomm_apply_pn() to prevent infinite loop
rfcomm_apply_pn() accepts the MTU value from a remote PN (Parameter Negotiation) frame without checking for zero. When the remote peer sends an MTU of zero, d->mtu is set to 0. This causes the sendmsg path to enter an infinite loop when fragmenting data, as each fragment has size == min_t(size_t, len, 0) == 0, so the remaining length never decreases. The infinite allocation of zero-length skbs exhausts all system memory.
Fix by clamping d->mtu to RFCOMM_DEFAULT_MTU when the negotiated value is zero, consistent with the initial value assigned in rfcomm_dlc_alloc().
From the CVE record · Linux
The Linux kernel's Bluetooth RFCOMM code accepts a zero MTU from a remote peer's Parameter Negotiation frame. If the sendmsg path then fragments data, it can enter an infinite loop and exhaust system memory. The input does not specify authentication requirements.
Engineers running Linux kernels with Bluetooth RFCOMM should check their exposure; affected versions were not specified.