]> git.ipfire.org Git - thirdparty/linux.git/commit
Bluetooth: RFCOMM: pull credit byte with skb_pull_data()
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Thu, 23 Apr 2026 15:31:00 +0000 (23:31 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 6 May 2026 20:23:20 +0000 (16:23 -0400)
commit8f59d17b18a78fdfdbb67d693b3d3eb03db184e0
tree6fdf0b512a4182b84e91c2f1f95eaeaa25b617c4
parentdaf23014e5d975e72ea9c02b5160d3fcf070ea47
Bluetooth: RFCOMM: pull credit byte with skb_pull_data()

rfcomm_recv_data() treats the first payload byte as a credit field when
the UIH frame carries PF and credit-based flow control is enabled.

After the header has been stripped, the PF/CFC path consumes that byte
with a direct skb->data dereference followed by skb_pull(). A malformed
short frame can reach this path without a byte available.

Use skb_pull_data() so the length check and pull happen together before
the returned credit byte is consumed.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/rfcomm/core.c