Re: [PATCH v3 2/2] iio: imu: inv_mpu6050: validate ACPI object types in asus_acpi_get_sensor_info()
From: Jonathan Cameron
Date: Sat Oct 31 2026 - 19:58:37 EST
On Thu, 29 Oct 2026 11:08:29 +0000
Tristan Madani <tristmd@xxxxxxxxx> wrote:
> From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
>
> asus_acpi_get_sensor_info() iterates through a nested ACPI package
> structure without checking types at either level. The outer object
> returned by acpi_evaluate_object() and each inner element must be
> validated as ACPI_TYPE_PACKAGE before accessing their package.count
> and package.elements members.
>
> Use acpi_evaluate_object_typed() to validate the outer object type
> at evaluation time. Add a type check for each inner element before
> accessing its package contents. Also replace kfree() with
> ACPI_FREE() for the ACPI-allocated buffer.
>
> Fixes: a35c5d1aa96a ("iio: imu: inv_mpu6050: Create mux clients for ACPI")
> Cc: stable@xxxxxxxxxxxxxxx
As with the previous. Hardening against buggy firmware isn't
a fix. It is however nice to have so with those tags dropped
I've applied this to the testing branch of iio.git
Thanks,
Jonathan