[PW_SID:1076292] [v2] Bluetooth: btintel_pcie: validate RX packet length against buffer size#3441
[PW_SID:1076292] [v2] Bluetooth: btintel_pcie: validate RX packet length against buffer size#3441BluezTestBot wants to merge 2 commits intoworkflowfrom
Conversation
This patch adds workflow files for ci: [sync.yml] - The workflow file for scheduled work - Sync the repo with upstream repo and rebase the workflow branch - Review the patches in the patchwork and creates the PR if needed [ci.yml] - The workflow file for CI tasks - Run CI tests when PR is created Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
btintel_pcie_submit_rx_work() reads packet_len from an rfh_hdr in DMA-coherent memory and uses it as the length for skb_put_data() without upper bound validation. Since packet_len is a 16-bit field (0-65535) but each RX DMA buffer is only BTINTEL_PCIE_BUFFER_SIZE (4096) bytes, a malicious or malfunctioning firmware could set a large packet_len, causing an out-of-bounds read beyond the buffer into adjacent kernel heap memory. Add a check that packet_len does not exceed the available payload space alongside the existing zero-length check. Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport") Reported-by: Yuhao Jiang <danisjiang@gmail.com> Cc: stable@vger.kernel.org Cc: Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
|
CheckPatch |
|
GitLint |
|
SubjectPrefix |
|
BuildKernel |
|
CheckAllWarning |
|
CheckSparse |
|
BuildKernel32 |
|
TestRunnerSetup |
|
TestRunner_l2cap-tester |
|
TestRunner_iso-tester |
|
TestRunner_bnep-tester |
|
TestRunner_mgmt-tester |
|
TestRunner_rfcomm-tester |
|
TestRunner_sco-tester |
|
TestRunner_ioctl-tester |
|
TestRunner_mesh-tester |
|
TestRunner_smp-tester |
|
TestRunner_userchan-tester |
|
IncrementalBuild |
0e0806d to
f465113
Compare
btintel_pcie_submit_rx_work() reads packet_len from an rfh_hdr in
DMA-coherent memory and uses it as the length for skb_put_data() without
upper bound validation. Since packet_len is a 16-bit field (0-65535) but
each RX DMA buffer is only BTINTEL_PCIE_BUFFER_SIZE (4096) bytes, a
malicious or malfunctioning firmware could set a large packet_len,
causing an out-of-bounds read beyond the buffer into adjacent kernel
heap memory.
Add a check that packet_len does not exceed the available payload space
alongside the existing zero-length check.
Fixes: c2b636b ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Reported-by: Yuhao Jiang danisjiang@gmail.com
Cc: stable@vger.kernel.org
Cc: Paul Menzel pmenzel@molgen.mpg.de
Signed-off-by: Junrui Luo moonafterrain@outlook.com
Changes in v2:
drivers/bluetooth/btintel_pcie.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
base-commit: 7aaa8047eafd0bd628065b15757d9b48c5f9c07d
change-id: 20260402-fixes-979e727e99f1
Best regards,