Re: [PATCH v2] HID: rmi: fix OOB access with undersized RMI reports

From: Wei Jie Law

Date: Mon Aug 24 2026 - 08:41:00 EST


Superseded by v3:
https://lore.kernel.org/linux-input/20260824122708.76168-1-98lawweijie@xxxxxxxxx/

Please do not apply this version. It bails out of the read loop on a
zero-length reply without clearing RMI_READ_DATA_PENDING, and that flag
is what the wait at the top of the loop tests. Leaving it set makes
every later wait_event_timeout() return immediately on the stale reply,
so the four remaining retries of that call -- and every subsequent
rmi_hid_read_block() -- fail instantly with -EIO without ever waiting
for the device again. One zero-length reply from an otherwise honest
device is enough to kill the read path for the rest of the device's
life.

v3 clears the flag on that path.

Please mark this one superseded.

Thanks,
Wei Jie