]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Bluetooth: btrtl: validate firmware patch bounds
authorLaxman Acharya Padhya <acharyalaxman8848@gmail.com>
Fri, 10 Jul 2026 17:25:03 +0000 (23:10 +0545)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Jul 2026 14:08:06 +0000 (10:08 -0400)
commit609c5b04a28dc1b0f3af6a7bc93055135b2d2059
treefd4fee8674c213b0f5230a2e850de791893d9bd8
parent2bf282f8f715f5d05d6f4c49ffb3bd241c5e667e
Bluetooth: btrtl: validate firmware patch bounds

rtlbt_parse_firmware() copies patch_length - 4 bytes before appending the
firmware version. A malformed firmware patch shorter than the version field
can make this subtraction underflow and turn the copy into an oversized
read and write during Bluetooth setup.

The existing patch_offset + patch_length check can also wrap on 32-bit
architectures. Validate the patch length and range without arithmetic
overflow before allocating or copying the patch.

Fixes: db33c77dddc2 ("Bluetooth: btrtl: Create separate module for Realtek BT driver")
Cc: stable@vger.kernel.org
Signed-off-by: Laxman Acharya Padhya <acharyalaxman8848@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
drivers/bluetooth/btrtl.c