From: Mark Brown <broonie@kernel.org>
To: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: open list <linux-kernel@vger.kernel.org>,
lkft-triage@lists.linaro.org,
Linux Regressions <regressions@lists.linux.dev>,
dri-devel@lists.freedesktop.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Danilo Krummrich <dakr@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Abdun Nihaal <abdun.nihaal@gmail.com>,
Dan Carpenter <dan.carpenter@linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
Anders Roxell <anders.roxell@linaro.org>,
Ben Copeland <benjamin.copeland@linaro.org>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: Re: next-20250702 kernel NULL pointer dereference adv7511_cec_register_volatile
Date: Wed, 9 Jul 2025 11:45:56 +0100 [thread overview]
Message-ID: <aG5IZBTJSabxpyct@finisterre.sirena.org.uk> (raw)
In-Reply-To: <CA+G9fYtvLHtjKbw-zpqGmtmBMgyJ0B8aiVwd8R=vRnj9YOZ3Xw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]
On Wed, Jul 09, 2025 at 01:26:02AM +0530, Naresh Kamboju wrote:
> I am investigating this issue,
> Planning to revert and re-build and test in a loop.
> c871c199accb3 regmap: fix potential memory leak of regmap_bus
> [ 11.087822] Call trace:
> [ 11.094930] adv7511_cec_register_volatile+0xc/0x30 adv7511 (P)
> [ 11.097194] regcache_read (drivers/base/regmap/regcache.c:273)
> [ 11.103438] _regmap_read (drivers/base/regmap/regmap.c:2805)
> [ 11.107084] regmap_read (drivers/base/regmap/regmap.c:2850)
This backtrace seems fishy, the function that's faulting is just doing a
straight lookup of the register number without reference to the supplied
device. This looks like a preexisting bug in the driver, we create an
I2C bus for the CEC in adv7511_init_cec_regmap() using a non-devm
function but register the interrupt handler using devm_request_threaded_irq()
and devm will free things after the remove function has run. This means
that on removal or error cleanup we free the I2C bus while the interrupt
is still registered but nothing stops the interrupt handler from
continuing to try to access the freed CEC bus. This is going to access
freed memory, I'm kind of surprised it wasn't already having trouble -
turning on some of the memory debugging options or sanitisers should
show issues.
Don't use devm_request_threaded_irq() folks...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2025-07-09 10:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 19:56 Naresh Kamboju
2025-07-09 10:45 ` Mark Brown [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=aG5IZBTJSabxpyct@finisterre.sirena.org.uk \
--to=broonie@kernel.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=abdun.nihaal@gmail.com \
--cc=anders.roxell@linaro.org \
--cc=andrzej.hajda@intel.com \
--cc=arnd@arndb.de \
--cc=benjamin.copeland@linaro.org \
--cc=dakr@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=lkft-triage@lists.linaro.org \
--cc=naresh.kamboju@linaro.org \
--cc=neil.armstrong@linaro.org \
--cc=rafael@kernel.org \
--cc=regressions@lists.linux.dev \
--cc=rfoss@kernel.org \
/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
all inboxes | Powered by JetHome®