From: "Alexey V. Vissarionov" <gremlin@altlinux.org>
To: 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, gremlin@altlinux.org
Subject: [PATCH] ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)
Date: Wed, 1 Feb 2023 05:12:13 +0300 [thread overview]
Message-ID: <20230201021213.GC446@altlinux.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
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.
Found by ALT Linux Team (altlinux.org) and Linux Verification Center
(linuxtesting.org) using SVACE.
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;
--
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: "Alexey V. Vissarionov" <gremlin@altlinux.org>
To: 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, gremlin@altlinux.org
Subject: [PATCH] ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)
Date: Wed, 1 Feb 2023 05:12:13 +0300 [thread overview]
Message-ID: <20230201021213.GC446@altlinux.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1066 bytes --]
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.
Found by ALT Linux Team (altlinux.org) and Linux Verification Center
(linuxtesting.org) using SVACE.
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;
--
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-02-01 2:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 2:12 Alexey V. Vissarionov [this message]
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
2023-02-01 16:15 ` Robin Murphy
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=20230201021213.GC446@altlinux.org \
--to=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 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.