From: Will Deacon <will.deacon@arm.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Patrick Bellasi <patrick.bellasi@arm.com>,
linux-acpi@vger.kernel.org, Hanjun Guo <hanjun.guo@linaro.org>,
Sudeep Holla <sudeep.holla@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value
Date: Fri, 30 Nov 2018 13:21:03 +0000 [thread overview]
Message-ID: <20181130132102.GC9000@arm.com> (raw)
In-Reply-To: <20181129095559.26007-1-lorenzo.pieralisi@arm.com>
On Thu, Nov 29, 2018 at 09:55:59AM +0000, Lorenzo Pieralisi wrote:
> Running the Clang static analyzer on IORT code detected the following
> error:
>
> Logic error: Branch condition evaluates to a garbage value
>
> in
>
> iort_get_platform_device_domain()
>
> If the named component associated with a given device has no IORT
> mappings, iort_get_platform_device_domain() exits its MSI mapping loop
> with msi_parent pointer containing garbage, which can lead to erroneous
> code path execution.
>
> Initialize the msi_parent pointer, fixing the bug.
>
> Fixes: d4f54a186667 ("ACPI: platform: setup MSI domain for ACPI based
> platform device")
> Reported-by: Patrick Bellasi <patrick.bellasi@arm.com>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Hanjun Guo <hanjun.guo@linaro.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> ---
> drivers/acpi/arm64/iort.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Will Deacon <will.deacon@arm.com>
Looks like one for 4.20.
Will
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 2a361e22d38d..70f4e80b9246 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -700,7 +700,7 @@ static void iort_set_device_domain(struct device *dev,
> */
> static struct irq_domain *iort_get_platform_device_domain(struct device *dev)
> {
> - struct acpi_iort_node *node, *msi_parent;
> + struct acpi_iort_node *node, *msi_parent = NULL;
> struct fwnode_handle *iort_fwnode;
> struct acpi_iort_its_group *its;
> int i;
> --
> 2.19.2
>
prev parent reply other threads:[~2018-11-30 13:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 9:55 [PATCH] ACPI/IORT: Fix iort_get_platform_device_domain() uninitialized pointer value Lorenzo Pieralisi
2018-11-29 11:34 ` Hanjun Guo
2018-11-29 16:49 ` Lorenzo Pieralisi
2018-11-30 13:21 ` Will Deacon [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=20181130132102.GC9000@arm.com \
--to=will.deacon@arm.com \
--cc=catalin.marinas@arm.com \
--cc=hanjun.guo@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=rjw@rjwysocki.net \
--cc=sudeep.holla@arm.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;
as well as URLs for NNTP newsgroup(s).