From: Robin Murphy <robin.murphy@arm.com>
To: "Alexey V. Vissarionov" <gremlin@altlinux.org>,
Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH] ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)
Date: Wed, 1 Feb 2023 16:15:17 +0000 [thread overview]
Message-ID: <f51ea97a-2eaa-e13d-ef3d-74586cf3d847@arm.com> (raw)
In-Reply-To: <20230201021213.GC446@altlinux.org>
On 2023-02-01 02:12, Alexey V. Vissarionov wrote:
> The node is a pointer to struct acpi_iort_node, so it's just 4 or 8
> bytes, while the structure itself is several times bigger.
That is indeed true. Something that is also true is that "&node" is of
type "struct acpi_iort_node **", and is a pointer to a pointer object.
One of these facts is more relevant to this code than the other.
> Found by ALT Linux Team (altlinux.org) and Linux Verification Center
> (linuxtesting.org) using SVACE.
If your tool really thinks we should be copying 17 bytes out of an
8-byte object, please fix it before "verifying" any more code.
Thanks,
Robin.
> Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>
> Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG")
>
> ---
>
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index 38fb84974f352cc8..edb94b52bf3a21ce 100644
> --- a/drivers/acpi/arm64/iort.c
> +++ b/drivers/acpi/arm64/iort.c
> @@ -1832,7 +1832,8 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node,
> if (ops->dev_add_platdata)
> ret = ops->dev_add_platdata(pdev);
> else
> - ret = platform_device_add_data(pdev, &node, sizeof(node));
> + ret = platform_device_add_data(pdev, &node,
> + sizeof(struct acpi_iort_node));
>
> if (ret)
> goto dev_put;
>
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-02-01 16:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 2:12 [PATCH] ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node) Alexey V. Vissarionov
2023-02-01 16:15 ` Robin Murphy [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=f51ea97a-2eaa-e13d-ef3d-74586cf3d847@arm.com \
--to=robin.murphy@arm.com \
--cc=gremlin@altlinux.org \
--cc=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=rafael@kernel.org \
--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).