lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6913c916-93f7-4b25-8183-676a7cd009b0@embeddedor.com>
Date:   Mon, 17 Jul 2017 00:00:49 -0500
From:   "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To:     Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc:     Jiri Kosina <jikos@...nel.org>, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: hid-logitech-hidpp: add NULL check on devm_kmemdup()
 return value



On 07/12/2017 02:40 AM, Benjamin Tissoires wrote:
> On Jul 07 2017 or thereabouts, Gustavo A. R. Silva wrote:
>> Check return value from call to devm_kmemdup()
>> in order to prevent a NULL pointer dereference.
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
>> ---
>
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
>

Thank you, Benjamin.

>>  drivers/hid/hid-logitech-hidpp.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
>> index 41b3946..501e16a 100644
>> --- a/drivers/hid/hid-logitech-hidpp.c
>> +++ b/drivers/hid/hid-logitech-hidpp.c
>> @@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
>>  				     hidpp_battery_props,
>>  				     sizeof(hidpp_battery_props),
>>  				     GFP_KERNEL);
>> +	if (!battery_props)
>> +		return -ENOMEM;
>> +
>>  	num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2;
>>
>>  	if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE)
>> --
>> 2.5.0
>>

-- 
Gustavo A. R. Silva

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ