* [PATCH 00/10] Input: Fix OOB writes, UAFs, NULL derefs, and suspend work bugs (batch 2)
@ 2026-11-27 20:09 Lee Jones
2026-11-27 20:09 ` [PATCH 05/10] Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status sysfs Lee Jones
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2026-11-27 20:09 UTC (permalink / raw)
To: lee
Cc: linux-kernel, Pierre-Loup A. Griffais,
Uwe Kleine-König (The Capable Hub), Adam Buchbinder,
Alexandre Torgue, Andi Shyti, Anthony Liguori, Christoph Fritz,
Dan Murphy, David Heidelberg, Dmitry Torokhov, Dominic Cerquetti,
Elliot Tester, Franz Lehner, Greg Kroah-Hartman,
Griffin Kroah-Hartman, Hans de Goede, Ivan Hawkes, Jan Kratochvil,
Javier Martinez Canillas, Jeff LaBundy, Jens Reidel,
Juergen Gross, linux-arm-kernel, linux-input, linux-stm32,
Marko Friedemann, Markus Armbruster, Maxime Coquelin,
Neil Armstrong, Oleksandr Andrushchenko, Oliver Schwartz,
Pavel Rojtberg, Rob Herring, Steven Toth, Vojtech Pavlik
These issues were reported by Sashiko.
This is batch 2 of Input bug fixes, based on input/next. It addresses
out-of-bounds accesses and underflows in adi, probe and unbind work
UAFs in xpad and aw86927, sysfs information disclosure in stmfts,
NULL dereferences in xen-kbdfront and goodix_berlin, SPI transfer size
underflow in goodix_berlin_spi, and suspend work stopping in drv2665
and drv2667.
Cc: "Pierre-Loup A. Griffais" <pgriffais@valvesoftware.com>
Cc: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Andi Shyti <andi@etezian.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Christoph Fritz <chf.fritz@googlemail.com>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: David Heidelberg <david@ixit.cz>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Dominic Cerquetti <binary1230@yahoo.com>
Cc: Elliot Tester <elliotctester@gmail.com>
Cc: Franz Lehner <franz@caos.at>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Griffin Kroah-Hartman <griffin.kroah@fairphone.com>
Cc: Hans de Goede <hansg@kernel.org>
Cc: Ivan Hawkes <blackhawk@ivanhawkes.com>
Cc: Jan Kratochvil <honza@jikos.cz>
Cc: Javier Martinez Canillas <javier@osg.samsung.com>
Cc: Jeff LaBundy <jeff@labundy.com>
Cc: Jens Reidel <adrian@mainlining.org>
Cc: Juergen Gross <jgross@suse.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-input@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: Marko Friedemann <mfr@bmx-chemnitz.de>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: Oliver Schwartz <Oliver.Schwartz@gmx.de>
Cc: Pavel Rojtberg <rojtberg@gmail.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Steven Toth <steve@toth.demon.co.uk>
Cc: Vojtech Pavlik <vojtech@ucw.cz>
Lee Jones (10):
Input: adi - prevent off-by-one write in adi_read_packet()
Input: adi - validate axis and button counts in adi_id_decode()
Input: xpad - cancel presence work on xpad360w_start_input() failure
Input: aw86927 - use devm_work_autocancel() for haptics play work
Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status
sysfs
Input: xen-kbdfront - check info->ptr and info->kbd before
dereferencing
Input: drv2665 - disable haptics work across suspend and resume
Input: drv2667 - disable haptics work across suspend and resume
Input: goodix_berlin_i2c - check i2c_get_match_data() for NULL
Input: goodix_berlin_spi - validate ic_data and SPI max transfer size
drivers/input/joystick/adi.c | 45 ++++++++++++++++++-
drivers/input/joystick/xpad.c | 6 ++-
drivers/input/misc/aw86927.c | 6 ++-
drivers/input/misc/drv2665.c | 15 ++++---
drivers/input/misc/drv2667.c | 15 ++++---
drivers/input/misc/xen-kbdfront.c | 7 +--
drivers/input/touchscreen/goodix_berlin_i2c.c | 3 ++
drivers/input/touchscreen/goodix_berlin_spi.c | 6 +++
drivers/input/touchscreen/stmfts.c | 5 ++-
9 files changed, 88 insertions(+), 20 deletions(-)
--
2.56.1.839.g22a8290db9-goog
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 05/10] Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status sysfs
2026-11-27 20:09 [PATCH 00/10] Input: Fix OOB writes, UAFs, NULL derefs, and suspend work bugs (batch 2) Lee Jones
@ 2026-11-27 20:09 ` Lee Jones
2026-11-27 20:35 ` David Heidelberg
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2026-11-27 20:09 UTC (permalink / raw)
To: lee, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue,
David Heidelberg, Andi Shyti, Rob Herring,
Javier Martinez Canillas, linux-input, linux-stm32,
linux-arm-kernel, linux-kernel
Cc: stable
i2c_smbus_read_i2c_block_data() returns the positive byte count on
success or a negative error code on failure. stmfts_sysfs_read_status()
checks if (err) and returns err directly, so a normal 4-byte read
returns 4 without formatting buf (exposing unpopulated sysfs buffer
bytes), while a 0-byte read formats uninitialised stack memory.
Return negative errors immediately and require sizeof(status) bytes to
be read, matching stmfts_read_system_info().
Fixes: 78bcac7b2ae1 ("Input: add support for the STMicroelectronics FingerTip touchscreen")
Closes: https://sashiko.dev/#/bug/linux-bd87edf0-6f79-4318-8780-d69205787e7d
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/input/touchscreen/stmfts.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index 2054c2254947..aada03f96940 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -699,9 +699,12 @@ static ssize_t stmfts_sysfs_read_status(struct device *dev,
err = i2c_smbus_read_i2c_block_data(sdata->client, STMFTS_READ_STATUS,
sizeof(status), status);
- if (err)
+ if (err < 0)
return err;
+ if (err != sizeof(status))
+ return -EIO;
+
return sysfs_emit(buf, "%#02x\n", status[0]);
}
--
2.56.1.839.g22a8290db9-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 05/10] Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status sysfs
2026-11-27 20:09 ` [PATCH 05/10] Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status sysfs Lee Jones
@ 2026-11-27 20:35 ` David Heidelberg
0 siblings, 0 replies; 3+ messages in thread
From: David Heidelberg @ 2026-11-27 20:35 UTC (permalink / raw)
To: Lee Jones, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue,
Andi Shyti, Rob Herring, Javier Martinez Canillas, linux-input,
linux-stm32, linux-arm-kernel, linux-kernel
Cc: stable
On 27/11/2026 21:09, Lee Jones wrote:
> i2c_smbus_read_i2c_block_data() returns the positive byte count on
> success or a negative error code on failure. stmfts_sysfs_read_status()
> checks if (err) and returns err directly, so a normal 4-byte read
> returns 4 without formatting buf (exposing unpopulated sysfs buffer
> bytes), while a 0-byte read formats uninitialised stack memory.
>
> Return negative errors immediately and require sizeof(status) bytes to
> be read, matching stmfts_read_system_info().
>
> Fixes: 78bcac7b2ae1 ("Input: add support for the STMicroelectronics FingerTip touchscreen")
> Closes: https://sashiko.dev/#/bug/linux-bd87edf0-6f79-4318-8780-d69205787e7d
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>
> ---
> drivers/input/touchscreen/stmfts.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
> index 2054c2254947..aada03f96940 100644
> --- a/drivers/input/touchscreen/stmfts.c
> +++ b/drivers/input/touchscreen/stmfts.c
> @@ -699,9 +699,12 @@ static ssize_t stmfts_sysfs_read_status(struct device *dev,
>
> err = i2c_smbus_read_i2c_block_data(sdata->client, STMFTS_READ_STATUS,
> sizeof(status), status);
> - if (err)
> + if (err < 0)
> return err;
>
> + if (err != sizeof(status))
> + return -EIO;
> +
> return sysfs_emit(buf, "%#02x\n", status[0]);
> }
>
Reviewed-by: David Heidelberg <david@ixit.cz>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-27 20:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 20:09 [PATCH 00/10] Input: Fix OOB writes, UAFs, NULL derefs, and suspend work bugs (batch 2) Lee Jones
2026-11-27 20:09 ` [PATCH 05/10] Input: stmfts - fix i2c_smbus_read_i2c_block_data() check in status sysfs Lee Jones
2026-11-27 20:35 ` David Heidelberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox