syzbot


net test error: KASAN: null-ptr-deref Write in x25_disconnect

Status: fixed on 2020/07/17 17:58
Subsystems: x25
[Documentation on labels]
Reported-by: syzbot+6db548b615e5aeefdce2@syzkaller.appspotmail.com
Fix commit: 8999dc89497a net/x25: Fix null-ptr-deref in x25_disconnect
First crash: 1488d, last: 1487d
Discussions (8)
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.19 00/56] 4.19.137-rc1 review 63 (63) 2020/08/10 18:05
[PATCH 4.14 00/51] 4.14.192-rc1 review 54 (54) 2020/08/05 09:52
[PATCH 5.7 000/120] 5.7.13-rc1 review 134 (134) 2020/08/04 06:52
[PATCH 5.4 00/90] 5.4.56-rc1 review 91 (91) 2020/08/03 12:19
[PATCH] net/x25: Fix null-ptr-deref in x25_disconnect 2 (2) 2020/04/28 21:11
net test error: KASAN: null-ptr-deref Write in x25_disconnect 0 (1) 2020/04/28 04:58

Sample crash report:
can: request_module (can-proto-0) failed.
can: request_module (can-proto-0) failed.
can: request_module (can-proto-0) failed.
==================================================================
BUG: KASAN: null-ptr-deref in atomic_fetch_sub include/asm-generic/atomic-instrumented.h:199 [inline]
BUG: KASAN: null-ptr-deref in refcount_sub_and_test include/linux/refcount.h:266 [inline]
BUG: KASAN: null-ptr-deref in refcount_dec_and_test include/linux/refcount.h:294 [inline]
BUG: KASAN: null-ptr-deref in x25_neigh_put include/net/x25.h:253 [inline]
BUG: KASAN: null-ptr-deref in x25_disconnect+0x253/0x370 net/x25/x25_subr.c:361
Write of size 4 at addr 00000000000000d8 by task syz-fuzzer/7089

CPU: 1 PID: 7089 Comm: syz-fuzzer Not tainted 5.7.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x188/0x20d lib/dump_stack.c:118
 __kasan_report.cold+0x5/0x4d mm/kasan/report.c:515
 kasan_report+0x33/0x50 mm/kasan/common.c:625
 check_memory_region_inline mm/kasan/generic.c:187 [inline]
 check_memory_region+0x141/0x190 mm/kasan/generic.c:193
 atomic_fetch_sub include/asm-generic/atomic-instrumented.h:199 [inline]
 refcount_sub_and_test include/linux/refcount.h:266 [inline]
 refcount_dec_and_test include/linux/refcount.h:294 [inline]
 x25_neigh_put include/net/x25.h:253 [inline]
 x25_disconnect+0x253/0x370 net/x25/x25_subr.c:361
 x25_release+0x345/0x420 net/x25/af_x25.c:665
 __sock_release+0xcd/0x280 net/socket.c:605
 sock_close+0x18/0x20 net/socket.c:1283
 __fput+0x33e/0x880 fs/file_table.c:280
 task_work_run+0xf4/0x1b0 kernel/task_work.c:123
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop+0x2fa/0x360 arch/x86/entry/common.c:165
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
 do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x4afb40
Code: 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 49 c7 c2 00 00 00 00 49 c7 c0 00 00 00 00 49 c7 c1 00 00 00 00 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30
RSP: 002b:000000c0001dd4f8 EFLAGS: 00000216 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 000000c00002c000 RCX: 00000000004afb40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 000000c0001dd538 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000216 R12: ffffffffffffffff
R13: 0000000000000163 R14: 0000000000000162 R15: 0000000000000200
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/04/28 12:13 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/28 12:13 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/28 12:13 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/28 11:01 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/28 11:01 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/28 11:01 net-old 37255e7a8f47 e3ecea2e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 22:08 net-old 37255e7a8f47 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 22:08 net-old 37255e7a8f47 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 22:08 net-old 37255e7a8f47 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 21:25 net-old 62b4011fa7be 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 21:25 net-old 62b4011fa7be 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
2020/04/27 21:25 net-old 62b4011fa7be 0ce7569e .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.