mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
qcom_ec_read() accepts short positive transfers, while both callers
unconditionally consume every field in their fixed-size response. A short
transfer can therefore make them use trailing stack bytes that were not
returned by the device.
The first response byte contains the number of payload bytes, excluding
the byte count itself. A complete response of resp_len bytes must
therefore report resp_len - 1 payload bytes. The existing check only
rejects counts that do not fit in the response buffer and still accepts
an incomplete payload.
Require both the SMBus transfer length and the EC-provided payload count
to match the expected response size.
Fixes:
|
||
|---|---|---|
| .. | ||
| acer-aspire1-ec.c | ||
| huawei-gaokun-ec.c | ||
| Kconfig | ||
| lenovo-thinkpad-t14s.c | ||
| lenovo-yoga-c630.c | ||
| Makefile | ||
| qcom-hamoa-ec.c | ||