CVE-2024-50227 Information
Description
In the Linux kernel the following vulnerability has been resolved:
thunderbolt: Fix KASAN reported stack out-of-bounds read in tb_retimer_scan()
KASAN reported following issue:
BUG: KASAN: stack-out-of-bounds in tb_retimer_scan+0xffe/0x1550 [thunderbolt]
Read of size 4 at addr ffff88810111fc1c by task kworker/u56:0/11
CPU: 0 UID: 0 PID: 11 Comm: kworker/u56:0 Tainted: G U 6.11.0+ 1387
Tainted: [U]=USER
Workqueue: thunderbolt0 tb_handle_hotplug [thunderbolt]
Call Trace:
This happens because the loop variable still gets incremented by one so max becomes 3 instead of 2 and this makes the second loop read past the the array declared on the stack.
Fix this by assigning to max directly in the loop body.
Reference
https://git.kernel.org/stable/c/08b2771e9270fbe1ed4fbbe93abe05ac7fe9861d https://git.kernel.org/stable/c/e9e1b20fae7de06ba36dd3f8dba858157bad233d
Share on: