From: Greg KH <gregkh@linuxfoundation.org>
To: Sajja Easwar Sai <eshwarsajja20@gmail.com>
Cc: sakari.ailus@linux.intel.com, bingbu.cao@intel.com,
tian.shu.qiu@intel.com, mchehab@kernel.org, yong.zhi@intel.com,
tfiga@chromium.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
iryuken@duck.com
Subject: Re: [PATCH] staging: media: ipu3: fix out-of-bounds access in imgu_map_node()
Date: Wed, 22 Apr 2026 08:27:52 +0200 [thread overview]
Message-ID: <2026042201-appear-unsubtly-1d76@gregkh> (raw)
In-Reply-To: <20260422061951.352746-1-eshwarsajja20@gmail.com>
On Wed, Apr 22, 2026 at 11:49:51AM +0530, Sajja Easwar Sai wrote:
> imgu_map_node() walks imgu_node_map[] looking for a CSS queue ID. When
> no match is found the loop exits with i == IMGU_NODE_NUM, which is one
> past the end of every array that is indexed by node id. The value is
> returned without any bounds check, so callers that use it immediately
> as an array subscript produce out-of-bounds reads.
>
> The most critical caller is the threaded IRQ handler
> imgu_isr_threaded(), where b->queue comes directly from firmware; a
> malformed or buggy firmware return could therefore trigger a kernel
> oops.
>
> Harden the code in three steps:
> 1. Add a WARN_ON() inside imgu_map_node() so the 'not-found' sentinel
> is made explicit and any future regression surfaces immediately.
And then you just rebooted the machine, causing all data to be lost when
panic-on-warn is enabled :(
If this condition can be hit, then great, handle it properly and
recover, please do not crash machines. WARN_ON() should not be used for
anything that a user can ever cause to have happen.
thanks,
greg k-h
next prev parent reply other threads:[~2026-04-22 6:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 6:19 [PATCH] staging: media: ipu3: fix out-of-bounds access in imgu_map_node() Sajja Easwar Sai
2026-04-22 6:27 ` Greg KH [this message]
2026-04-22 6:38 ` Sakari Ailus
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=2026042201-appear-unsubtly-1d76@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=bingbu.cao@intel.com \
--cc=eshwarsajja20@gmail.com \
--cc=iryuken@duck.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tfiga@chromium.org \
--cc=tian.shu.qiu@intel.com \
--cc=yong.zhi@intel.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