Re: [PATCH] fs: kernfs: fix possible null pointer dereferences

2020-05-06 Thread Greg Kroah-Hartman
On Thu, Apr 30, 2020 at 04:20:46AM -0700, youngjun wrote: > kernfs_path_from_node_locked checks buf is NULL. > But, two cases below are not covered. > > if(!kn_to)<--- case1 (buf can be NULL) > return strlcpy(buf, "(null)", buflen); > > if(kn_from == kn_to) <---

[PATCH] fs: kernfs: fix possible null pointer dereferences

2020-04-30 Thread youngjun
kernfs_path_from_node_locked checks buf is NULL. But, two cases below are not covered. if(!kn_to) <--- case1 (buf can be NULL) return strlcpy(buf, "(null)", buflen); if(kn_from == kn_to)<--- case2 (buf can be NULL) return strlcpy(buf, "/", buflen);

Re: [PATCH] fs: kernfs: Fix possible null-pointer dereferences in kernfs_path_from_node_locked()

2019-07-29 Thread Tejun Heo
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: >

[PATCH] fs: kernfs: Fix possible null-pointer dereferences in kernfs_path_from_node_locked()

2019-07-23 Thread Jia-Ju Bai
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 + l