From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8B363B47D5; Wed, 23 Sep 2026 14:30:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173853; cv=none; b=tNrXBiKnH9uReLTQP42qcp5jBr9CXWTT1sj30IjzI6vyfV1LESxiMjqw4mOuVkqIbQuVbfk9QIQHtrvyQRX0raPsBpqqarcgjNvc1rf/4QxLjIsd6V1gMPi0v5EGzNBo2p9iqFTjImUDI3N1E33Z4mEcP8K4s3z6xYse0LvgbBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790173853; c=relaxed/simple; bh=cSlIeDeQYlz1y3cgo6XFb7mOMJgmO1PRD0mLLF7ZoNE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=seipbccaERIwyxKhSPB7vsVPwLsuqg6HEvyBQoYPJvldVn8U4fr/EINswOxcGoQHP9B++aYF2MbUGXhO8Fl2PrEgO0VavpXzTv/+3OpHiG5xnBF7Zn1emJBDU2/nUQdXePFkEwVj/nwqIy++RY9eDEVyz4uGVbDZ4TOuZf9KXhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K8NmNZTg; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K8NmNZTg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D4E01F000FF; Wed, 23 Sep 2026 14:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790173851; bh=DsTP/eEouBKJeTlQ5YpWJ/1Gk/3dc5YVI1u+dlIy7kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=K8NmNZTgHnicc5P17Ub2hOFZPA6vFkDclb3keo2ESN3CE+ioiAqGUrLfvM407s0Wy jdwFjg/YdMcM5VFMfb87vKDJ1wRdS1J5uSrLRGopAMbYTH7p+K3YaQUuD4BPpKo1US f2mLA+991mqPdIjOL7SuiKmH0iHYKo7neGCGUHkw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+09103639e39c989e3ed3@syzkaller.appspotmail.com, Dmitry Torokhov Subject: [PATCH 7.2 363/438] Input: synaptics-rmi4 - fix GPF in suspend and resume when unbound Date: Wed, 23 Sep 2026 16:06:24 +0200 Message-ID: <20260923140654.263498268@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260923140644.756254324@linuxfoundation.org> References: <20260923140644.756254324@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit fe10579b6dc3f0dac61e51e1797cacbba5039ac2 upstream. Transport drivers (such as rmi_i2c and rmi_spi) invoke rmi_driver_suspend() and rmi_driver_resume() on their child rmi_dev device during system power management events. However, transport drivers are fully registered and operational even if the physical RMI driver failed to bind or probe the rmi_dev device. When rmi_driver_suspend() or rmi_driver_resume() is called on an unbound rmi_dev, dev_get_drvdata() returns NULL. Calling rmi_disable_irq() or rmi_enable_irq() without driver data attached causes a NULL pointer dereference and General Protection Fault when attempting to lock data->enabled_mutex. Fix this by checking if driver data is attached to rmi_dev in rmi_driver_suspend() and rmi_driver_resume(), exiting early if no driver data is present. Fixes: 2b6a321da9a2 ("Input: synaptics-rmi4 - add support for Synaptics RMI4 devices") Reported-by: syzbot+09103639e39c989e3ed3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=09103639e39c989e3ed3 Cc: stable@vger.kernel.org Assisted-by: LLM Link: https://patch.msgid.link/anQe8UiyUR4x0flD@google.com Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/rmi4/rmi_driver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -991,6 +991,15 @@ int rmi_driver_suspend(struct rmi_device { int retval; + /* + * Transport driver will try to suspend RMI device even if physical + * driver did not bind to the RMI device, because transport device + * (I2C, SPI) is fully registered and operational. Exit early if + * there is no driver data attached to the RMI device. + */ + if (!dev_get_drvdata(&rmi_dev->dev)) + return 0; + retval = rmi_suspend_functions(rmi_dev); if (retval) dev_warn(&rmi_dev->dev, "Failed to suspend functions: %d\n", @@ -1005,6 +1014,10 @@ int rmi_driver_resume(struct rmi_device { int retval; + /* Skip if not fully bound to RMI driver */ + if (!dev_get_drvdata(&rmi_dev->dev)) + return 0; + rmi_enable_irq(rmi_dev, clear_wake); retval = rmi_resume_functions(rmi_dev);