From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458735; b=I8NJq/bLR4hOsc+EjdY9blKkzWy0/bPXaUBp0y0QyHdHOqw67N3bwlZjDFJZtKn4thLW ZD2A/7dGs4lPAQnEZh3ogB09k+jh8xJSVEeinrnTo0HhSWxuC26T5JEhVLw0dmrQX92Zr sbYWmvEPJ0MXPfyymjM20qWZC6r1G/BUiEuHjD9tFxW0+SxVsBSV/laSWr/NNLNTCMR8E BLrryAuoRkQ4ZBKP/S8QYaMJSTQ1ip3jw+BzZWpaaVztRKQFETDjq9BhLMWTgTqOrIAK0 W2HyxzL5XwxMtcT3SM/+ojof9L8bm8VWPqU2TiP3WkvERtTYCLpHt70LboX6Neag4VQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458735; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=9zegeB5gRRxUPqcdiHr7DadAbcfKhJYs6IujRNLISxk=; b=zxIIHeWaJoLdZeSN1w2JMPhT/K2xdK9HQ4sMNbVpliup80juZgTNYnpsANQ7/IU5t+gk aI1F5tZLjP3RkUJKqbK/tQohojjbeutiHHhmmRPH8G0iLf8apMFvHVVTIXySTlUWcIXtu T+mNqbmCAxLgi6wL7MJnnc8/3NvDH5p8RFTIRxU4n9xsud+OqKl6/Ac9Mk4mTNnwCnqPB K2JzSZy7WFu8nCQO5rvMENbBp0gmSnu5R3RVhedlNKguo4GGwg/0JS2D6P7ZBmdAHD7Oy 4Tki4slm7kWcxOZOQ0TeRsBQUdrD9Z+xEGqRU8DR2H0qOctcbNMU+Y3U0oP2dANcCgQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oT8hQM77; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91188606A31A; Mon, 23 Nov 2026 18:32:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oT8hQM77 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 014FF1F000E0; Mon, 23 Nov 2026 18:32:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458735; bh=9zegeB5gRRxUPqcdiHr7DadAbcfKhJYs6IujRNLISxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oT8hQM77uV3+RT6gMGqAYeZzzFo4iPPIJjZ72ab4Uh342bbVwMBA1bCLaLlP+ZR0P yh/Grf1XkOEg8Uemn1Wo+wDrSrTLHuOCR86Pzuip0bpQbG4YZ44iaKR4JTYzqDxZo4 mzGaEYi+GSAcEbwdAyvNTTHr4Ee9b+c2dW9ZAgM3kkhmmWw6hYXx60P4Eylr/0o0o/ pXI3L220HP5PY5QRaYdQkSmSN4Xj/+9rOqGar4zIa6fBWujqddevuA3ffusm0bzSXB g9HkAYw+XtQx9gFnxwKURGB6uwhQEgdUib2eYyjB5k3T00in9T2qkitSkI2o5qIBXp GnIwtuN+YBKYg== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Marek Vasut , Arnd Bergmann , Linus Walleij , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 01/10] Input: matrix_keypad - validate GPIO counts against matrix limits Date: Mon, 23 Nov 2026 18:31:07 +0000 Message-ID: <20261123183200.3900004-2-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" matrix_keypad_init_gpio() obtains the row and column GPIO counts via gpiod_count() and only checks for negative error codes before storing them in keypad->num_row_gpios and keypad->num_col_gpios. If firmware supplies more than MATRIX_MAX_ROWS (32) row GPIOs or MATRIX_MAX_COLS (32) column GPIOs, the setup loops write past the fixed row_gpios, col_gpios, and row_irqs arrays inside struct matrix_keypad, and matrix_keypad_scan() overflows the stack-allocated new_state array. Conversely, a zero count causes get_count_order() to return -1, leading to an undefined shift when computing row_shift. Reject non-positive GPIO counts as well as counts exceeding MATRIX_MAX_ROWS or MATRIX_MAX_COLS, and size col_gpios with MATRIX_MAX_COLS for consistency. Fixes: 584bf366f8fa ("Input: matrix_keypad - switch to gpiod API and generi= c device properties") Closes: https://sashiko.dev/#/bug/linux-ed4b89af-6c76-4e5f-b140-fb2b107b12d0 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/keyboard/matrix_keypad.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index 11018382e84e..c2f839a3de90 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -33,7 +33,7 @@ struct matrix_keypad { struct gpio_desc *row_gpios[MATRIX_MAX_ROWS]; unsigned int num_row_gpios; =20 - struct gpio_desc *col_gpios[MATRIX_MAX_ROWS]; + struct gpio_desc *col_gpios[MATRIX_MAX_COLS]; unsigned int num_col_gpios; =20 unsigned int row_irqs[MATRIX_MAX_ROWS]; @@ -302,11 +302,16 @@ static int matrix_keypad_init_gpio(struct platform_de= vice *pdev, =20 nrow =3D gpiod_count(&pdev->dev, "row"); ncol =3D gpiod_count(&pdev->dev, "col"); - if (nrow < 0 || ncol < 0) { + if (nrow <=3D 0 || ncol <=3D 0) { dev_err(&pdev->dev, "missing row or column GPIOs\n"); return -EINVAL; } =20 + if (nrow > MATRIX_MAX_ROWS || ncol > MATRIX_MAX_COLS) { + dev_err(&pdev->dev, "too many row or column GPIOs\n"); + return -EINVAL; + } + keypad->num_row_gpios =3D nrow; keypad->num_col_gpios =3D ncol; =20 --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458742; b=oMiAq3ibf75U0ZTWtt4BzzUQ/mRT5QwLgvdMOPhnavLM4P/g/GpO4vDET9L4D9cnnEnE etoMHcxjaY0btzd+4HAcgNC0cmEUiEXqncJIW+HHBejRgL6D+IN6UkXfK9MYnbQx3nxB5 jj/lfWz5eRFWL7XVni2/gC3q6LsYJTPaX2xteZlPnYLNiSFRkRRABf8zRbXFf4vIoxEWc xVAbwtZffhvef6Boj8VOtQgy4SgXI35sLhv+hjS/1VgnVngGUy43YzwQuaQGwKRu94P0/ ut21iTZDK7bMSc9AlJ35NzxpqyEYM9/yFWOXWpny3X4NS33EniMMK7z3iSi4cu0BeDg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458742; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=N3j0tMFhAaHpZ1oUDtj+e2ouvtQx8Dl5D+bVcC0aqr8=; b=5nTukzUv5V3OX7HfZiIJw+fwCxZefozHjeM4MthRaf5RSgT39YOuhW7e5ktfAxiABBo2 vJTrnuK8sigwChp5UYK/u4zXmuYd1yRGxfVLjVH7LOcp8aqFG3JwEk1Vgy/p+AgVg4pPo CcG/xvN551oN4ZB5l07REqMzBwTgZV4I3+2EpbaeK+JMhchAQ1BX/fjeUJMOyrCcOzvDm RkWE+8+W97EKmpN3oMCag7POJBvAVSFjzMj+ZaBOGJTAdPp50VG6sexRa1q2tYpo0HVwN Ui4Cf15/sqWXOiJVYoBW7M/Wi9eGGc/NVj4qeC9aeqrww3LRL0nVUgtAfc7bnc63B/Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MUsq0Isu; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71ADA606A31A; Mon, 23 Nov 2026 18:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MUsq0Isu Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDACB1F000D0; Mon, 23 Nov 2026 18:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458742; bh=N3j0tMFhAaHpZ1oUDtj+e2ouvtQx8Dl5D+bVcC0aqr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MUsq0Isu+TTIX6CBirD4XJ+gqjnwzZkTSyy/NtnhlI1Q9YlOY/lhySvARFcnG/Nso SZsFBFMKSYHGYaqJkO+89X8mVuq+jDjDfu/FxKTG6F9+swdFEe40TfVk0U/XI7UzPn HRH0nhrgUr+zNNzY5lSu5c2O2t36H5/TrY0Jm7FqFZ86jEleDHG7Uqaou8iFISgKhk 5d8n+9J7mHKA2v8BZcKhewK2bqxHgpQW0cQePEckrTenTo4Vpxv0oS3Q34vVpJSiM0 pV+TonIqNSNeiTOt22dPCnhcZPXGqf41+WCe6ZZOtJl3Tmp7JQV2um0/O9Op2rrYsZ h+WkrF+TMHq+w== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Sakari Ailus , Dudley Du , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 02/10] Input: cyapa - validate firmware image size in cyapa_pip_check_fw() Date: Mon, 23 Nov 2026 18:31:08 +0000 Message-ID: <20261123183200.3900004-3-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" cyapa_pip_check_fw() parses the firmware header, the trailing application integrity record, and the application rows without verifying that the supplied firmware buffer is large enough to hold them. A truncated firmware image smaller than struct cyapa_tsg_bin_image_head causes an out-of-bounds read in cyapa_pip_fw_head_check() and can underflow the unsigned size subtraction in cyapa_get_image_record_data_num(). An image containing a valid header but zero complete flash records causes image_records[flash_records_count - 1] to read before the start of fw->data. Finally, an image whose metadata specifies an app_len exceeding the available application records reads past the end of fw->data while computing app_crc. Validate the header size, ensure at least one flash record is present, and bound the application row count against the non-integrity record count before dereferencing image_records. Fixes: 5812d3067294 ("Input: cyapa - add gen5 trackpad firmware update supp= ort") Closes: https://sashiko.dev/#/bug/linux-cc76de59-950f-4e64-b49e-7605164e02a9 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/mouse/cyapa_gen5.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/input/mouse/cyapa_gen5.c b/drivers/input/mouse/cyapa_g= en5.c index 59f6e97d5482..bce8104f4149 100644 --- a/drivers/input/mouse/cyapa_gen5.c +++ b/drivers/input/mouse/cyapa_gen5.c @@ -1249,6 +1249,11 @@ int cyapa_pip_check_fw(struct cyapa *cyapa, const st= ruct firmware *fw) u16 app_integrity_crc; int i; =20 + if (fw->size < sizeof(struct cyapa_tsg_bin_image_head)) { + dev_err(dev, "%s: firmware image is too small.\n", __func__); + return -EINVAL; + } + /* Verify the firmware image not miss-used for Gen5 and Gen6. */ if (cyapa_pip_fw_head_check(cyapa, (struct cyapa_tsg_bin_image_head *)fw->data)) { @@ -1259,6 +1264,11 @@ int cyapa_pip_check_fw(struct cyapa *cyapa, const st= ruct firmware *fw) =20 image_records =3D cyapa_get_image_record_data_num(fw, &flash_records_count); + if (flash_records_count <=3D 0) { + dev_err(dev, "%s: firmware image has no flash records.\n", + __func__); + return -EINVAL; + } =20 /* * APP_INTEGRITY row is always the last row block, @@ -1295,6 +1305,11 @@ int cyapa_pip_check_fw(struct cyapa *cyapa, const st= ruct firmware *fw) return -EINVAL; } =20 + if (fw_app_len / CYAPA_TSG_FW_ROW_SIZE > flash_records_count - 1) { + dev_err(dev, "%s: invalid firmware app length.\n", __func__); + return -EINVAL; + } + /* Verify application image CRC. */ app_crc =3D 0xffffU; for (i =3D 0; i < fw_app_len / CYAPA_TSG_FW_ROW_SIZE; i++) { --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458749; b=DD5tHhyEuj2DA3K5hJcXBUoCvkXSUdKEfJND0mTSptSzcKHdMwJSJsii/MXBidBko3MG JBsXCqFPL6iiNYSrwa4Roiv/rpFhNZKPzv08nKrYYScpWLi7YFysKfgB3jMbbPvZmqrOF laQ6WMXul+w4qBFMfjKTnxixGwU71+hpMGH/Lm4E74XeWij6go+HN2TmK1lr4tqKR2QSC 9QUH9tkqVP7mWl1hEdQPJXDT+2Yw10agZQMmPEL9Zz28o/YKNieT7/AA1YoVG67jS7HsR u13+Ecrz0rWvB3ZMVv+Uw90AKmhBzgjsnRGvkoCxEPimPewgWVyJ0q7bAHI+I3vSF2Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458749; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=HixZivlW5EbPj0EUn/UCMLuXWIHadDmuB9x5A36DekI=; b=IJQOX5Mq5UMUzenvwvguvRpO7ZHUD8FQlK6GnLCVt48BloXh7B9eMnfYnhs6WXco8JfA brkNl3FhyI8jsWiA4y3fadHYAO1RGuTxn/KAUYQiDRfsqoQvwDzawRA0qjHpznBaHlNx7 A7eO3ZcHWXSrx7x1vLmv3tABcL6/Lf6DVtfAwr98l+5ZNrg9PNSQz1kGUAwiQNXNn7PUb f9ZIeS/4dhc3Dk4dZW//qb1/n4B2YiyIXvK+zI7FGMT/HnFEAVY5umAsaKll4s7530MDH 9Xf0FDb0o8MabZnJlqrnhOk2akUj7h40GQgXTmgURmxFaT79A6LWknI7pNMWXU6wAMQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="jnSmY1/x"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2745B606A332; Mon, 23 Nov 2026 18:32:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jnSmY1/x Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B2E61F000C6; Mon, 23 Nov 2026 18:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458748; bh=HixZivlW5EbPj0EUn/UCMLuXWIHadDmuB9x5A36DekI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jnSmY1/x1+84MH89QxsJGXB2k6SwdJXZkWHbJaZkW1t1CX7gzIwV5KcX9/TyPIn05 qbcUD4OWwV/tKFmejTH9CiCk/IZ2S71Ynu+9Y5V/uQMvkteB0AMkQgd9LcOYDS6I/y aDhlO7PSCnbJU3yhdUcyx1psPhwL0xfQPAvPCjZ8eWzjyFNVfKHtKl2uZOTadmRwgV eKhWgMij3sICFESCl+vx6vGvJQg2Iu7xuiaj9MpShk+itYxlW6bLJyIBl8OXXNTmXS BHOpo8k+Rw/MDHy0kO/4z4FYdM+UqehuQLGTHZjJ224/JbxgEz6H0UumA0hGOtBkUq ojnvAdqKwwmkg== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Pawel Zalewski , =?UTF-8?q?Ronald=20Tschal=C3=A4r?= , Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 03/10] Input: applespi - cancel touchpad registration work on removal Date: Mon, 23 Nov 2026 18:31:09 +0000 Message-ID: <20261123183200.3900004-4-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" applespi_probe() allocates its driver state with devm_kzalloc_obj() and initiates an asynchronous touchpad information query whose completion schedules applespi->work to allocate and register the managed touchpad input device in applespi_worker(). applespi_remove() disables the ACPI GPE and drains in-flight SPI writes and reads, but never cancels applespi->work. If a touchpad info response scheduled applespi->work just before applespi_drain_reads() completed, applespi_worker() can run during or after devres teardown, corrupting the device resource list via devm_input_allocate_device() and dereferencing freed driver data. Cancel applespi->work synchronously after applespi_drain_reads(), once no further SPI responses can schedule it. Fixes: 038b1a05eae6 ("Input: add Apple SPI keyboard and trackpad driver") Closes: https://sashiko.dev/#/bug/linux-bb2fd773-6c20-468c-a092-6814f008077f Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/keyboard/applespi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/app= lespi.c index 96c504f28495..d964cd3ee5af 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1819,6 +1819,7 @@ static void applespi_remove(struct spi_device *spi) device_wakeup_disable(&spi->dev); =20 applespi_drain_reads(applespi); + cancel_work_sync(&applespi->work); =20 debugfs_remove_recursive(applespi->debugfs_root); } --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458755; b=E3Qd6hFBJLMV5NM4X12AvGVUvUsOyrsG8v48yOXDso+TRZAv8+74SVHoGBOlM2OfNBd7 Yh9OO2nMMujhq3HmLwJvjL/uuJUdEHzuDh71K1KXpeqBA8KFDxwXNYN1+XgAhMf+H0BSb DRvep4W47xc0v0emuLyWosFRMATX0qNilOK5Ta44rolo6MBBIrtljqj+iqf2OZddZR2KR QPHwZn/7zSzXDz8ywMJd4wzO/kO4lW+10aZaKeMFWGgfOq0iyPiFHKmIn73VDc1Itg6CU OfhscE+xouZ9cnGHQlKIMUrLcWqVrXJI+Vb4lYCjl8zfszRX8FcaFXQFPa2hcTevlQw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458755; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=HvJ80RgiDHHiWONrDSVjrqusDm9p88+K6dsNBXZazvM=; b=cwp4zxHfwhaDpBfG6+JMBJHPcfGgYpslbNf9Ms9Os4trsmpRv75YvX4i3XsGQJDiolWf DLpFJC2CQTczC1VOWciFvARFvetHh7/BpPxA+OlOEnxJJWWLcntrMhqw9YGLp2SS8OKfN +OR9V7JIId6wKZPBImlrboOcqBEy6nuhlXtW2GSLCmuCb80GfVtqQKC6CGW5GxDVEYag+ f0qFi/UvnSRELgkKNlQoNH4lIVDGXkUwgNkHDMWE1tHDaT1ZRToy7+v9Rosk9maTbnAPO vcTUX6xKRcSNnTjYjohYgrCV1lC7Wx8vq6mCzG4bXV3YVI4CQ7aYHL6KcmIi5hyVjsA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bnPlwgCN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76E85606A31A; Mon, 23 Nov 2026 18:32:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bnPlwgCN Received: by smtp.kernel.org (Postfix) with ESMTPSA id 253941F000C6; Mon, 23 Nov 2026 18:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458755; bh=HvJ80RgiDHHiWONrDSVjrqusDm9p88+K6dsNBXZazvM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bnPlwgCNnlCPPvDKZU0SgfAT842VHn7NUEof9RII8AZbVTcW1humtg3170nXIhPro 6ftzYqsrEeKch24esZJ16cpHuGv4kvZaPt+IFheC6xjW65ToiaYLmFFPTexTf4/jAU CXR6jSqqYn4ycrXiVYr/y5xcwwoQgV8PBAQhfly0qhq3XwkkKMHWdQ4E591r8rPGye 6+Za9Vo1/wg5z/j9/a3YzTzE6pRrUNeoS0wlqpjJiWyG+HMNMKwPlifXYu/mACMy7R JKKqXkO7EhTjwkGDewo9E2joSaNm9Oe6aHqIiPEMUlMZK6h8ONlqKRhMUv3aYk/p6m awdJJxF/wcpOQ== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Marek Vasut , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 04/10] Input: matrix_keypad - only stop and start active device across sleep Date: Mon, 23 Nov 2026 18:31:10 +0000 Message-ID: <20261123183200.3900004-5-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" matrix_keypad_suspend() and matrix_keypad_resume() unconditionally call matrix_keypad_stop() and matrix_keypad_start() without holding input_dev->mutex or checking whether the input device is active. When the keypad has no open users (or is inhibited), row interrupts are already disabled and keypad->stopped is true. Suspending calls disable_row_irqs() a second time, unbalancing the IRQ disable depth, and resuming clears keypad->stopped and schedules keypad->work. If the device is subsequently unbound while still unopened, Input core skips the close callback (matrix_keypad_stop()) during unregistration, leaving keypad->work pending or running after devres frees struct matrix_keypad. Acquire input_dev->mutex in both sleep callbacks and only stop or start scanning when input_device_enabled() is true. Fixes: 7d0f351da460 ("Input: matrix_keypad - switch to using managed resour= ces") Closes: https://sashiko.dev/#/bug/linux-340f2a74-becb-415d-b1c2-6da8f05a8bd8 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/keyboard/matrix_keypad.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboar= d/matrix_keypad.c index c2f839a3de90..81507e2a6126 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -268,7 +268,10 @@ static int matrix_keypad_suspend(struct device *dev) struct platform_device *pdev =3D to_platform_device(dev); struct matrix_keypad *keypad =3D platform_get_drvdata(pdev); =20 - matrix_keypad_stop(keypad->input_dev); + guard(mutex)(&keypad->input_dev->mutex); + + if (input_device_enabled(keypad->input_dev)) + matrix_keypad_stop(keypad->input_dev); =20 if (device_may_wakeup(&pdev->dev)) matrix_keypad_enable_wakeup(keypad); @@ -281,10 +284,13 @@ static int matrix_keypad_resume(struct device *dev) struct platform_device *pdev =3D to_platform_device(dev); struct matrix_keypad *keypad =3D platform_get_drvdata(pdev); =20 + guard(mutex)(&keypad->input_dev->mutex); + if (device_may_wakeup(&pdev->dev)) matrix_keypad_disable_wakeup(keypad); =20 - matrix_keypad_start(keypad->input_dev); + if (input_device_enabled(keypad->input_dev)) + matrix_keypad_start(keypad->input_dev); =20 return 0; } --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458761; b=IU2B6IBk46ETrqOT2/bE6fwATAx+lNh3MF/sylRP77dtR5QB6UpDYg/opJQgJKiB1Xk3 v2jLuow7h59bkqsXxB7V6iT2YbZ4AIfu+sVMf3+nZFrHYr5OIcSlG0S9v/uF6ER9NCDs5 gjfxjoCkjRz+WocEXXMk4yTuXolhDMGwA1JiasIutQwiMkFGF/zYhN2yFM7cGXzO3ehDE 97CZra+j+oXlgvUDzeqy3A4RqGzWyiBJ0jhvURD7zZb5dsnbZLb/OLxIDArgRa6XO1U3f fG0Xe45opAdvvgPNRf5L4u0V5412lCZYmfu65v2WtA69VwK/Op/FZCLv7Ov7L9+o75g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458761; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=ZvOaChR5qJW9QxRGc38ZD60Y8kBGkcLpTHhpADdCCRM=; b=Ml4hoEKgmLJUh14PzJsh6i3vo587F8nqUnmDTKiUxRm/ocC28QW+ucGe4utMugluez+I i6ZKLx26A3uZxh8LI+Hi1CTO5RQoDfD7dQd1pgvYwFTgaTp/In2Vz8jL3xDkINlwzvpey 7Qc6QPWPetVDdSVlZq1skg/GGo7ti7Z3p3uKwYstG2dMUk7wsAbHBEfYtaaFJyk1PBnaG ZzG9LiP5EMbxvl37ToFcF474M9eO6klbEKxpZE7QWiRuOheWkqgynxFYyiJuePPzsY+9H Z8O1oY/ih/sz3rSjJYoR2U6Bitcen451bYQ8V9daqaMpmQjOw2q+YIq1tgCNoz6tWCA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y62II9IL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93085606A681; Mon, 23 Nov 2026 18:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Y62II9IL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A6571F000C0; Mon, 23 Nov 2026 18:32:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458761; bh=ZvOaChR5qJW9QxRGc38ZD60Y8kBGkcLpTHhpADdCCRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Y62II9ILA3rN3No3O6m5eWsc4cqBw6I17lR0XMhB4mPbY+o9smCMNRy+QaDbn6qfq Lg5kSnFhk8u2oI0d8XhAXaRfFk/2KbuUL5aNKQSTCRd2lCiIpSypF7iFctu5FiAFr2 EnlbEkjqPcrPOrKGVvbPx/BBvsHHKvlpraAMO8a/PZ7IvLOj86gsxx9HpAK+QGbxYo mfjo8hvryUyTXxlOJu+B+/v6b0P1y0fS0pyqyTfYY5nAAEZsr3/zSUsgeF+xX/4btW 3PBBRrFPEsNhov37l/B5KKeleDpfuwjfLCrhgQtoVD4D9Pvj5izdjqcO2Vn4l+WxJr hXTUXbX0pWFDQ== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Vojtech Pavlik , Greg Kroah-Hartman , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 05/10] Input: stinger - zero-initialise driver state in stinger_connect() Date: Mon, 23 Nov 2026 18:31:11 +0000 Message-ID: <20261123183200.3900004-6-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" stinger_connect() allocates struct stinger with kmalloc_obj() without initialising the signed packet index stinger->idx. When serial bytes arrive in stinger_interrupt(), negative values of stinger->idx pass the stinger->idx < STINGER_MAX_LENGTH check and cause stinger->data[stinger->idx++] to write before the start of stinger->data on the heap, corrupting stinger->dev or adjacent slab memory. Initial values of 4 or greater never match the stinger->idx =3D=3D 4 reset check and permanently wedge packet assembly. Allocate struct stinger with kzalloc_obj() so stinger->idx and the packet buffer start zeroed. Fixes: 17dd3f0f7aa7 ("[PATCH] drivers/input/joystick: convert to dynamic in= put_dev allocation") Closes: https://sashiko.dev/#/bug/linux-bad333c0-5b62-4ca5-ad93-204400bcba3a Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/joystick/stinger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stin= ger.c index 011f9b137dca..021216f811c0 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c @@ -118,7 +118,7 @@ static int stinger_connect(struct serio *serio, struct = serio_driver *drv) struct input_dev *input_dev; int err =3D -ENOMEM; =20 - stinger =3D kmalloc_obj(*stinger); + stinger =3D kzalloc_obj(*stinger); input_dev =3D input_allocate_device(); if (!stinger || !input_dev) goto fail1; --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458768; b=BOaYf2iM1vY86yWyp2P/LM2TtcsBZj0TB/t6U9kaShZfbDUooYhNmKcxcFgjl6c4kGya rmcqBkzRZ5Nro91xHf0DjWb0RYugA9DqbYT/qbrgmAoKsqBtUwCk2UI5YV6gnw0mXCc7R deDm8ACdQAsdHdXIXwbQYkww4td6PyisRLgfcf2KZnqZTQQE1TZ7Z109uwIdgoWVwlsZm j14HeMMkhiUo1smD1HUST3Kjp5V70nGiHWS13zoy5937TU9NZJw34bP605LEpwhddOdm/ XIZWgzJleU25rqX+3MyEtxqg2XgmRmY99RM6nEb+cXBGPLq4JQByMyonvRjPFOQGHeg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458768; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=3ncvdCiD+I++psXwF99QZqk8+VbB3yg3sCWIKX61dB4=; b=ZwXrwbwqpfsVSiXHUZRtHH68VgFiOVSGdZ6HCMJ52kLidSDWUlGH5dXzaqVsoyOc6jKy heK3/4j00yRVMqFPaZfnKTX3+gmZ7y2u3OwUm8T6O4ZtFiq2TMOOrHHxawavYLSUoNF00 liPwiqnqbsByIshxJTxz3twsvIPISvssaUlClewTiqcEaF/DUoV3sbQXidr/eBy4FRTQ7 R4xcYU036FtDTmqd6/CTereUg9vavuH5r+5x30il/n07UnoS6IE7YixYqKByzB39Wtt8U z91BB7gUlX/ZX6L2FghWS4HkmDUx/0sTcz5GfRjSKvUCfDmM4KZ+SU8BzKp/3PMrnAA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JrbHt3Yg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45068606A32A; Mon, 23 Nov 2026 18:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JrbHt3Yg Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7B821F000CA; Mon, 23 Nov 2026 18:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458768; bh=3ncvdCiD+I++psXwF99QZqk8+VbB3yg3sCWIKX61dB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JrbHt3YgkiFXdHbQbhoUtMmRC3ygFVXXkJa6hGAzLYU0bE25BLp3vA98Y5ou5yOGg oW1Cp3uS0YpSO6Lae6X25eKn91VmG0RbiXaArp/1yFltT8USqqBQyfEpGxfV4EqbM+ cqPq8SepfOYcseRSo1bThZp1m6cp32gqFqX7zYbjiqhkaTWxHAglK92O42D2xHNQM7 RVQofOX6Jmwd1crBs1yaC9bDsMS2wjmItgvXYDBgqTgwRuD81CFVlwZoJdjY7DFh+Z VrduTueN7J1KCxaUakkbzRkF1y9GhxC9F4gzcPb8JM3g4z1wCqTwjPB/ipxM4M2Pv2 xRsunEgQIZuYw== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Benjamin Tissoires , Andrew Duggan , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 06/10] Input: synaptics-rmi4 - check for NULL drvdata in rmi_set_attn_data() Date: Mon, 23 Nov 2026 18:31:12 +0000 Message-ID: <20261123183200.3900004-7-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Transport drivers such as hid-rmi remain registered and continue delivering attention reports via rmi_set_attn_data() even if the physical RMI driver failed to probe rmi_dev or was unbound via sysfs. When rmi_dev is unbound, dev_get_drvdata(&rmi_dev->dev) returns NULL and rmi_set_attn_data() dereferences drvdata->enabled in interrupt context. Check that drvdata is non-NULL before accessing drvdata->enabled, matching rmi_process_interrupt_requests(), rmi_driver_suspend(), and rmi_driver_resume(). Fixes: b908d3cd812a ("Input: synaptics-rmi4 - allow to add attention data") Closes: https://sashiko.dev/#/bug/linux-0165ea80-0dcb-4d48-96cf-e2c1532199a0 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/rmi4/rmi_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_drive= r.c index 7bbe9e801c35..5053c1edad6f 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -172,7 +172,7 @@ void rmi_set_attn_data(struct rmi_device *rmi_dev, unsi= gned long irq_status, struct rmi4_attn_data attn_data; void *fifo_data; =20 - if (!drvdata->enabled) + if (!drvdata || !drvdata->enabled) return; =20 fifo_data =3D kmemdup(data, size, GFP_ATOMIC); --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458774; b=1yon2jVlRk+FUfR29jq2Igsb8Fni9rXjLr9Q5k/tr8sNzDFGkvvBf7ZiIZb/U/Cm7M+H 51GVeTx2dqZk6FmZwchZbGBI6xOl0xsIgpR8JQL7gkjbuBpSwGp8HUWa9jyYWK6rjTV6R bOpjzYKYAOcGCP57AMi+U5CpZdDPO8C9fD/ry3xxrBbd6hj8ZuSHCi51oISPhknMp24mp j8sq6lzi+NILQGtYIo1YAowjjTUAb3KiPWaUBlgEeJNH4l9wDaatTXZQa91eSb9ZgvVLT Z2/N4lNrAYz0M+QVAa2Ce3HvdHdjYqJtO/1JobAjQWDHsWYJI9EIdT945vKptZFNpXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458774; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=XvFGxLtguxADkoKymBc4jGtX4rfLze4pZj3zugD9AMY=; b=eKdY9zQN/pvodlTB3m+ssCTo2PqNb/RTOkCCNFM+RDiPDpVwU9KeU/1CpWIGRduQB8Ur ejwj8/mS2hNqO5Vg40PPvnK5x4gtsdHNrPdd129L3lLP/MgvsThgGJHFQW/IrGNEMGLi9 FEzBkNOIFgdqf5ngnbE7KFwncIhklGdV+EJWtLa4apCP57B7Eb36edhRbLPuuUF+haI4N 5A8DBM5xMAbhLoLhbTN84dVxIXaKjWB/8zE88mhAPSCeynuG4aZHyZSbCVZXDnKOnzq7W Hd0JeAPO87eDcHZxWCjV2WKvMlYoWr2Y+YIriPm8l+8ObIhDIgFh2GU5rhMkyUuNRNw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JuN1uIXn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C12D8606A327; Mon, 23 Nov 2026 18:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JuN1uIXn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A4981F000CA; Mon, 23 Nov 2026 18:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458774; bh=XvFGxLtguxADkoKymBc4jGtX4rfLze4pZj3zugD9AMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JuN1uIXnBnO8/GBhDEUrU5UMuHjv6fW5KpCiabBadiozzUwU95Y12NiJkCjrqhVDj j3GbqaWhJcejoIWFAdsavobczXdi4HraO85KvVoLBjI77C7SvQM9/u1InKSKZOJFR0 4ASQaeqzLTbQPFDe8iVkM7dHlodPJdjR19uVJiA8t7XV/nPdNLujurFqPrCWuj2E1D 2/JZpjSl6tHmZ9c/lDahMvGdEDJCJok3YeQnd2J2i7Oz1F3tVFzX8rsdXAtHiMiOXE tj6E70ZycrLtmjqw8XinLn0WJ5gmyhX3ELi4RZ6xryEsDtuo1Q8F68LH25zq8zYKvE IUcP10ygTTtpg== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Chen-Yu Tsai , Carlo Caione , Hans de Goede , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 07/10] Input: axp20x-pek - skip IRQ handling during sleep without input device Date: Mon, 23 Nov 2026 18:31:13 +0000 Message-ID: <20261123183200.3900004-8-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Cherry Trail systems where an ACPI GPIO button device already handles the power button, axp20x_pek_should_register_input() returns false and axp20x_pek_probe() skips axp20x_pek_probe_input_device(). This leaves axp20x_pek->input NULL and both irq_dbr and irq_dbf zero-initialised. axp20x_pek_suspend() and axp20x_pek_resume() nevertheless pass irq_dbf and irq_dbr unconditionally to disable_irq(), enable_irq(), and their wakeup counterparts, manipulating IRQ 0 (the legacy x86 system timer) across suspend and resume. Skip interrupt management in axp20x_pek_suspend() and axp20x_pek_resume() when no input device was registered. Fixes: 8a78050ee257 ("Input: axp20x-pek - revert "always register interrupt= handlers" change") Closes: https://sashiko.dev/#/bug/linux-5ae6851f-784e-481c-900b-2e1686578c89 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/misc/axp20x-pek.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pe= k.c index cbbc9db33ad2..a02cdabcf22b 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c @@ -329,6 +329,9 @@ static int axp20x_pek_suspend(struct device *dev) { struct axp20x_pek *axp20x_pek =3D dev_get_drvdata(dev); =20 + if (!axp20x_pek->input) + return 0; + /* * As nested threaded IRQs are not automatically disabled during * suspend, we must explicitly disable non-wakeup IRQs. @@ -348,6 +351,9 @@ static int axp20x_pek_resume(struct device *dev) { struct axp20x_pek *axp20x_pek =3D dev_get_drvdata(dev); =20 + if (!axp20x_pek->input) + return 0; + if (device_may_wakeup(dev)) { disable_irq_wake(axp20x_pek->irq_dbf); disable_irq_wake(axp20x_pek->irq_dbr); --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458782; b=BjgIy/xln/pz6fJPdnp4Ckwrw5TDzFMjeSWBBs1K51iAaEzyGcWDelQdcDmx3ykVfbOe uN8uYcr+WLqu5qSYVnkKgqYS2ow/7lVdtcwJbkLJESuODWPMQDioQ91DfDM0iAC9Da7MW E7+zxy1XTJxNbR4y9gMdolX+dQVTbNlr8cvXAmicFI4RWe4F8zh3jQFzI0t/0vdfnvjfg mVokpDMBLkowv6jMvRyeWqV1SSoIqe3k/eOcg7yvSNyVp8hNzzmRyhnbu3QJfZvxyUXDP DzBC4AgQcd4NsvRmyXBinqzITBvE9aIkcgpZMWOr1AmflAZ4eEZaNhIN+5Oqh5LNBmw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458782; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=U1MSPx3VfyoIifR48nEATYANkG7RJJfwnA8zIXFxovA=; b=Tft08Z24JTMFUC1vHCN0tb8UZz9e0U8AQNcihl/BBMLfcYBAk1Cr4UIFFpmAPalWa/b+ Ey0kKvlxZGwjGRzQFpowuJQpGxUnzLxI0vahME3QFJY8xQleESwfu+aZj9eZP8pCndXm7 Ws+8U9Rj2ov3okDaCvaRYjbdHp2ucr0z755Lt0CyUxnNPa52uTJloGJUSAXaJ/0ILGFt0 /V/aKkdNNmmFt7qnxBgXCFLS7e+akRgoY0zd2eHNdbGGpytrJ0A/jeUH2bMxDjWRHOd0/ q7yItvVN9V04Gcv/Fbbion3GYELBaVVOSjhreQRCG4ovy2tjpqp7pkCKx/6PCZ8r3fQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YxHbG4Qj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38D74606A31A; Mon, 23 Nov 2026 18:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=YxHbG4Qj Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD83A1F000C4; Mon, 23 Nov 2026 18:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458781; bh=U1MSPx3VfyoIifR48nEATYANkG7RJJfwnA8zIXFxovA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YxHbG4QjoBEKcii62/p3xWuNgfK5sV5ywr53zd7ByLM327S1//TTe0j61atw+hNzP l7BX91cdgPODL6eKAUZQIVWJ38hyog4Ez9fGDgucWrQY2CtQs6kAaLKM1ZBUaKHbMM hjZKaJ7mWvsJ6q9tjUZ/OhkFr3eR+w0qVmHkKs446j4jx/OyJsGm3ObXtf6fGRPwOq +clCPN8Hhd9YZPplHL3Dvo6XSCQdBJH4gkeiHV5HTZyEfq7zJV1JSVc7yHLHdQI8d/ 56nHAguwU8BaPBUeddkHI/PvGvdrgLLUqP7h2HtqaJawFEolx0h9wrSqggaeD+TKZu xeuwW0rqFxbwA== From: Lee Jones To: lee@kernel.org, Mattijs Korpershoek , Dmitry Torokhov , Matthias Brugger , AngeloGioacchino Del Regno , Fengping Yu , Marco Felsch , Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: stable@vger.kernel.org Subject: [PATCH 08/10] Input: mt6779-keypad - enable keypad clock before programming registers Date: Mon, 23 Nov 2026 18:31:14 +0000 Message-ID: <20261123183200.3900004-9-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" mt6779_keypad_pdrv_probe() writes the debounce and matrix selection registers over MMIO before acquiring and enabling the "kpd" clock via devm_clk_get_enabled(). When the keypad clock is gated off at boot or its clock provider defers probe, accessing unclocked keypad MMIO registers can trigger a bus abort or silently drop the configuration writes. Acquire and enable the "kpd" clock before accessing the keypad registers. Fixes: f28af984e771 ("Input: mt6779-keypad - add MediaTek keypad driver") Closes: https://sashiko.dev/#/bug/linux-fc15622a-407a-48b2-88db-195cdb311dbf Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/keyboard/mt6779-keypad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboar= d/mt6779-keypad.c index 60e6ad97cf59..a9f62f02439e 100644 --- a/drivers/input/keyboard/mt6779-keypad.c +++ b/drivers/input/keyboard/mt6779-keypad.c @@ -195,6 +195,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_de= vice *pdev) =20 input_set_capability(keypad->input_dev, EV_MSC, MSC_SCAN); =20 + keypad->clk =3D devm_clk_get_enabled(&pdev->dev, "kpd"); + if (IS_ERR(keypad->clk)) + return PTR_ERR(keypad->clk); + regmap_write(keypad->regmap, MTK_KPD_DEBOUNCE, (debounce * (1 << 5)) & MTK_KPD_DEBOUNCE_MASK); =20 @@ -208,10 +212,6 @@ static int mt6779_keypad_pdrv_probe(struct platform_de= vice *pdev) regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_COL, MTK_KPD_SEL_COLMASK(keypad->n_cols)); =20 - keypad->clk =3D devm_clk_get_enabled(&pdev->dev, "kpd"); - if (IS_ERR(keypad->clk)) - return PTR_ERR(keypad->clk); - irq =3D platform_get_irq(pdev, 0); if (irq < 0) return irq; --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458788; b=ySEVFDX+5FOl3Rxa6TnTovzKahc+23RTeeKYRBck2THaRThgSxDa5tCoUY1LsZpja7xS JTtp67rh9ONJ5waj9itg+kthIAKn8LUP5goeR7TWve7qXPWn4B6Q2Dxciy4sO4N1Iac7K ysuzgeyDQeIm2tir2Ig8wQenWu6t6J1DA+U/4emMzfOZLd7BAhxfXozGDtGWyX6t+zWB/ To8XK4Y8m97Vfukn9PCWgBohesK5FDIbU+fEG+R8W8TBQMd0GNpnQ91+bZK1Z0qxIAYww anXBA/7QOh1JcEAuhtZofX7/8UhiqYK4a3c6y82H1X9GF3UN7qXD29TanVsguznA//g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458788; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=ewYq6AIbBNsZwelrKkc+xEBWvdNQGiW8QGnMZ/P338c=; b=sRoa/o0BVRwvbbM2sy4sjPrMhgUeIMHHkpuxGUddPwgwy+Zc0KY6jAq4cBkgxKQ2tBT+ 5/nWgw36n73b9e+a8y8tuZDbt+f24/nsvJPs1HAhAvxHPAH0fnP1e899cCYF/WEZcgW+Z 0MqN1//YlV9k47UG+/m8jXI+o+uZjru5H1sX6OZ2cJN/AyhHvd7PBRjf/S1EIn8eHtZmw JMY/Kkpw7yXzP0O4UbUOgA0B9bgq+6WHVLc9JtZrwamHIK6d1iXo2PAKz0eZ4Xf4H0d2s 1GlvBJnth6ThmkwaIgbl0uGvj7FpIuGHhoVZ+RIM9HfY8D+d63In1xStACgavLmPw4w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Fw7itiBg; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBE54606A31E; Mon, 23 Nov 2026 18:33:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Fw7itiBg Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8A0F1F000D0; Mon, 23 Nov 2026 18:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458788; bh=ewYq6AIbBNsZwelrKkc+xEBWvdNQGiW8QGnMZ/P338c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Fw7itiBg/4bO92QnraKYawehunCcURbXpYI8xwE3yAPUKnCymsO+c7wqPvekvu/FH QRsa3SuEy5qWyRBZFUu2ngPhFOXEBJ3V8shSI0Pm0+0O0t1M6tWzjra+ew6kYXMUss AzTUGdYiGPDGYkA107w9LQRufO9ClVLMxZem4AAI2eQ2A1aWbpYl7Dm1Cv/tWBhlgR QqqVyiOqkzcQ/aH4HboaGQ3arG5lQ4x9NSrI0IFlC2vB6wqXeJXkshWSQ5SDcPsh1U 3FMVEz8IErCqJHyVS6QuiulX6+spYk3bEgjXoB0oqucrANSyhFZqU8hcPDdl8cyhyN 2Ke/j7qswIVdw== From: Lee Jones To: lee@kernel.org, Samuel Holland , Dmitry Torokhov , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= , Danilo Krummrich , Bjorn Helgaas , Takashi Sakamoto , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 09/10] Input: pinephone-keyboard - request IRQ before registering input device Date: Mon, 23 Nov 2026 18:31:15 +0000 Message-ID: <20261123183200.3900004-10-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ppkb_probe() registers ppkb->input before installing its threaded interrupt handler with devm_request_threaded_irq(). As soon as input_register_device() exposes the keyboard (including synchronous open by the console keyboard handler), ppkb_open() enables matrix scanning. If a key is held during this window, the controller asserts its level-triggered interrupt line before the handler is registered, causing the kernel to disable the unhandled IRQ. In addition, devres unwinds in reverse order on unbind, freeing the IRQ handler before input unregistration invokes ppkb_close() to disable scanning. Request the threaded IRQ before calling input_register_device() so the handler is in place before scanning can be enabled and outlives input unregistration on teardown. Fixes: 17406967ec0f ("Input: pinephone-keyboard - add PinePhone keyboard dr= iver") Closes: https://sashiko.dev/#/bug/linux-f24d8390-cd48-42d7-a3ea-c075b69c127a Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/keyboard/pinephone-keyboard.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/ke= yboard/pinephone-keyboard.c index b4a02ade3a80..fdf2c270bacd 100644 --- a/drivers/input/keyboard/pinephone-keyboard.c +++ b/drivers/input/keyboard/pinephone-keyboard.c @@ -412,12 +412,6 @@ static int ppkb_probe(struct i2c_client *client) return error; } =20 - error =3D input_register_device(ppkb->input); - if (error) { - dev_err(dev, "Failed to register input: %d\n", error); - return error; - } - error =3D devm_request_threaded_irq(dev, client->irq, NULL, ppkb_irq_thread, IRQF_ONESHOT, client->name, client); @@ -426,6 +420,12 @@ static int ppkb_probe(struct i2c_client *client) return error; } =20 + error =3D input_register_device(ppkb->input); + if (error) { + dev_err(dev, "Failed to register input: %d\n", error); + return error; + } + return 0; } =20 --=20 2.56.1.750.gf70dc682cf-goog From nobody Tue Nov 24 11:35:50 2026 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795458795; b=SWk4oWM2G/eY5eUJEiJ7REwPNKCOZ+ZzPluSIAFqjHQjEZZCvd9KtM2Xcbq+VoN6ivuJ qsdt11mN/NrKO6RD994WdTCEXmj6OyJHIUDqlDTtqrOZNX561VN3iyN/sB1NAjQq9nFJC SQ7yDCIRsgE6CS5+dmutEVL+bp3hZ54ST6/rVSKkneQ+n/LbREPhVSBmiUiHsV7b9C7hl RT4wW/Fv3/KDBZgh0IeIqmRvY85t7nVPyyGdcPzG7nol4CaW7u8UNRWgHr2wCkRZWxtWQ QjcKsSvQ5TwB39vnmePJacVRqfw+lXolGFNosOjQDQgeGrsH6EBxMKRyHJgghOo2ELQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795458795; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=k/vvoWLU9b5SxPTSJ6QaYudpiRsLaOpf788XZvWh2s4=; b=bkB4aPDA78Iz+JDeCyrVTynyupT0nknnbB65QbwsXscSWTYHPGt+jwkPge70avNF+u3X 0kV2b0Frc78e37o4tH9UG4t3hPXfYO9NCOT6QItqYGoJKpLtzjmWVO9bUIskGIqNCu83r xUjmkDiiG8atfb3STZ662+wKfPgggPKfAEjvZTFO3Crye5wOXYMeKtNxX9lbGI9Pob/du nq0YOU9K1p3eEf6XpVAclfv7dtCiCYfkspKMB8RakJUg7mit6AxqLI0sMQcHYAsJxCdP/ O2pIyY0rtKC67HmYloZaRhJRRJJIN+++Fm7QYV1XxNj1uBdn8Pfib99FzqzqlIOmxFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hRaYdGJV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14BC3606A335; Mon, 23 Nov 2026 18:33:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hRaYdGJV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6714A1F000D2; Mon, 23 Nov 2026 18:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795458794; bh=k/vvoWLU9b5SxPTSJ6QaYudpiRsLaOpf788XZvWh2s4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hRaYdGJVVUOE5MXG3UXMmA9NOzLtrpn6IBrCBE/cElmoA55keTqMDjjVYCLuLwwMp qJI1Glt/7M/CYqHbCsorn+fPldDHf8A/GsmaYm6+safgRB29bxY6TU/WcZtf8izgvA 1eLx265/YqmZMPEZ1qZYwOO9LIswtJm4EhkqBlHnk0q2nJU7VPx9WDPque7dqNQHQc jr4DJ9pw9Ai99YJun6N4LHfnFmrqdNoSaBPOmJWWaOFrlalcohoKgfS1c543Oi7Psp +jfuWUUiZsXAWa+ZwYi1jNKQJcCIyVWNYq/LR7Jt4979Gt96SnCA83jNLZI46GZU5v ydA/+tSYUBFaQ== From: Lee Jones To: lee@kernel.org, Dmitry Torokhov , Ian Bridges , "Cheng, Wacom" , Jaya Kumar , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH 10/10] Input: wacom_w8001 - use reinit_completion() in w8001_command() Date: Mon, 23 Nov 2026 18:31:16 +0000 Message-ID: <20261123183200.3900004-11-lee@kernel.org> X-Mailer: git-send-email 2.56.1.831.g720f3f5937-goog In-Reply-To: <20261123183200.3900004-1-lee@kernel.org> References: <20261123183200.3900004-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" w8001->cmd_done is already initialised in w8001_connect() before opening the serio port, yet w8001_command() calls init_completion() again for each command. Calling init_completion() on an active completion reinitialises its internal waitqueue spinlock, triggering lockdep warnings and racing with complete() in w8001_interrupt() if a late response to a previously timed-out command arrives concurrently. Use reinit_completion() in w8001_command() instead. Fixes: 3eb1aa43ef5c ("Input: add support for Wacom W8001 penabled serial to= uchscreen") Closes: https://sashiko.dev/#/bug/linux-002efaac-c345-4827-8f1c-7b9d9226c713 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/input/touchscreen/wacom_w8001.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchs= creen/wacom_w8001.c index d8d1cdc3f09e..a85ef93bdd29 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -362,7 +362,7 @@ static int w8001_command(struct w8001 *w8001, unsigned = char command, int rc; =20 w8001->response_type =3D 0; - init_completion(&w8001->cmd_done); + reinit_completion(&w8001->cmd_done); =20 rc =3D serio_write(w8001->serio, command); if (rc =3D=3D 0 && wait_response) { --=20 2.56.1.750.gf70dc682cf-goog