RE: [PATCH] Fix null deref in acpi_ns_check_package_list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: C0deAi [mailto:techsupport@xxxxxxxxx]
> Sent: Thursday, February 22, 2018 9:14 AM
> To: Moore, Robert <robert.moore@xxxxxxxxx>; Schmauss, Erik
> <erik.schmauss@xxxxxxxxx>; Wysocki, Rafael J
> <rafael.j.wysocki@xxxxxxxxx>; lenb@xxxxxxxxxx; linux-
> acpi@xxxxxxxxxxxxxxx; devel@xxxxxxxxxx
> Subject: [PATCH] Fix null deref in acpi_ns_check_package_list
> 
> Hi my name is Benjamin Bales.
> 
> I am the founder and creator of CodeAI,
> the first non-human contributor to your software project. CodeAI finds
> and fixes security defects for you. It fixed 327. It wants to merge a
> fix for a null dereference. To view all 327 fixed issues from the run
> claim your free open source account at mycode.ai and the Dockerfile used
> to build and run your project in CodeAI, here-
> https://drive.google.com/drive/folders/1KB9WQQyWQgYccmiSjy2E1JWJ4vWuoLYd
> .
> It is always free for open source projects.
> 
> If you have any questions about these results or have general inquiries
> about CodeAI, please send an email to techsupport@xxxxxxxxx
> 
> Signed-off-by: Benjamin Bales <techsupport@xxxxxxxxx>
> ---
>  drivers/acpi/acpica/nsprepkg.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/acpi/acpica/nsprepkg.c
> b/drivers/acpi/acpica/nsprepkg.c index 7805d5c..d1bfd86 100644
> --- a/drivers/acpi/acpica/nsprepkg.c
> +++ b/drivers/acpi/acpica/nsprepkg.c
> @@ -437,6 +437,8 @@ acpi_ns_check_package_list(struct acpi_evaluate_info
> *info,
>  	 */
>  	for (i = 0; i < count; i++) {
>  		sub_package = *elements;
> +		if (sub_package == NULL)
> +			break;
>  		sub_elements = sub_package->package.elements;
>  		info->parent_package = sub_package;
> 

The story here is that the SubPackage pointer is *guaranteed* to be valid at this point in the code. It has already be validated and all NULL elements have been removed.

    /*
     * Validate each subpackage in the parent Package
     *
     * NOTE: assumes list of subpackages contains no NULL elements.
     * Any NULL elements should have been removed by earlier call
     * to AcpiNsRemoveNullElements.
     */
    for (i = 0; i < Count; i++)
    {
        SubPackage = *Elements;
        SubElements = SubPackage->Package.Elements;
        Info->ParentPackage = SubPackage;




> --
> 2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux