All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Zijun Hu <zijun_hu@icloud.com>
Cc: Saravana Kannan <saravanak@google.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Marc Zyngier <maz@kernel.org>,
	Stefan Wiehler <stefan.wiehler@nokia.com>,
	Grant Likely <grant.likely@linaro.org>,
	Tony Lindgren <tony@atomide.com>,
	Kumar Gala <galak@codeaurora.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Jamie Iles <jamie@jamieiles.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Zijun Hu <quic_zijuhu@quicinc.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH 4/8] of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one()
Date: Mon, 9 Dec 2024 15:19:16 -0600	[thread overview]
Message-ID: <20241209211916.GD938291-robh@kernel.org> (raw)
In-Reply-To: <20241209-of_irq_fix-v1-4-782f1419c8a1@quicinc.com>

On Mon, Dec 09, 2024 at 09:25:02PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> of_irq_parse_one() may use uninitialized variable @addr_len as shown below:
> 
> // @addr_len is uninitialized
> int addr_len;
> 
> // This operation does not touch @addr_len if it fails.
> addr = of_get_property(device, "reg", &addr_len);
> 
> // Use uninitialized @addr_len if the operation fails.
> if (addr_len > sizeof(addr_buf))
> 	addr_len = sizeof(addr_buf);
> 
> // Check the operation result here.
> if (addr)
> 	memcpy(addr_buf, addr, addr_len);
> 
> Fix by initializing @addr_len before the operation.
> 
> Fixes: b739dffa5d57 ("of/irq: Prevent device address out-of-bounds read in interrupt map walk")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
>  drivers/of/irq.c | 1 +
>  1 file changed, 1 insertion(+)

Applied, thanks.

Rob

  reply	other threads:[~2024-12-09 21:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 13:24 [PATCH 0/8] of/irq: fix bugs Zijun Hu
2024-12-09 13:24 ` [PATCH 1/8] of/irq: Fix wrong value of variable @len in of_irq_parse_imap_parent() Zijun Hu
2024-12-09 20:56   ` Rob Herring
2024-12-10 10:46     ` Zijun Hu
2024-12-09 13:25 ` [PATCH 2/8] of/irq: Correct element count for array @dummy_imask in API of_irq_parse_raw() Zijun Hu
2024-12-10 16:48   ` Rob Herring
2024-12-09 13:25 ` [PATCH 3/8] of/irq: Fix device node refcount leakage " Zijun Hu
2024-12-09 13:25 ` [PATCH 4/8] of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one() Zijun Hu
2024-12-09 21:19   ` Rob Herring [this message]
2024-12-09 13:25 ` [PATCH 5/8] of/irq: Fix device node refcount leakage " Zijun Hu
2024-12-09 13:25 ` [PATCH 6/8] of/irq: Fix device node refcount leakages in of_irq_count() Zijun Hu
2024-12-09 13:25 ` [PATCH 7/8] of/irq: Fix device node refcount leakages in of_irq_init() Zijun Hu
2024-12-09 13:25 ` [PATCH 8/8] of/irq: Fix device node refcount leakage in API irq_of_parse_and_map() Zijun Hu
2024-12-09 21:15 ` [PATCH 0/8] of/irq: fix bugs Rob Herring
2024-12-10 10:48   ` Zijun Hu

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=20241209211916.GD938291-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=Julia.Lawall@lip6.fr \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=grant.likely@secretlab.ca \
    --cc=jamie@jamieiles.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=maz@kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=rob.herring@calxeda.com \
    --cc=saravanak@google.com \
    --cc=stable@vger.kernel.org \
    --cc=stefan.wiehler@nokia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tony@atomide.com \
    --cc=zijun_hu@icloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.