Eiichi Tsukata
c90652abae
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:31:02 +02:00
..
2020-08-19 08:15:06 +02:00
2019-08-06 19:06:49 +02:00
2020-01-27 14:51:21 +01:00
2020-06-25 15:33:06 +02:00
2019-12-13 08:51:01 +01:00
2018-12-01 09:37:27 +01:00
2020-08-26 10:30:59 +02:00
2020-06-03 08:19:29 +02:00
2020-08-26 10:31:01 +02:00
2020-08-21 11:05:31 +02:00
2019-08-06 19:06:51 +02:00
2020-05-27 17:37:32 +02:00
2018-11-13 11:08:55 -08:00
2019-07-26 09:14:02 +02:00
2019-05-08 07:21:48 +02:00
2019-03-23 20:09:59 +01:00
2020-08-19 08:15:02 +02:00
2020-02-28 16:38:59 +01:00
2019-12-05 09:20:32 +01:00
2020-01-27 14:50:02 +01:00
2020-08-21 11:05:32 +02:00
2020-08-26 10:30:59 +02:00
2020-06-25 15:32:49 +02:00
2020-06-22 09:05:08 +02:00
2018-12-17 09:24:40 +01:00
2020-07-29 10:16:46 +02:00
2020-07-22 09:32:01 +02:00
2019-12-01 09:17:10 +01:00
2020-04-17 10:48:52 +02:00
2018-08-17 16:20:28 -07:00
2018-08-25 12:42:33 -07:00
2019-05-22 07:37:40 +02:00
2018-08-21 11:37:41 +02:00
2020-08-26 10:30:59 +02:00
2020-08-26 10:31:01 +02:00
2020-01-27 14:50:33 +01:00
2019-12-13 08:52:43 +01:00
2019-12-13 08:51:59 +01:00
2020-08-21 11:05:38 +02:00
2020-08-21 11:05:38 +02:00
2020-07-09 09:37:11 +02:00
2020-06-22 09:05:03 +02:00
2020-06-30 23:17:00 -04:00
2018-08-17 16:20:27 -07:00
2020-08-21 11:05:33 +02:00
2020-02-24 08:34:53 +01:00
2020-07-22 09:32:10 +02:00
2020-06-22 09:05:06 +02:00
2020-08-19 08:15:04 +02:00
2020-01-12 12:17:20 +01:00
2020-02-24 08:34:52 +01:00
2020-08-26 10:30:59 +02:00
2018-08-18 11:44:53 -07:00
2018-12-17 09:24:30 +01:00
2020-05-27 17:37:30 +02:00
2020-02-24 08:34:45 +01:00
2020-08-21 11:05:38 +02:00
2020-08-26 10:31:02 +02:00
2020-06-22 09:05:01 +02:00
2020-06-03 08:19:41 +02:00
2019-07-03 13:14:44 +02:00
2019-11-06 13:05:37 +01:00
2020-06-25 15:33:06 +02:00
2020-04-23 10:30:12 +02:00
2020-01-14 20:06:57 +01:00
2020-01-09 10:19:07 +01:00
2020-05-14 07:57:21 +02:00
2020-03-05 16:42:12 +01:00
2019-05-25 18:23:26 +02:00
2019-03-05 17:58:50 +01:00
2020-01-12 12:17:20 +01:00
2020-02-11 04:34:08 -08:00
2019-02-12 19:47:19 +01:00
2020-05-20 08:18:50 +02:00
2018-08-15 23:03:20 -05:00
2018-08-21 18:19:09 -07:00
2020-05-27 17:37:29 +02:00
2020-04-17 10:48:51 +02:00
2020-06-22 09:05:03 +02:00
2020-03-25 08:06:14 +01:00
2019-05-31 06:46:05 -07:00
2018-11-21 09:19:14 +01:00
2019-12-13 08:52:56 +01:00
2020-04-02 15:28:21 +02:00
2020-01-09 10:19:00 +01:00
2018-08-17 16:20:29 -07:00
2020-03-05 16:42:20 +01:00
2020-04-29 16:31:26 +02:00
2019-05-25 18:23:26 +02:00
2020-03-18 07:14:21 +01:00
2019-05-04 09:20:11 +02:00
2020-05-02 17:26:01 +02:00
2019-12-01 09:17:04 +01:00
2020-01-04 19:13:26 +01:00
2019-08-25 10:47:43 +02:00
2019-12-17 20:35:43 +01:00
2019-10-11 18:21:39 +02:00
2018-08-26 11:48:42 -07:00
2018-08-13 20:56:23 -07:00
2020-01-04 19:13:18 +01:00
2020-08-11 15:32:34 +02:00