Jia-Ju Bai
bbe70e4e42
fs: kernfs: Fix possible null-pointer dereferences in kernfs_path_from_node_locked()
...
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.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com >
Link: https://lore.kernel.org/r/20190724022242.27505-1-baijiaju1990@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-07-25 15:32:51 +02:00
..
2019-07-12 11:05:43 -07:00
2019-07-19 11:33:22 -07:00
2019-07-11 10:55:49 -07:00
2019-07-19 10:42:02 -07:00
2019-07-20 09:15:51 -07:00
2019-07-18 18:14:47 -05:00
2019-07-16 19:23:23 -07:00
2019-07-19 10:42:02 -07:00
2019-07-10 18:43:43 -07:00
2019-07-12 12:24:03 -07:00
2019-06-20 14:46:34 +02:00
2019-07-12 17:37:53 -07:00
2019-07-14 19:29:04 -07:00
2019-07-19 10:42:02 -07:00
2019-07-12 16:54:37 -07:00
2019-07-18 10:52:08 -07:00
2019-07-18 17:08:07 -07:00
2019-07-10 18:43:43 -07:00
2019-07-19 10:42:02 -07:00
2019-07-12 16:54:37 -07:00
2019-07-16 19:23:23 -07:00
2019-07-19 10:42:02 -07:00
2019-07-19 11:38:12 -07:00
2019-06-20 17:32:21 -04:00
2019-07-12 11:05:43 -07:00
2019-07-01 08:25:34 -07:00
2019-07-25 15:32:51 +02:00
2019-07-03 17:52:09 -04:00
2019-07-20 09:15:51 -07:00
2019-07-19 10:42:02 -07:00
2019-07-01 08:25:34 -07:00
2019-07-18 17:08:07 -07:00
2019-07-12 16:54:37 -07:00
2019-07-19 10:42:02 -07:00
2019-07-16 15:15:29 -07:00
2019-06-21 09:58:42 -07:00
2019-07-19 10:42:02 -07:00
2019-07-08 21:04:42 -07:00
2019-07-10 20:27:07 -07:00
2019-07-19 10:42:02 -07:00
2019-07-16 19:23:24 -07:00
2019-06-19 17:09:53 +02:00
2019-07-19 10:42:02 -07:00
2019-07-10 20:09:17 -07:00
2019-07-18 17:08:07 -07:00
2019-07-10 20:27:07 -07:00
2019-07-16 19:23:23 -07:00
2019-07-10 21:06:01 -07:00
2019-07-18 11:18:00 -07:00
2019-07-19 10:42:02 -07:00
2019-07-19 10:42:02 -07:00
2019-07-16 19:23:22 -07:00
2019-07-16 19:23:22 -07:00
2019-07-19 10:42:02 -07:00
2019-07-19 10:42:02 -07:00
2019-07-15 21:20:52 -07:00
2019-06-19 17:09:55 +02:00
2019-07-19 11:38:12 -07:00
2019-07-20 09:15:51 -07:00
2019-06-29 09:47:31 -06:00
2019-07-18 17:08:07 -07:00
2019-07-08 21:48:15 -07:00
2019-07-19 10:42:02 -07:00
2019-07-16 22:52:37 -04:00
2019-07-10 09:00:57 -06:00
2019-07-19 10:42:02 -07:00
2019-07-12 16:54:37 -07:00
2019-07-20 09:15:51 -07:00
2019-07-16 19:23:24 -07:00
2019-07-05 11:22:11 -04:00
2019-06-24 09:16:47 +10:00
2019-07-19 10:42:02 -07:00
2019-07-10 21:22:43 -07:00
2019-07-17 07:20:43 -07:00
2019-07-16 22:52:37 -04:00
2019-07-10 09:00:57 -06:00
2019-06-20 14:44:55 +02:00
2019-07-20 09:15:51 -07:00
2019-06-17 17:36:09 -04:00
2019-07-16 19:23:25 -07:00
2019-07-03 17:52:50 -04:00
2019-07-04 22:01:58 -04:00
2019-07-05 11:12:07 +09:00