diff options
author | Ping-Ke Shih <pkshih@realtek.com> | 2025-02-03 15:29:11 +0800 |
---|---|---|
committer | Ping-Ke Shih <pkshih@realtek.com> | 2025-02-10 11:02:03 +0800 |
commit | 2b8bdc5237014cc61784b3676cbaca5325959f3d (patch) | |
tree | 940d9b136b150034854b8cd5581ea791031f39ac /tools/perf/scripts/python/gecko.py | |
parent | 1f0efffd597893404aea5c3d4f1bdaa1c61d4434 (diff) |
wifi: rtw89: fw: validate multi-firmware header before getting its size
To access firmware elements appended after multi-firmware, add its size
as offset to get start address of firmware elements.
+-----+-------+------+---------+--------------+ --
| sig | fw_nr | rsvd | version | reserved | \
+---------------------------------------------+ |
fw 0 | cv | type | mp | rsvd | shift | size | rsvd | |
+---------------------------------------------+ |
fw 1 | cv | type | mp | rsvd | shift | size | rsvd | |
+---------------------------------------------+ |
fw N-1 | ... | |
+=============================================+ | mfw size
| fw 0 content | |
+=============================================+ |
| fw 1 content | |
+=============================================+ |
| ... | |
+=============================================+ |
| fw N -1 content | |
+=============================================+ --/
| fw element TLV X |
+=============================================+
| fw element TLV Y |
+=============================================+
| fw element TLV Z |
+=============================================+
To avoid Coverity warning when getting mfw size, validate it header ahead.
Addresses-Coverity-ID: 1544385 ("Untrusted array index read")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250203072911.47313-5-pkshih@realtek.com
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions