syzbot


general protection fault in nfc_alloc_send_skb

Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+7f23bcddf626e0593a39@syzkaller.appspotmail.com
Fix commit: dded08927ca3 nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind()
First crash: 220d, last: 220d

Cause bisection: introduced by (bisect log) :
commit c33b1cc62ac05c1dbb1cdafe2eb66da01c76ca8d
Author: Xiaoming Ni <nixiaoming@huawei.com>
Date: Thu Mar 25 03:51:10 2021 +0000

  nfc: fix refcount leak in llcp_sock_bind()

Crash: WARNING: refcount bug in nfc_llcp_local_put (log)
Repro: C syz .config
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 general protection fault in nfc_alloc_send_skb C error 1 219d 219d 0/1 upstream: reported C repro on 2021/12/31 22:21
Patch testing requests:
Created Duration User Patch Repo Result
2022/01/16 11:42 11m hdanton@sina.com patch upstream OK
2022/01/15 11:54 11m krzysztof.kozlowski@canonical.com https://github.com/krzk/linux 0b15d8c51584646c5fcd3a58053f11ac3b5f2cda OK
2022/01/15 11:51 11m krzysztof.kozlowski@canonical.com https://github.com/krzk/linux 2e3adbe9c476cdfdc8da33ab83cf7a25715579f1 OK
2022/01/15 11:46 13m krzysztof.kozlowski@canonical.com https://github.com/krzk/linux 6dcaa73089529a86e92d901c5f740b6529531c33 OK
2022/01/07 13:07 9m krzysztof.kozlowski@canonical.com https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ddec8ed2d4905d0967ce2ec432e440e582aa52c6 report log
2022/01/07 13:06 9m krzysztof.kozlowski@canonical.com https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 3770333b3f8cb7c9110889853afaa49777c26ea7 report log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc00000000c2: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000610-0x0000000000000617]
CPU: 1 PID: 7219 Comm: syz-executor408 Not tainted 5.16.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:nfc_alloc_send_skb+0x3a/0x190 net/nfc/core.c:722
Code: 54 41 89 d4 55 53 48 89 fb 48 8d ab 10 06 00 00 48 83 ec 08 e8 47 53 92 f8 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 14 01 00 00 48 8d bb 14 06 00
RSP: 0018:ffffc9000ca97888 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000000000c2 RSI: ffffffff88e474b9 RDI: 0000000000000000
RBP: 0000000000000610 R08: ffffc9000ca97938 R09: 0000000000000880
R10: ffffffff88e6031d R11: 000000000000087f R12: 0000000000000000
R13: 0000000000000082 R14: ffff88807ca8b000 R15: ffffc9000ca97938
FS:  00007f6b81ae2700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff1b2fd960 CR3: 000000007ca3a000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 nfc_llcp_send_ui_frame+0x2c0/0x430 net/nfc/llcp_commands.c:759
 llcp_sock_sendmsg+0x2b9/0x3a0 net/nfc/llcp_sock.c:803
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:724
 ____sys_sendmsg+0x331/0x810 net/socket.c:2409
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
 __sys_sendmmsg+0x195/0x470 net/socket.c:2549
 __do_sys_sendmmsg net/socket.c:2578 [inline]
 __se_sys_sendmmsg net/socket.c:2575 [inline]
 __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2575
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6b81b51f89
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6b81ae22f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000000033 RCX: 00007f6b81b51f89
RDX: 0000000000000006 RSI: 0000000020004540 RDI: 0000000000000003
RBP: 00007f6b81bdb3f8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000040 R11: 0000000000000246 R12: 00007f6b81bdb3f0
R13: 93cb663f6753dadd R14: 4b973dfbaeacdab3 R15: f981dd66eb1318f7
 </TASK>
Modules linked in:
---[ end trace 570920f865b173be ]---
RIP: 0010:nfc_alloc_send_skb+0x3a/0x190 net/nfc/core.c:722
Code: 54 41 89 d4 55 53 48 89 fb 48 8d ab 10 06 00 00 48 83 ec 08 e8 47 53 92 f8 48 89 ea 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 14 01 00 00 48 8d bb 14 06 00
RSP: 0018:ffffc9000ca97888 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 00000000000000c2 RSI: ffffffff88e474b9 RDI: 0000000000000000
RBP: 0000000000000610 R08: ffffc9000ca97938 R09: 0000000000000880
R10: ffffffff88e6031d R11: 000000000000087f R12: 0000000000000000
R13: 0000000000000082 R14: ffff88807ca8b000 R15: ffffc9000ca97938
FS:  00007f6b81ae2700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff1b2fd960 CR3: 000000007ca3a000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	54                   	push   %rsp
   1:	41 89 d4             	mov    %edx,%r12d
   4:	55                   	push   %rbp
   5:	53                   	push   %rbx
   6:	48 89 fb             	mov    %rdi,%rbx
   9:	48 8d ab 10 06 00 00 	lea    0x610(%rbx),%rbp
  10:	48 83 ec 08          	sub    $0x8,%rsp
  14:	e8 47 53 92 f8       	callq  0xf8925360
  19:	48 89 ea             	mov    %rbp,%rdx
  1c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  23:	fc ff df
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	0f b6 04 02          	movzbl (%rdx,%rax,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	74 08                	je     0x3a
  32:	3c 03                	cmp    $0x3,%al
  34:	0f 8e 14 01 00 00    	jle    0x14e
  3a:	48                   	rex.W
  3b:	8d                   	.byte 0x8d
  3c:	bb                   	.byte 0xbb
  3d:	14 06                	adc    $0x6,%al

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-selinux-root 2021/12/30 21:44 upstream eec4df26e24e 2e49f10d .config log report syz C general protection fault in nfc_alloc_send_skb
ci-upstream-kasan-gce-selinux-root 2021/12/30 19:41 upstream eec4df26e24e 2e49f10d .config log report info general protection fault in nfc_alloc_send_skb