From: sashiko-bot@kernel.org
To: "Kaustabh Chakraborty" <kauschluss@disroot.org>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org,
linux-input@vger.kernel.org, robh@kernel.org,
dmitry.torokhov@gmail.com
Subject: Re: [PATCH v2 2/5] Input: zinitix - do not ignore non-moving fingers
Date: Thu, 30 Jul 2026 19:58:46 +0000 [thread overview]
Message-ID: <20260730195847.2B4AA1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260731-zinitix-modes-v2-2-ffe2ec9a9031@disroot.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Device properties are read and validated after the input device has been registered, creating a race condition with userspace.
- [High] The driver allocates I2C transfer buffers on the stack, which violates DMA mapping rules and can cause memory corruption or panics.
--
--- Patch [2]: [PATCH v2 2/5] Input: zinitix - do not ignore non-moving fingers ---
commit 79b05b71b81ce17697cba617a5a5c777d1fe07a7
Author: Kaustabh Chakraborty <kauschluss@disroot.org>
Subject: Input: zinitix - do not ignore non-moving fingers
This commit fixes an issue where multitouch does not work reliably on the
ZT7548 touchscreen by no longer ignoring fingers that lack movement flags.
It ensures contacts with the SUB_BIT_EXIST flag are correctly processed in
zinitix_report_finger().
> diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c
> index 3421b8ffb19b2..a0a89d25e25bb 100644
> --- a/drivers/input/touchscreen/zinitix.c
> +++ b/drivers/input/touchscreen/zinitix.c
[ ... ]
> @@ -473,7 +473,7 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
> const struct point_coord *p = &touch_event.point_coord[i];
>
> /* Only process contacts that are actually reported */
> - if (p->sub_status & SUB_BIT_EXIST)
> + if (p->sub_status)
> zinitix_report_finger(bt541, i, p);
> }
>
[Severity: High]
This isn't a bug introduced by this patch, but does the interrupt handler
allocate I2C transfer buffers on the stack, potentially violating DMA
mapping constraints?
In zinitix_ts_irq_handler(), touch_event is declared on the stack and passed
directly down to the I2C subsystem:
drivers/input/touchscreen/zinitix.c:zinitix_ts_irq_handler() {
struct touch_event touch_event;
...
error = zinitix_read_data(bt541->client, ZINITIX_POINT_STATUS_REG,
&touch_event, sizeof(struct touch_event));
The helpers zinitix_read_data() and zinitix_write_u16() also allocate buffers
on the stack before passing them to i2c_master_send():
drivers/input/touchscreen/zinitix.c:zinitix_read_data() {
__le16 reg_le = cpu_to_le16(reg);
...
ret = i2c_master_send(client, (u8 *)®_le, sizeof(reg_le));
Could this cause memory corruption or silent DMA failures if the underlying
I2C adapter attempts to DMA-map these stack pointers?
[Severity: High]
This isn't a bug introduced by this patch, but is there a race condition
with userspace during the driver's probe?
The driver initializes and registers the input device, exposing it to
userspace, before finishing its property validation:
drivers/input/touchscreen/zinitix.c:zinitix_ts_probe() {
...
error = zinitix_init_input_dev(bt541);
// device is now registered and visible to userspace
...
error = device_property_read_u32(&client->dev, "zinitix,mode",
&bt541->zinitix_mode);
...
if (bt541->zinitix_mode != 2) {
dev_err(&client->dev,
"Malformed zinitix,mode property, must be 2 ...\n",
bt541->zinitix_mode);
return -EINVAL;
}
If userspace opens the device right after registration, zinitix_start()
could run with an uninitialized bt541->zinitix_mode, writing garbage to the
hardware.
Furthermore, if the probe fails due to a malformed mode property, the
already-exposed device will be abruptly destroyed while potentially in use.
Could the device properties be read and validated before calling
input_register_device() to ensure safe initialization?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260731-zinitix-modes-v2-0-ffe2ec9a9031@disroot.org?part=2
next prev parent reply other threads:[~2026-07-30 19:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 19:48 [PATCH v2 0/5] Support zinitix touch modes 0 and 1, dt changes to Galaxy J6 (j6lte) Kaustabh Chakraborty
2026-07-30 19:48 ` [PATCH v2 1/5] Input: zinitix - check all available fingers for every touch event Kaustabh Chakraborty
2026-07-30 19:59 ` sashiko-bot
2026-07-30 19:48 ` [PATCH v2 2/5] Input: zinitix - do not ignore non-moving fingers Kaustabh Chakraborty
2026-07-30 19:58 ` sashiko-bot [this message]
2026-07-30 19:48 ` [PATCH v2 3/5] Input: zinitix - add support for modes 0 and 1 Kaustabh Chakraborty
2026-07-30 20:00 ` sashiko-bot
2026-07-30 19:48 ` [PATCH v2 4/5] dt-bindings: input/ts/zinitix: document mode 0 Kaustabh Chakraborty
2026-07-30 19:56 ` sashiko-bot
2026-07-30 19:48 ` [PATCH v2 5/5] arm64: dts: exynos7870-j6lte: set mode 0 as default for zinitix touchscreen Kaustabh Chakraborty
2026-07-30 20:01 ` sashiko-bot
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=20260730195847.2B4AA1F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=kauschluss@disroot.org \
--cc=linux-input@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.