diff options
| author | Weigang He <geoffreyhe2@gmail.com> | 2026-09-26 15:49:29 +1000 |
|---|---|---|
| committer | Sean Young <sean@mess.org> | 2026-09-30 15:13:09 +0100 |
| commit | d1febef1bcfa7bbc401729f994c375b91a833911 (patch) | |
| tree | 5c1c7fcab85d76b2ad513a7d0003de75b1a35213 /tools/perf/scripts/python | |
| parent | 5f21cd9a4ae4a891b273178b40e0e9eb5b9ac650 (diff) | |
media: rc: fintek-cir: process a full RX buffer instead of overflowing it
fintek_get_rx_ir_data() drains the CIR RX FIFO into fintek->buf[], which
holds RX_BUF_LEN (32) bytes, for as long as CIR_STATUS reports pending
RX data:
do {
sample = fintek_cir_reg_read(fintek, CIR_RX_DATA);
...
fintek->buf[fintek->pkts] = sample;
fintek->pkts++;
...
} while (status & rx_irqs);
Nothing bounds fintek->pkts. If the hardware reports data for more than
RX_BUF_LEN reads in one interrupt, the loop writes past the end of
buf[], starting with the pkts counter that follows it in struct
fintek_dev.
Hand a full buffer to fintek_process_rx_ir_data(), which parses the
samples and resets fintek->pkts, before storing the next sample. This
keeps the parser state consistent and drops no samples. The loop still
relies on the status register to terminate.
The driver does not document the hardware FIFO depth, so it is not
known whether a working device can trigger this.
Found by static analysis tool CodeQL.
Fixes: 9bdc79ea07d9 ("[media] fintek-cir: new driver for Fintek LPC SuperIO CIR function")
Cc: stable@vger.kernel.org
Assisted-by: LLM codeql
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
