Zhang Xiaoxu
33eb72a6e1
btrfs: selftests: fix wrong error check in btrfs_free_dummy_root()
...
commit 9b2f20344d450137d015b380ff0c2e2a6a170135 upstream.
The btrfs_alloc_dummy_root() uses ERR_PTR as the error return value
rather than NULL, if error happened, there will be a NULL pointer
dereference:
BUG: KASAN: null-ptr-deref in btrfs_free_dummy_root+0x21/0x50 [btrfs]
Read of size 8 at addr 000000000000002c by task insmod/258926
CPU: 2 PID: 258926 Comm: insmod Tainted: G W 6.1.0-rc2+ #5
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x34/0x44
kasan_report+0xb7/0x140
kasan_check_range+0x145/0x1a0
btrfs_free_dummy_root+0x21/0x50 [btrfs]
btrfs_test_free_space_cache+0x1a8c/0x1add [btrfs]
btrfs_run_sanity_tests+0x65/0x80 [btrfs]
init_btrfs_fs+0xec/0x154 [btrfs]
do_one_initcall+0x87/0x2a0
do_init_module+0xdf/0x320
load_module+0x3006/0x3390
__do_sys_finit_module+0x113/0x1b0
do_syscall_64+0x35/0x80
entry_SYSCALL_64_after_hwframe+0x46/0xb0
Fixes: aaedb55bc08f ("Btrfs: add tests for btrfs_get_extent")
CC: stable@vger.kernel.org # 4.9+
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-25 17:35:37 +01:00
..
2022-06-25 11:44:57 +02:00
2019-08-06 18:29:35 +02:00
2020-09-12 11:47:39 +02:00
2020-01-29 10:24:34 +01:00
2019-12-21 10:40:46 +01:00
2018-12-01 09:44:19 +01:00
2022-11-25 17:35:37 +01:00
2020-11-10 10:24:00 +01:00
2022-10-26 13:15:35 +02:00
2022-09-28 10:55:44 +02:00
2019-08-06 18:29:38 +02:00
2022-03-02 11:32:03 +01:00
2018-11-13 11:17:03 -08:00
2021-07-20 16:21:11 +02:00
2019-05-08 07:19:10 +02:00
2019-03-23 13:19:47 +01:00
2022-10-26 13:15:37 +02:00
2021-05-26 11:29:07 +02:00
2020-12-02 08:31:28 +01:00
2018-11-27 16:09:38 +01:00
2020-01-29 10:24:03 +01:00
2022-04-20 09:06:35 +02:00
2022-11-10 15:46:07 +01:00
2022-10-26 13:15:45 +02:00
2022-06-14 16:52:30 +02:00
2018-12-17 09:38:34 +01:00
2022-08-25 11:09:24 +02:00
2022-04-27 13:14:10 +02:00
2021-08-04 11:58:02 +02:00
2020-04-24 07:58:59 +02:00
2021-06-03 08:23:33 +02:00
2021-11-12 13:18:02 +01:00
2020-09-03 11:21:19 +02:00
2022-06-14 16:52:38 +02:00
2022-06-14 16:52:30 +02:00
2022-11-03 23:49:16 +09:00
2020-12-29 13:44:57 +01:00
2020-08-21 11:02:06 +02:00
2019-03-13 14:04:52 -07:00
2022-11-10 15:46:05 +01:00
2020-12-29 13:44:59 +01:00
2022-06-06 08:19:46 +02:00
2022-11-25 17:35:37 +01:00
2022-06-14 16:52:31 +02:00
2022-10-26 13:15:32 +02:00
2022-11-03 23:49:14 +09:00
2021-11-26 11:48:38 +01:00
2021-10-17 10:05:38 +02:00
2022-08-25 11:09:21 +02:00
2020-01-12 11:24:20 +01:00
2021-10-06 10:23:41 +02:00
2022-10-26 13:15:37 +02:00
2021-08-15 13:01:04 +02:00
2020-08-26 10:29:03 +02:00
2021-05-22 10:40:32 +02:00
2022-03-23 09:00:34 +01:00
2018-12-17 09:38:32 +01:00
2022-09-20 11:50:16 +02:00
2022-04-20 09:06:40 +02:00
2022-02-08 18:15:26 +01:00
2020-08-21 11:02:11 +02:00
2022-07-12 16:26:24 +02:00
2018-12-21 14:11:31 +01:00
2022-08-25 11:09:23 +02:00
2020-06-03 08:16:42 +02:00
2019-07-10 09:55:38 +02:00
2021-03-17 16:10:18 +01:00
2019-11-06 12:18:04 +01:00
2020-10-01 20:40:12 +02:00
2020-11-10 10:23:56 +01:00
2020-05-20 08:15:32 +02:00
2018-02-25 11:05:55 +01:00
2020-06-30 15:38:35 -04:00
2017-07-05 14:40:26 +02:00
2018-02-28 10:18:33 +01:00
2019-03-27 14:13:04 +09:00
2021-04-16 11:59:07 +02:00
2019-03-13 14:04:58 -07:00
2020-10-14 09:48:13 +02:00
2022-06-06 08:19:46 +02:00
2018-01-31 12:55:52 +01:00
2021-12-08 08:45:06 +01:00
2022-03-02 11:32:07 +01:00
2022-06-14 16:52:34 +02:00
2022-10-26 13:15:34 +02:00
2017-09-20 08:20:01 +02:00
2017-09-20 08:19:59 +02:00
2020-11-24 13:03:05 +01:00
2020-01-12 11:24:13 +01:00
2018-02-22 15:43:48 +01:00
2017-07-21 07:42:22 +02:00
2017-10-18 09:35:39 +02:00
2020-03-11 07:53:07 +01:00
2021-08-26 08:37:29 -04:00
2018-02-17 13:21:15 +01:00
2020-03-20 09:07:44 +01:00
2021-08-15 13:01:03 +02:00
2020-05-02 17:23:20 +02:00
2019-06-11 12:22:49 +02:00
2020-01-04 13:41:06 +01:00
2021-03-24 10:59:25 +01:00
2021-07-20 16:21:16 +02:00
2021-12-14 10:04:48 +01:00
2019-06-11 12:22:45 +02:00
2017-06-14 15:06:01 +02:00
2022-02-23 11:56:39 +01:00
2017-05-08 07:47:54 +02:00
2019-09-06 10:19:37 +02:00
2020-08-21 11:01:55 +02:00