ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)
Subsystems (2)
PATCH 1/1 ACPI/IORT: Increase allocation size up to sizeof(struct acpi_iort_node)
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.
---
drivers/acpi/arm64/iort.c +2 -1
@@ -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;
Signature · 3 lines
Alexey V. Vissarionov gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
Quoted 2 lines · Alexey V. Vissarionov
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.
Quoted 2 lines
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.
Quoted 27 lines
Signed-off-by Alexey V. Vissarionov <[email protected]>Fixes 24e516049360 ("ACPI/IORT: Add support for PMCG")---
drivers/acpi/arm64/iort.c +2
-1@@ -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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel