Re: [PATCH] Input: penmount: bound packet buffer indices in IRQ path
From: Andy Shevchenko
Date: Mon Mar 23 2026 - 09:43:56 EST
On Mon, Mar 23, 2026 at 08:17:15PM +0800, Pengpeng Hou wrote:
> The IRQ handler stores each incoming byte into pm->data[] before the
> packet parser gets a chance to reset pm->idx. If the incoming serial
> stream never matches one of the expected packet headers, pm->idx can
> advance past the fixed receive buffer and the next IRQ will write beyond
> PM_MAX_LENGTH.
How did you find the issue? Any assistance?
> Reset stale indices before writing the next byte so malformed packet
> streams cannot walk past the end of the local packet buffer.
Why do you think this is the best possible approach? Maybe we should
simply ignore IRQ or handle it without any further actions?
--
With Best Regards,
Andy Shevchenko