diff options
| author | Pengpeng Hou <pengpeng@iscas.ac.cn> | 2026-07-20 19:58:26 +0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-07-20 07:29:44 -0700 |
| commit | 70e76e700fc6c46afb4e17aec099a1ea089b4a22 (patch) | |
| tree | d67c8e8d590f8a93163328e375b3308aab2c5efb /tools/testing/selftests/net/lib | |
| parent | 9813c1f49efeadbcb17e4a41972350ac783f9cac (diff) | |
| download | lwn-70e76e700fc6c46afb4e17aec099a1ea089b4a22.tar.gz lwn-70e76e700fc6c46afb4e17aec099a1ea089b4a22.zip | |
hwmon: occ: validate poll response sensor blocks
The OCC poll response parser walks a counted list of sensor data blocks.
It used the static backing-array capacity as the parse boundary, but a
transport response makes only data_length bytes current and valid. A
truncated response can therefore make the parser consume a block header or
block extent outside the current response.
Use data_length as the parent boundary, prove the fixed poll header and
each current block header before reading them, and prove the complete block
before advancing. Keep parsed sensor metadata local until the complete
response has passed validation, then publish it. Propagate
malformed-response errors before publishing the OCC as active.
Fixes: aa195fe49b03 ("hwmon (occ): Parse OCC poll response")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20260720115826.14813-1-pengpeng@iscas.ac.cn
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/testing/selftests/net/lib')
0 files changed, 0 insertions, 0 deletions
