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] [day] [month] [year] [list]
Date:   Mon, 29 Jul 2019 11:51:33 -0700
From:   Tejun Heo <tj@...nel.org>
To:     Jia-Ju Bai <baijiaju1990@...il.com>
Cc:     gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: kernfs: Fix possible null-pointer dereferences in
 kernfs_path_from_node_locked()

On Wed, Jul 24, 2019 at 10:22:42AM +0800, Jia-Ju Bai wrote:
> In kernfs_path_from_node_locked(), there is an if statement on line 147
> to check whether buf is NULL:
>     if (buf)
> 
> When buf is NULL, it is used on line 151:
>     len += strlcpy(buf + len, parent_str, ...)
> and line 158:
>     len += strlcpy(buf + len, "/", ...)
> and line 160:
>     len += strlcpy(buf + len, kn->name, ...)
> 
> Thus, possible null-pointer dereferences may occur.
> 
> To fix these possible bugs, buf is checked before being used.
> If it is NULL, -EINVAL is returned.
> 
> These bugs are found by a static analysis tool STCheck written by us.

Can we just get rid of the NULL testing?

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ