From: Arnav Kapoor <kapoorarnav43@gmail.com>
To: Ayaan Mirza Baig <ayaanmirzabaig85@gmail.com>
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <bentiss@kernel.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Jonathan Cameron <jic23@kernel.org>, Lee Jones <lee@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Zheng Shuhao <viennaoffh@gmail.com>,
linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org,
syzbot+fb951970a334aaff00ba@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] HID: hid-sensor-hub: avoid lock inversion in sensor_hub_remove()
Date: Sat, 21 Nov 2026 02:33:16 +0530 [thread overview]
Message-ID: <20261120210317.184756-1-kapoorarnav43@gmail.com> (raw)
In-Reply-To: <20261120121256.35339-1-ayaanmirzabaig85@gmail.com>
On Fri, Nov 20, 2026 at 05:42:56PM +0530, Ayaan Mirza Baig wrote:
> Changes in v2:
> - Pass 'data' instead of NUL to device_for_each_child() so
> sensor_hub_finalize_pending_fn() does not dereference a NULL sd pointer.
...
> device_for_each_child(&hdev->dev, NULL,
> sensor_hub_finalize_pending_fn);
This line is still unchanged context in v2, so NULL is still passed and
the callback still does spin_lock_irqsave(&sd->lock, flags) on a NULL
sd. The diffstat (4 insertions, 3 deletions) matches that: the only
removed lines are the lock/unlock pair and the flags variable. Perhaps
the change didn't make it into the commit before git format-patch?
Separately, Zheng Shuhao posted a fix for the same syzbot report:
https://lore.kernel.org/all/20261120135005.566-1-viennaoffh@gmail.com/
It passes the hub data to the callback and also skips children without
platform_data (e.g. the HID battery power_supply child with
CONFIG_HID_BATTERY_STRENGTH=y), which would otherwise still be
dereferenced in sensor_hub_finalize_pending_fn(). It might be worth
agreeing between you which version goes forward.
Thanks,
Arnav
prev parent reply other threads:[~2026-11-20 21:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 12:12 [PATCH v2] HID: hid-sensor-hub: avoid lock inversion in sensor_hub_remove() Ayaan Mirza Baig
2026-11-20 12:21 ` sashiko-bot
2026-11-20 21:03 ` Arnav Kapoor [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=20261120210317.184756-1-kapoorarnav43@gmail.com \
--to=kapoorarnav43@gmail.com \
--cc=ayaanmirzabaig85@gmail.com \
--cc=bentiss@kernel.org \
--cc=heiko@sntech.de \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=lee@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=syzbot+fb951970a334aaff00ba@syzkaller.appspotmail.com \
--cc=viennaoffh@gmail.com \
/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