Linux Input/HID development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH 01/10] Input: synaptics-rmi4 - fix F55 transmitter electrode count typo
Date: Fri, 26 Jun 2026 05:31:00 +0000	[thread overview]
Message-ID: <20260626053100.C1C241F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260626051802.4033172-1-dmitry.torokhov@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [Medium] F55:Ctrl2 register array is read from an incorrect static offset, causing overlapping reads with the preceding F55:Ctrl1 register array.
--

commit b444f8759d3d03dbb87e0c3fd33dd8bdd2ff2bcf
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>

    Input: synaptics-rmi4 - fix F55 transmitter electrode count typo

    This commit fixes a typo during F55 sensor detection where the transmitter
    electrode count was incorrectly assigned the value of the receiver electrode
    count. The incorrect value was then propagated to the driver data and
    inflated the perceived TX count for F54, potentially leading to
    out-of-bounds buffer accesses.

> diff --git a/drivers/input/rmi4/rmi_f55.c b/drivers/input/rmi4/rmi_f55.c
> index 488adaca4dd00..a0877d32a9141 100644
> --- a/drivers/input/rmi4/rmi_f55.c
> +++ b/drivers/input/rmi4/rmi_f55.c
> @@ -54,10 +54,10 @@ static int rmi_f55_detect(struct rmi_function *fn)
>  	f55->num_tx_electrodes = f55->qry[F55_NUM_TX_OFFSET];
>  
>  	f55->cfg_num_rx_electrodes = f55->num_rx_electrodes;
> -	f55->cfg_num_tx_electrodes = f55->num_rx_electrodes;
> +	f55->cfg_num_tx_electrodes = f55->num_tx_electrodes;
>  
>  	drv_data->num_rx_electrodes = f55->cfg_num_rx_electrodes;
> -	drv_data->num_tx_electrodes = f55->cfg_num_rx_electrodes;
> +	drv_data->num_tx_electrodes = f55->cfg_num_tx_electrodes;
>  
>  	if (f55->qry[F55_PHYS_CHAR_OFFSET] & F55_CAP_SENSOR_ASSIGN) {
>  		int i, total;

[Severity: Medium]
This is a pre-existing issue, but I have a question about the offset used when
reading the F55:Ctrl2 register array.

Just below this hunk in rmi_f55_detect(), the code reads the transmitter
assignment array using a hardcoded +2 offset:

drivers/input/rmi4/rmi_f55.c:rmi_f55_detect() {
    ...
		error = rmi_read_block(fn->rmi_dev,
				       fn->fd.control_base_addr + 1,
				       buf, f55->num_rx_electrodes);
    ...
		error = rmi_read_block(fn->rmi_dev,
				       fn->fd.control_base_addr + 2,
				       buf, f55->num_tx_electrodes);
    ...
}

Will using a hardcoded +2 offset for Ctrl2 cause it to overlap with the Ctrl1
array if num_rx_electrodes > 1, or skip a byte if num_rx_electrodes == 0?

Should the offset dynamically account for the size of Ctrl1, such as using
control_base_addr + 1 + f55->num_rx_electrodes?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260626051802.4033172-1-dmitry.torokhov@gmail.com?part=1

      parent reply	other threads:[~2026-06-26  5:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26  5:17 [PATCH 01/10] Input: synaptics-rmi4 - fix F55 transmitter electrode count typo Dmitry Torokhov
2026-06-26  5:17 ` [PATCH 02/10] Input: synaptics-rmi4 - zero report size on F54 work error Dmitry Torokhov
2026-06-26  5:32   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 03/10] Input: synaptics-rmi4 - bound the F54 report size to the allocated buffer Dmitry Torokhov
2026-06-26  5:31   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 04/10] Input: synaptics-rmi4 - cancel delayed work on F54 remove Dmitry Torokhov
2026-06-26  5:28   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 05/10] Input: synaptics-rmi4 - block s_input when F54 queue is busy Dmitry Torokhov
2026-06-26  5:27   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 06/10] Input: synaptics-rmi4 - propagate F54 worker errors to V4L2 queue Dmitry Torokhov
2026-06-26  7:30   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 07/10] Input: synaptics-rmi4 - check V4L2 buffer size in F54 queue Dmitry Torokhov
2026-06-26  5:31   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 08/10] Input: synaptics-rmi4 - F54 style and typo fixes Dmitry Torokhov
2026-06-26  5:29   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 09/10] Input: synaptics-rmi4 - change report_size to size_t in F54 Dmitry Torokhov
2026-06-26  5:29   ` sashiko-bot
2026-06-26  5:17 ` [PATCH 10/10] Input: synaptics-rmi4 - use __le16 for FIFO offset " Dmitry Torokhov
2026-06-26  5:33   ` sashiko-bot
2026-06-26  5:31 ` sashiko-bot [this message]

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=20260626053100.C1C241F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox