Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1 1/2] Bluetooth: btintel_pcie: validate packet_len before skb_put_data
@ 2026-09-02 13:18 Kiran K
  2026-09-02 13:18 ` [PATCH v1 2/2] Bluetooth: btintel_pcie: fix tx_handle bounds off-by-one Kiran K
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kiran K @ 2026-09-02 13:18 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: ravishankar.srivatsa, chethan.tumkur.narayan,
	chandrashekar.devegowda, Kiran K

btintel_pcie_submit_rx_work() reads packet_len from rfh_hdr without
checking if it exceeds the RX buffer size. An oversized packet_len
can lead to an out-of-bounds read in skb_put_data().

Validate packet_len to ensure it is non-zero and does not exceed
BTINTEL_PCIE_BUFFER_SIZE - sizeof(*rfh_hdr), logging an error when
invalid.

Fixes: c2b636b3f788 ("Bluetooth: btintel_pcie: Add support for PCIe transport")
Signed-off-by: Kiran K <kiran.k@intel.com>
---
 drivers/bluetooth/btintel_pcie.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index 30923eaabed7..1eabb0c8326f 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -1954,7 +1954,8 @@ static int btintel_pcie_submit_rx_work(struct btintel_pcie_data *data, u8 status
 	rfh_hdr = buf;
 
 	len = rfh_hdr->packet_len;
-	if (len <= 0) {
+	if (len == 0 || len > BTINTEL_PCIE_BUFFER_SIZE - sizeof(*rfh_hdr)) {
+		bt_dev_err(data->hdev, "Invalid packet_len %d", len);
 		ret = -EINVAL;
 		goto resubmit;
 	}
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-03 13:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 13:18 [PATCH v1 1/2] Bluetooth: btintel_pcie: validate packet_len before skb_put_data Kiran K
2026-09-02 13:18 ` [PATCH v1 2/2] Bluetooth: btintel_pcie: fix tx_handle bounds off-by-one Kiran K
2026-09-02 15:50 ` [v1,1/2] Bluetooth: btintel_pcie: validate packet_len before skb_put_data bluez.test.bot
2026-09-03  7:27 ` [PATCH v1 1/2] " Paul Menzel
2026-09-03 13:58   ` K, Kiran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox