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: <YXgavSb+/NoGclFS@paasikivi.fi.intel.com>
Date:   Tue, 26 Oct 2021 18:11:57 +0300
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
Cc:     YE Chengfeng <cyeaa@...nect.ust.hk>,
        "heikki.krogerus@...ux.intel.com" <heikki.krogerus@...ux.intel.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: suspected null-pointer-reference problem for to_swnode

On Mon, Oct 25, 2021 at 07:40:55PM +0300, andriy.shevchenko@...ux.intel.com wrote:
> On Mon, Oct 25, 2021 at 02:03:51PM +0000, YE Chengfeng wrote:
> > Hi, 
> > 
> > https://github.com/torvalds/linux/blob/master/drivers/base/swnode.c#L405
> > 
> > We notice that the return pointer of to_swnode is null check in some case, while in some case is not. For example, at line 416, the return pointer is null-check, but in line 405 is not. We want to know whether it would be a potential null pointer dereference problem, in the case that null-check is missing.
> > 
> > This problem is detected by our experimental static analysis tool, we are not familiar with the source code and it could just be a false positive. We send this email in case this is a real problem. Would you like to spare some time to have a look at it?
> 
> Thank you for the interest to our code!
> 
> Line #405 refers to software node operations and it means it won't be ever
> called if there is no swnode behind it, means it's backed with properties.
> If you think it will be a NULL pointer there, please describe in detail
> (with a traceback included) when and how it happens, because such bugs are
> serious.
> 
> Line #416 refers to the same stage when options are defined and we know we
> have been called against swnode. Seems to me like a dead code brought from
> day 1 by the commit bc0500c1e43d ("device property: Add fwnode_get_name
> for returning the name of a node").
> 
> Sakari?

Yeah, the check could be removed.

-- 
Sakari Ailus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ