Eiichi Tsukata
a7631e087f
xfs: Fix UBSAN null-ptr-deref in xfs_sysfs_init
...
[ Upstream commit 96cf2a2c75 ]
If xfs_sysfs_init is called with parent_kobj == NULL, UBSAN
shows the following warning:
UBSAN: null-ptr-deref in ./fs/xfs/xfs_sysfs.h:37:23
member access within null pointer of type 'struct xfs_kobj'
Call Trace:
dump_stack+0x10e/0x195
ubsan_type_mismatch_common+0x241/0x280
__ubsan_handle_type_mismatch_v1+0x32/0x40
init_xfs_fs+0x12b/0x28f
do_one_initcall+0xdd/0x1d0
do_initcall_level+0x151/0x1b6
do_initcalls+0x50/0x8f
do_basic_setup+0x29/0x2b
kernel_init_freeable+0x19f/0x20b
kernel_init+0x11/0x1e0
ret_from_fork+0x22/0x30
Fix it by checking parent_kobj before the code accesses its member.
Signed-off-by: Eiichi Tsukata <devel@etsukata.com >
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com >
[darrick: minor whitespace edits]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2020-08-26 10:29:05 +02:00
..
2020-08-21 11:01:47 +02:00
2016-06-21 09:53:44 +10:00
2017-10-08 10:26:11 +02:00
2017-10-08 10:26:11 +02:00
2016-10-04 18:06:40 -07:00
2017-10-27 10:38:10 +02:00
2017-07-27 15:08:03 -07:00
2018-02-03 17:05:40 +01:00
2016-10-04 18:06:41 -07:00
2017-10-27 10:38:10 +02:00
2016-06-01 17:38:15 +10:00
2016-04-06 07:57:45 +10:00
2017-09-20 08:19:57 +02:00
2016-10-04 11:05:44 -07:00
2017-10-27 10:38:10 +02:00
2017-10-27 10:38:10 +02:00
2017-09-20 08:20:02 +02:00
2017-09-20 08:20:01 +02:00
2019-11-28 18:28:28 +01:00
2017-09-20 08:19:57 +02:00
2017-06-07 12:07:51 +02:00
2018-05-30 07:50:40 +02:00
2018-02-03 17:05:40 +01:00
2018-02-03 17:05:40 +01:00
2017-10-27 10:38:09 +02:00
2016-10-05 16:26:31 -07:00
2016-07-15 15:31:29 -04:00
2017-04-08 09:30:31 +02:00
2016-08-03 12:29:32 +10:00
2016-08-03 11:23:49 +10:00
2018-05-09 09:50:21 +02:00
2016-10-03 09:56:28 +11:00
2017-01-12 11:39:44 +01:00
2016-10-05 16:26:27 -07:00
2016-10-05 16:26:28 -07:00
2020-08-21 11:01:47 +02:00
2017-06-07 12:07:52 +02:00
2017-10-27 10:38:09 +02:00
2016-02-09 16:54:58 +11:00
2018-02-03 17:05:38 +01:00
2017-06-07 12:07:51 +02:00
2019-12-05 15:34:37 +01:00
2017-10-05 09:44:03 +02:00
2016-07-20 11:29:35 +10:00
2017-10-27 10:38:09 +02:00
2017-10-27 10:38:09 +02:00
2019-09-06 10:19:40 +02:00
2016-09-22 10:56:19 +02:00
2017-10-08 10:26:11 +02:00
2017-09-13 14:13:37 -07:00
2016-07-22 09:52:35 +10:00
2016-09-26 08:22:16 +10:00
2017-12-20 10:07:31 +01:00
2020-08-21 11:01:49 +02:00
2016-06-01 17:38:15 +10:00
2017-09-20 08:19:59 +02:00
2018-06-06 16:44:32 +02:00
2017-10-27 10:38:09 +02:00
2017-10-27 10:38:09 +02:00
2016-07-15 15:31:29 -04:00
2017-06-07 12:07:52 +02:00
2018-03-03 10:23:25 +01:00
2016-02-08 11:27:55 +11:00
2020-01-29 10:24:00 +01:00
2017-01-12 11:39:44 +01:00
2016-10-03 09:11:21 -07:00
2020-08-21 11:02:01 +02:00
2017-04-08 09:30:32 +02:00
2016-10-05 16:26:29 -07:00
2016-09-19 10:24:27 +10:00
2019-12-05 15:34:21 +01:00
2016-06-01 17:38:15 +10:00
2016-10-03 09:11:16 -07:00
2016-10-03 09:11:16 -07:00
2019-10-17 13:42:47 -07:00
2016-09-26 08:21:44 +10:00
2016-08-03 11:19:29 +10:00
2016-10-05 16:26:28 -07:00
2016-10-05 16:26:28 -07:00
2017-01-12 11:39:45 +01:00
2020-08-26 10:29:05 +02:00
2016-08-03 11:15:38 +10:00
2018-06-06 16:44:32 +02:00
2017-09-20 08:20:00 +02:00
2017-09-20 08:19:57 +02:00
2017-09-20 08:20:02 +02:00
2020-08-26 10:29:05 +02:00
2016-09-19 10:30:52 +10:00
2016-09-27 21:06:22 -04:00
2017-09-20 08:20:00 +02:00
2016-10-03 09:11:22 -07:00
2016-10-05 16:26:29 -07:00
2017-06-07 12:07:52 +02:00
2017-09-20 08:20:02 +02:00
2016-09-14 07:40:35 +10:00