syzbot


KASAN: null-ptr-deref Write in x25_connect

Status: fixed on 2020/02/18 14:31
Subsystems: x25
[Documentation on labels]
Reported-by: syzbot+429c200ffc8772bfe070@syzkaller.appspotmail.com
Fix commit: e21dba7a4df4 net/x25: fix nonblocking connect
First crash: 1636d, last: 1636d
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 4.19 00/92] 4.19.100-stable review 98 (98) 2020/01/31 13:57
[PATCH 4.9 000/271] 4.9.212-stable review 283 (283) 2020/01/29 22:35
[PATCH 5.4 000/104] 5.4.16-stable review 113 (113) 2020/01/29 15:36
[PATCH 4.14 00/46] 4.14.169-stable review 51 (51) 2020/01/29 14:42
[PATCH 4.4 000/183] 4.4.212-stable review 190 (190) 2020/01/29 13:12
[PATCH] net/x25: fix nonblocking connect 2 (2) 2020/01/10 02:40
[PATCH 1/4] [net-next] wan: remove stale Kconfig entries 12 (12) 2019/12/11 13:34
KASAN: null-ptr-deref Write in x25_connect 1 (2) 2019/12/06 12:41

Sample crash report:
==================================================================
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:253 [inline]
BUG: KASAN: null-ptr-deref in refcount_dec_and_test include/linux/refcount.h:281 [inline]
BUG: KASAN: null-ptr-deref in x25_neigh_put include/net/x25.h:252 [inline]
BUG: KASAN: null-ptr-deref in x25_connect+0x974/0x1020 net/x25/af_x25.c:820
Write of size 4 at addr 00000000000000c8 by task syz-executor.5/32400

CPU: 1 PID: 32400 Comm: syz-executor.5 Not tainted 5.4.0-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+0x197/0x210 lib/dump_stack.c:118
 __kasan_report.cold+0x5/0x41 mm/kasan/report.c:510
 kasan_report+0x12/0x20 mm/kasan/common.c:634
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
 __kasan_check_write+0x14/0x20 mm/kasan/common.c:98
 atomic_fetch_sub include/asm-generic/atomic-instrumented.h:199 [inline]
 refcount_sub_and_test include/linux/refcount.h:253 [inline]
 refcount_dec_and_test include/linux/refcount.h:281 [inline]
 x25_neigh_put include/net/x25.h:252 [inline]
 x25_connect+0x974/0x1020 net/x25/af_x25.c:820
 __sys_connect_file+0x25d/0x2e0 net/socket.c:1847
 __sys_connect+0x51/0x90 net/socket.c:1860
 __do_sys_connect net/socket.c:1871 [inline]
 __se_sys_connect net/socket.c:1868 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1868
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45a679
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fa58a10ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045a679
RDX: 0000000000000012 RSI: 0000000020000000 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa58a10f6d4
R13: 00000000004c0f1c R14: 00000000004d4088 R15: 00000000ffffffff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/12/01 21:00 net-old 9bd19c63a4bc a76bf83f .config console log report ci-upstream-net-this-kasan-gce
* Struck through repros no longer work on HEAD.