syzbot


KASAN: use-after-free Read in __list_del_entry_valid (3)

Status: closed as dup on 2018/03/22 15:31
Subsystems: rdma
[Documentation on labels]
Reported-by: syzbot+09e05aba06723a94d43d@syzkaller.appspotmail.com
Fix commit: 7aa135fcf263 ANDROID: binder: prevent transactions into own process.
First crash: 2453d, last: 2439d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: null-ptr-deref Write in rdma_resolve_addr rdma C 66 2438d 2449d
Discussions (16)
Title Replies (including bot) Last reply
[PATCH 4.4 000/149] 4.4.233-rc1 review 163 (163) 2020/10/31 20:04
[PATCH 4.9 000/212] 4.9.233-rc1 review 220 (220) 2020/08/21 09:40
[PATCH 4.14 000/228] 4.14.194-rc1 review 234 (234) 2020/08/21 06:59
[PATCH 4.19 00/48] 4.19.139-rc1 review 61 (61) 2020/08/11 16:45
[PATCH 5.8 00/38] 5.8.1-rc1 review 46 (46) 2020/08/11 16:20
[PATCH 5.7 00/79] 5.7.15-rc1 review 83 (83) 2020/08/11 14:23
[PATCH 5.4 00/67] 5.4.58-rc1 review 71 (71) 2020/08/11 14:23
[PATCH v2] binder: Prevent context manager from incrementing ref 0 4 (4) 2020/07/28 16:01
[PATCH resend] binder: Prevent context manager from incrementing ref 0 4 (4) 2020/07/10 10:27
[PATCH 4.16 000/113] 4.16.7-stable review 120 (120) 2018/05/01 19:26
[PATCH 4.14 00/91] 4.14.39-stable review 97 (97) 2018/05/01 19:06
KASAN: use-after-free Read in binder_release_work 9 (10) 2018/04/23 13:46
[PATCH v2] ANDROID: binder: prevent transactions into own process. 5 (5) 2018/04/23 08:24
[PATCH] ANDROID: binder: prevent transactions into own process. 5 (5) 2018/03/28 11:34
[v2] ANDROID: binder: prevent transactions into own process. 1 (1) 2018/03/28 09:12
KASAN: use-after-free Read in __list_del_entry_valid (3) 3 (6) 2018/03/22 15:30
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __list_del_entry_valid (4) rdma C done 16 1745d 2433d 15/28 fixed on 2020/05/10 10:41
upstream KASAN: use-after-free Read in __list_del_entry_valid (2) crypto C 11 2529d 2531d 3/28 fixed on 2018/01/11 01:23

Sample crash report:
audit: type=1400 audit(1521133204.939:7): avc:  denied  { map } for  pid=4096 comm="syzkaller144721" path="/root/syzkaller144721791" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0x144/0x150 lib/list_debug.c:54
Read of size 8 at addr ffff8801d2435ce0 by task syzkaller144721/4121

CPU: 0 PID: 4121 Comm: syzkaller144721 Not tainted 4.16.0-rc5+ #354
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __list_del_entry_valid+0x144/0x150 lib/list_debug.c:54
 __list_del_entry include/linux/list.h:117 [inline]
 list_del include/linux/list.h:125 [inline]
 cma_cancel_listens drivers/infiniband/core/cma.c:1569 [inline]
 cma_cancel_operation+0x455/0xd60 drivers/infiniband/core/cma.c:1597
 rdma_destroy_id+0xff/0xda0 drivers/infiniband/core/cma.c:1661
 ucma_close+0x100/0x2f0 drivers/infiniband/core/ucma.c:1712
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73a/0x16d0 kernel/signal.c:2469
 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446af9
RSP: 002b:00007fc143953da8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00000000006e29fc RCX: 0000000000446af9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000006e29fc
RBP: 00000000006e29f8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 006d635f616d6472
R13: 2f646e6162696e69 R14: 666e692f7665642f R15: 0000000000000005

Allocated by task 4121:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3607
 kmalloc include/linux/slab.h:512 [inline]
 kzalloc include/linux/slab.h:701 [inline]
 rdma_create_id+0xd0/0x630 drivers/infiniband/core/cma.c:787
 ucma_create_id+0x31a/0x620 drivers/infiniband/core/ucma.c:479
 ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1633
 __vfs_write+0xef/0x970 fs/read_write.c:480
 vfs_write+0x189/0x510 fs/read_write.c:544
 SYSC_write fs/read_write.c:589 [inline]
 SyS_write+0xef/0x220 fs/read_write.c:581
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 4121:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3485 [inline]
 kfree+0xd9/0x260 mm/slab.c:3800
 rdma_destroy_id+0x821/0xda0 drivers/infiniband/core/cma.c:1691
 ucma_close+0x100/0x2f0 drivers/infiniband/core/ucma.c:1712
 __fput+0x327/0x7e0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x199/0x270 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0x9bb/0x1ad0 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73a/0x16d0 kernel/signal.c:2469
 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
 do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801d2435b00
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 480 bytes inside of
 1024-byte region [ffff8801d2435b00, ffff8801d2435f00)
The buggy address belongs to the page:
page:ffffea0007490d00 count:1 mapcount:0 mapping:ffff8801d2434000 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801d2434000 0000000000000000 0000000100000007
raw: ffffea000730eb20 ffff8801dac01848 ffff8801dac00ac0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d2435b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d2435c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801d2435c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                       ^
 ffff8801d2435d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801d2435d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/15 17:03 upstream 0aa3fdb8b3a6 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/15 17:18 upstream 0aa3fdb8b3a6 08dacaa0 .config console log report syz ci-upstream-kasan-gce-386
2018/03/10 10:30 upstream cdb06e9d8f52 36d1c454 .config console log report syz ci-upstream-kasan-gce-386
2018/03/18 21:39 upstream 9e1909b9da04 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/17 18:03 upstream 8f5fd927c3a7 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/17 17:14 upstream 8f5fd927c3a7 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/16 19:33 upstream df09348f78dc 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/16 16:17 upstream df09348f78dc 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/15 16:44 upstream 0aa3fdb8b3a6 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/14 16:36 upstream fc6eabbbf8ef 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/19 14:50 upstream c698ca527893 7e7d7ed2 .config console log report ci-upstream-kasan-gce-386
2018/03/10 10:12 upstream cdb06e9d8f52 36d1c454 .config console log report ci-upstream-kasan-gce-386
2018/03/08 04:07 upstream 851710a80961 d50edb7e .config console log report ci-upstream-kasan-gce-386
2018/03/07 14:56 upstream 86f84779d8e9 a5e76540 .config console log report ci-upstream-kasan-gce-386
2018/03/06 01:05 upstream 094b58e1040a aef0b792 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.