Zhang Xiaoxu
9c0accfa5a
btrfs: selftests: fix wrong error check in btrfs_free_dummy_root()
...
commit 9b2f20344d
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: aaedb55bc0
("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-16 09:57:17 +01:00
..
2022-11-16 09:57:17 +01:00
2021-11-26 10:39:20 +01:00
2020-03-23 17:01:51 +01:00
2022-11-10 18:14:19 +01:00
2021-03-04 11:38:29 +01:00
2022-08-21 15:16:20 +02:00
2021-03-09 11:11:11 +01:00
2020-11-05 13:02:05 +01:00
2020-03-23 17:01:55 +01:00
2021-09-03 10:09:28 +02:00
2020-07-27 12:55:21 +02:00
2020-03-23 17:01:39 +01:00
2021-08-04 12:46:39 +02:00
2020-10-07 12:06:55 +02:00
2022-01-27 10:54:27 +01:00
2021-03-09 11:11:11 +01:00
2020-10-07 12:06:52 +02:00
2020-07-27 12:55:36 +02:00
2021-07-14 16:55:55 +02:00
2020-03-23 17:01:53 +01:00
2021-03-04 11:38:30 +01:00
2021-03-04 11:38:30 +01:00
2022-08-31 17:15:22 +02:00
2021-01-19 18:27:24 +01:00
2020-04-20 17:43:42 +02:00
2022-10-05 10:38:37 +02:00
2020-10-26 15:04:57 +01:00
2022-11-10 18:14:25 +01:00
2022-11-10 18:14:25 +01:00
2021-12-14 11:32:38 +01:00
2022-04-13 21:01:08 +02:00
2020-02-12 17:16:46 +01:00
2020-10-07 12:13:25 +02:00
2021-10-20 11:44:59 +02:00
2021-10-09 14:40:56 +02:00
2022-04-20 09:23:19 +02:00
2021-03-09 11:11:11 +01:00
2020-07-27 12:55:21 +02:00
2021-02-03 23:28:40 +01:00
2020-07-27 12:55:36 +02:00
2022-07-21 21:20:01 +02:00
2022-02-01 17:25:48 +01:00
2021-07-14 16:55:56 +02:00
2020-10-07 12:12:16 +02:00
2020-10-07 12:12:17 +02:00
2020-03-23 17:01:54 +01:00
2020-05-25 11:25:19 +02:00
2020-10-07 12:13:22 +02:00
2020-10-07 12:13:22 +02:00
2021-01-27 11:55:06 +01:00
2021-01-27 11:55:06 +01:00
2020-05-25 11:25:37 +02:00
2022-10-26 13:25:12 +02:00
2021-03-11 14:17:22 +01:00
2022-08-21 15:16:27 +02:00
2020-03-23 17:01:53 +01:00
2020-10-26 15:03:59 +01:00
2020-11-05 13:03:39 +01:00
2022-04-08 14:40:04 +02:00
2020-03-23 17:01:54 +01:00
2021-05-11 14:47:22 +02:00
2022-08-31 17:15:21 +02:00
2022-10-26 13:25:51 +02:00
2022-02-23 12:00:58 +01:00
2020-10-07 12:13:17 +02:00
2021-09-30 10:11:00 +02:00
2021-03-04 11:38:30 +01:00
2020-10-07 12:13:23 +02:00
2022-06-29 08:59:45 +02:00
2021-07-14 16:55:55 +02:00
2020-10-07 12:12:21 +02:00
2021-07-14 16:55:40 +02:00
2021-09-03 10:09:28 +02:00
2022-03-02 11:42:45 +01:00
2020-07-27 12:55:28 +02:00
2022-08-25 11:37:51 +02:00
2020-10-07 12:06:56 +02:00
2020-05-25 11:25:36 +02:00
2022-09-08 11:11:40 +02:00
2021-02-03 23:28:40 +01:00
2022-08-31 17:15:22 +02:00
2020-01-31 10:30:40 -08:00