From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: dmitry.torokhov@gmail.com, kees@kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: penmount: bound packet buffer indices in IRQ path
Date: Mon, 23 Mar 2026 15:32:09 +0200 [thread overview]
Message-ID: <acFA2aNGcdI_y9IS@ashevche-desk.local> (raw)
In-Reply-To: <20260323121715.74954-1-pengpeng@iscas.ac.cn>
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
next prev parent reply other threads:[~2026-03-23 13:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 12:17 [PATCH] Input: penmount: bound packet buffer indices in IRQ path Pengpeng Hou
2026-03-23 13:32 ` Andy Shevchenko [this message]
2026-03-24 2:29 ` Pengpeng Hou
2026-03-24 12:11 ` Andy Shevchenko
2026-03-24 13:14 ` [PATCH v2] " Pengpeng Hou
2026-03-24 13:47 ` Andy Shevchenko
2026-03-25 1:36 ` Dmitry Torokhov
2026-03-25 1:46 ` Pengpeng Hou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acFA2aNGcdI_y9IS@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=kees@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pengpeng@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox