mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Daniel Baluta <daniel.baluta@intel.com>,
	Crestez Dan Leonard <leonard.crestez@intel.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: Re: [PATCH] iio: inv_mpu6050: Fix use-after-free in ACPI code
Date: Sat, 11 Jun 2016 17:21:40 +0100	[thread overview]
Message-ID: <ea9fa74f-d428-4995-f5e8-b3ede219b602@kernel.org> (raw)
In-Reply-To: <CAEnQRZBW_aWawJe5VfnOJ0ZwURtRwSNWEiDMcrjPEWCi==XcZg@mail.gmail.com>

On 06/06/16 13:33, Daniel Baluta wrote:
> On Fri, Jun 3, 2016 at 9:30 PM, Crestez Dan Leonard
> <leonard.crestez@intel.com> wrote:
>> In some cases this can result in incorrectly returning a negative value
>> from asus_acpi_get_sensor_info and the AK8963 magnetometer failing to
>> show up.
>>
>> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>> Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
> 
> Looks good to me. I had to look into the code to see that
> cpm is an alias for buffer.pointer, perhaps this should have been
> mentioned in the commit message.
> 
> Acked-by: Daniel Baluta <daniel.baluta@intel.com>
I added a note on that to the commit message and applied to the fixes-togreg
branch of iio.git.

Thanks,

Jonathan
> 
>> ---
>>  drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>> index 2771106..f770472 100644
>> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>> @@ -56,6 +56,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
>>         int i;
>>         acpi_status status;
>>         union acpi_object *cpm;
>> +       int ret;
>>
>>         status = acpi_evaluate_object(adev->handle, "CNF0", NULL, &buffer);
>>         if (ACPI_FAILURE(status))
>> @@ -82,10 +83,10 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
>>                         }
>>                 }
>>         }
>> -
>> +       ret = cpm->package.count;
>>         kfree(buffer.pointer);
>>
>> -       return cpm->package.count;
>> +       return ret;
>>  }
>>
>>  static int acpi_i2c_check_resource(struct acpi_resource *ares, void *data)
>> --
>> 2.5.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      reply	other threads:[~2016-06-11 16:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 18:30 Crestez Dan Leonard
2016-06-06 12:33 ` Daniel Baluta
2016-06-11 16:21   ` Jonathan Cameron [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=ea9fa74f-d428-4995-f5e8-b3ede219b602@kernel.org \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=leonard.crestez@intel.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=srinivas.pandruvada@linux.intel.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

all inboxes | Powered by JetHome®