diff options
| author | Pengpeng Hou <pengpeng@iscas.ac.cn> | 2026-08-13 23:23:57 +0800 |
|---|---|---|
| committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2026-08-31 08:48:01 +0200 |
| commit | b946f490be576691c4c47998cf1d4e41d637fbfb (patch) | |
| tree | c906a204472c8aedd20e454e7e0df7bdb5e71f6d /scripts/Makefile.thinlto | |
| parent | ae35035da9dace0557ae61f4d4b8e7b720735954 (diff) | |
| download | linux-next-b946f490be576691c4c47998cf1d4e41d637fbfb.tar.gz linux-next-b946f490be576691c4c47998cf1d4e41d637fbfb.zip | |
thunderbolt: Require complete DROM entry headers
tb_drom_parse_entries() checks for one byte remaining before reading a
DROM entry header, but the header occupies two bytes. It also accepts a
declared length of one byte.
A one-byte tail consequently makes the parser read entry->len outside
the DROM. A one-byte generic string entry reaches the subtype parser and
underflows its payload-length calculation.
Require a complete entry header before reading it and require the
declared entry length to cover that header. Use subtraction-based bounds
checks so the firmware-provided length cannot overflow the DROM extent
calculation.
While at it, use the actual const type instead of void * to make it
clear we only read these.
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
