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]
Date:   Wed, 24 Jan 2018 10:27:22 -0600
From:   David Lechner <david@...hnology.com>
To:     Mark Brown <broonie@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>
Cc:     linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 1/2] regmap: fix NULL pointer dereference in
 regmap_name_read_file()

On 01/24/2018 10:19 AM, Mark Brown wrote:
> On Wed, Jan 24, 2018 at 05:14:50PM +0100, Lars-Peter Clausen wrote:
>> On 01/23/2018 11:53 PM, David Lechner wrote:
>>> This fixes a possible NULL pointer dereference oops in
>>> regmap_name_read_file() when the regmap does not have a device
>>> associated with it.
> 
>>> -	ret = snprintf(buf, PAGE_SIZE, "%s\n", map->dev->driver->name);
>>> +	if (map->dev && map->dev->driver)
>>> +		name = map->dev->driver->name;
>>> +
>>> +	ret = snprintf(buf, PAGE_SIZE, "%s\n", name);
> 
>> Won't this print "(null)" now? Not sure if that is the best approach.
> 
> Indeed.  It is an improvement but not exactly helpful.
> 


Would it be better if it said "this regmap does not have driver" instead
of "(null)"?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ