From nobody Mon Jun 8 09:48:09 2026 Received: from mail-dy1-f177.google.com (mail-dy1-f177.google.com [74.125.82.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD02D13635E for ; Sat, 30 May 2026 05:40:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780119660; cv=none; b=adZ6agb2jT4pa113RVGz1bKxdU7YugRWJGx+pwNWfDNrpl2pvqLI6kCnaYnVhN0BT1RkIwPzExRUgYx5I1Dq+B5GoSd21+T+Jq2upQA5X/Q0M+f0sennqY2GKb0PeiFJGFXHA6aRpK7+SLNh5a/eIEeD81SKJb4QrmCWxzfDsGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780119660; c=relaxed/simple; bh=PpUoBid5aq59q45iKmTD4IwHC+evK9Uyzay1vXekoKM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=JW0bToW0MgykNhbGN5t1glLuiqorxM+iBzvOigNEyc7ZDmIWZtUdHFfNAtUA9Sra2y7O0ooNRGHOnbS6Mz90uajA0zWQNLpOgqQkkRwLr4c7lQnw0vxOiAxl7AkYxHMdGPUiXM5om9dIzuplcbYc35XniUgMUC37qXPaxbJhSbo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yld85XzQ; arc=none smtp.client-ip=74.125.82.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yld85XzQ" Received: by mail-dy1-f177.google.com with SMTP id 5a478bee46e88-304cf518c9dso4043356eec.1 for ; Fri, 29 May 2026 22:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780119657; x=1780724457; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=XOZEgRCT5xBH4jATksg2PfnmFltwzZ3oN1tTfeEAMhM=; b=Yld85XzQS4OYQkKOnjk6STeitfFYMKeGr4Y7L6tLfkasZ/TDjK1psfjPP/WoOvx9K2 2QcQkKAy2BSxP6bU1npxpJBcz7m3/nUDlLUZ5wxQC/rAz9YCY26z+PSClR2QBXTsHzfo mkqtyJdq0EorWSSPMsUM5Qzzsaa2fzRta59ytZAjV0dozZ/8JdleIuks7+MS2k8Vmg9P CfSmbdhJx1yRXfm+6qNOPZcpwZcAv0cIObI9NbgGu9wGPfabpdkcTuFUahK2zxlucNJ8 oaQ3h8uZDFBKF3wEDSWUjLl0MaSyjBjw8lvvsUbQSGV+3jVYLVXjAlVQHDcaoe+ZgiGG XPdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780119657; x=1780724457; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XOZEgRCT5xBH4jATksg2PfnmFltwzZ3oN1tTfeEAMhM=; b=SsCtc2jMQlram2ZdZxWVlAP5buGck2e8G9CUVq2sIp8JyrwDnj2hRB1TbqAqpP7mNJ +IQeU/0ElOmEgPNgehb0axMfwYhi8Kct/OYHsO1YUme9TaBEvXj3KkwBzpkQXJ7+h9rW p4e33vGd5P16W2P9my5ilwHlhhjM3zZDw4mZJQpOobc706LEhVcWC4kDnBEZkmO/IpqV t7jLTTTXCL6/7cPNOVBpxOZ7B/xkddrHJLQJDuzCdCwKTC6d2EbnBpi+oZ8C7razUB/I daF8nTjg9tqTFpk5tyjNMsSjtGN4Q4f7qWHNvWyl0GLH4G2IG8+5+Kd50TTlMJqfuphl dV+g== X-Gm-Message-State: AOJu0YzBVgCYXb9UObW9u9H4CEf+uXtDni5CVua00liwnd+6t8JM3yKM nEK4zLQhpdsnhhsmBkv4/ZpGWsBHPUnYaxs871z5vhsY95jv2CU6f0/n X-Gm-Gg: Acq92OHQdqz2l0tByCqH9ZMbuRiXPcKF/nPJtqWuLUmDU49uxsTnT7AH/M0pHxfqKtx hTr36F3lmupxZXGMS24965aqb3vy0f55+d3ANpA/c0dj8s36g23B4irXiBdAm1fn8uDJdRoZ+Na QjsDBRWzGxFMxTyu7P7DMkPnELThoebmi6GKsRW94F7lO6UT5lhaVhDo9OepMRoY5bScfqF59TT M3y3jzWGMOkRXyW3sre9a8sDxS1dRfONPziv7ye4f6VNp/yPXIzfIqW5MofQmH0vayrUc2Px7Bm xJIAt1WR4WFu1skA+Ci1JK3A6pzx9FAJy4j97FwkDFnOAMi4YYrPKcsD2hTo0wZhrgMentoPVuM hlm0hE8fH7KBBnx95zBqMh/VrtqCwpy9mVHOd01fzWGRwnPJ41Bf2P/jInSmHtG3XnbCGXHmKU5 PIFHHSKwO+Lm9ltUfmvjcbH5j7WFHGAbeKQLqQGnNsAjLH5J1kwT/Zca9mTT96Qx/6ZMDLNbJOe ju6wNYKeGRW+w== X-Received: by 2002:a05:7300:214c:b0:2de:aafb:feff with SMTP id 5a478bee46e88-304fa4a93bamr1369797eec.2.1780119656653; Fri, 29 May 2026 22:40:56 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:307d:2a52:8823:4a01]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-304ed2bdda4sm3009912eec.2.2026.05.29.22.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 22:40:55 -0700 (PDT) Date: Fri, 29 May 2026 22:40:52 -0700 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] Input: ims-pcu - only expose sysfs attributes on control interface Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the driver was converted to use the driver core to instantiate device attributes (via .dev_groups in the usb_driver structure), the attributes started appearing on all interfaces bound to the driver. Since the ims-pcu driver manually claims the secondary data interface during probe, the driver core automatically creates the sysfs attributes for that interface as well. However, the driver only supports these attributes on the primary control interface. Data interfaces lack the necessary descriptors and internal state to handle these requests, and accessing them can lead to unexpected behavior or crashes. Fix this by updating the is_visible() callbacks for both the main and OFN attribute groups to verify that the interface being accessed is indeed the control interface. Fixes: 204d18a7a0c6 ("Input: ims-pcu - use driver core to instantiate devic= e attributes") Cc: stable@vger.kernel.org Reported-by: Sashiko bot Assisted-by: Gemini:gemini-3.1-pro Signed-off-by: Dmitry Torokhov --- drivers/input/misc/ims-pcu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 13367ec66936..ddfb88b7c8f5 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c @@ -1283,6 +1283,9 @@ static umode_t ims_pcu_is_attr_visible(struct kobject= *kobj, struct ims_pcu *pcu =3D usb_get_intfdata(intf); umode_t mode =3D attr->mode; =20 + if (intf !=3D pcu->ctrl_intf) + return 0; + if (pcu->bootloader_mode) { if (attr !=3D &dev_attr_update_firmware_status.attr && attr !=3D &dev_attr_update_firmware.attr && @@ -1534,6 +1537,9 @@ static umode_t ims_pcu_ofn_is_attr_visible(struct kob= ject *kobj, struct ims_pcu *pcu =3D usb_get_intfdata(intf); umode_t mode =3D attr->mode; =20 + if (intf !=3D pcu->ctrl_intf) + return 0; + /* * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor. */ --=20 2.54.0.823.g6e5bcc1fc9-goog --=20 Dmitry