BUG: unable to handle kernel NULL pointer dereference in corrupted

27 views
Skip to first unread message

syzbot

unread,
Oct 14, 2019, 6:06:09 AM10/14/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: e132c8d7 Linux 4.14.149
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12ce133b600000
kernel config: https://syzkaller.appspot.com/x/.config?x=65c18705ca007f2
dashboard link: https://syzkaller.appspot.com/bug?extid=f4c424b510a718452d72
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11cd26d7600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15b0fa30e00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+f4c424...@syzkaller.appspotmail.com

random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1571043757.987:36): avc: denied { map } for
pid=6969 comm="syz-executor323" path="/root/syz-executor323863313"
dev="sda1" ino=16483 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: unable to handle kernel NULL pointer dereference
BUG: KASAN: null-ptr-deref in memcpy include/linux/string.h:347 [inline]
BUG: KASAN: null-ptr-deref in llcp_sock_getname+0x38f/0x4a0
net/nfc/llcp_sock.c:532
Read of size 3 at addr (null) by task syz-executor323/6978
at (null)

IP: memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54
CPU: 0 PID: 6978 Comm: syz-executor323 Not tainted 4.14.149 #0
PGD 92f8b067
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
P4D 92f8b067
Call Trace:
PUD a63a2067
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x197 lib/dump_stack.c:53
PMD 0
kasan_report_error mm/kasan/report.c:349 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0x127/0x2af mm/kasan/report.c:393
Oops: 0000 [#1] PREEMPT SMP KASAN
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
Modules linked in:
memcpy+0x24/0x50 mm/kasan/kasan.c:302
CPU: 1 PID: 6976 Comm: syz-executor323 Not tainted 4.14.149 #0
memcpy include/linux/string.h:347 [inline]
llcp_sock_getname+0x38f/0x4a0 net/nfc/llcp_sock.c:532
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8880938dc080 task.stack: ffff888099a30000
SYSC_getpeername+0x120/0x270 net/socket.c:1715
RIP: 0010:memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54
RSP: 0018:ffff888099a37d20 EFLAGS: 00010246
RAX: ffff888099a37e0a RBX: ffff888099a37df8 RCX: 0000000000000003
RDX: 0000000000000003 RSI: 0000000000000000 RDI: ffff888099a37e0a
RBP: ffff888099a37d40 R08: 1ffff11013346fc1 R09: ffffed1013346fc2
R10: ffffed1013346fc1 R11: ffff888099a37e0c R12: 0000000000000003
R13: ffff888099a37e0a R14: 0000000000000000 R15: ffffffff87068700
FS: 0000000001b9d880(0000) GS:ffff8880aef00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000009bc15000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
memcpy include/linux/string.h:347 [inline]
llcp_sock_getname+0x38f/0x4a0 net/nfc/llcp_sock.c:532
SYSC_getpeername+0x120/0x270 net/socket.c:1715
SyS_getpeername+0x24/0x30 net/socket.c:1699
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
SyS_getpeername+0x24/0x30 net/socket.c:1699
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441299
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
RSP: 002b:00007ffe6da2e4d8 EFLAGS: 00000246
ORIG_RAX: 0000000000000034
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441299
RIP: 0033:0x441299
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RSP: 002b:00007ffe6da2e4d8 EFLAGS: 00000246
RBP: 00000000006cb018 R08: 00000000004002c8 R09: 00000000004002c8
ORIG_RAX: 0000000000000034
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000402010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441299
R13: 00000000004020a0 R14: 0000000000000000 R15: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
Code:
RBP: 00000000006cb018 R08: 00000000004002c8 R09: 00000000004002c8
90
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000402010
90
R13: 00000000004020a0 R14: 0000000000000000 R15: 0000000000000000
90
==================================================================
90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1
f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3 0f 1f 80 00 00 00
00 48 89 f8 48 83 fa 20 72 7e 40 38
RIP: memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54 RSP: ffff888099a37d20
CR2: 0000000000000000
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54
PGD 9bd05067 P4D 9bd05067 PUD a61c2067 PMD 0
Oops: 0000 [#2] PREEMPT SMP KASAN
Modules linked in:
CPU: 0 PID: 7017 Comm: syz-executor323 Tainted: G B D 4.14.149 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff8880a962a240 task.stack: ffff888098ad8000
RIP: 0010:memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54
RSP: 0018:ffff888098adfd20 EFLAGS: 00010246
RAX: ffff888098adfe0a RBX: ffff888098adfdf8 RCX: 0000000000000003
RDX: 0000000000000003 RSI: 0000000000000000 RDI: ffff888098adfe0a
RBP: ffff888098adfd40 R08: 1ffff1101315bfc1 R09: ffffed101315bfc2
R10: ffffed101315bfc1 R11: ffff888098adfe0c R12: 0000000000000003
R13: ffff888098adfe0a R14: 0000000000000000 R15: ffffffff87068700
FS: 0000000001b9d880(0000) GS:ffff8880aee00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000009f4c3000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
memcpy include/linux/string.h:347 [inline]
llcp_sock_getname+0x38f/0x4a0 net/nfc/llcp_sock.c:532
SYSC_getpeername+0x120/0x270 net/socket.c:1715
SyS_getpeername+0x24/0x30 net/socket.c:1699
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441299
RSP: 002b:00007ffe6da2e4d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000034
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441299
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 000000000000a209 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000402010
R13: 00000000004020a0 R14: 0000000000000000 R15: 0000000000000000
Code: 90 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07
f3 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3 0f
1f 80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38
RIP: memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:54 RSP: ffff888098adfd20
CR2: 0000000000000000
BUG: unable to handle kernel NULL pointer dereference at (null)


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Oct 21, 2019, 11:36:10 AM10/21/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: c3038e71 Linux 4.19.80
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17f80888e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=44c623b7e5432cee
dashboard link: https://syzkaller.appspot.com/bug?extid=416a511c9ff943512e64
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15814eef600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17bc98a7600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+416a51...@syzkaller.appspotmail.com

audit: type=1400 audit(1571668306.657:36): avc: denied { map } for
pid=7501 comm="syz-executor725" path="/root/syz-executor725997888"
dev="sda1" ino=16483 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: unable to handle kernel NULL pointer dereference at 0000000000000000
BUG: KASAN: null-ptr-deref in memcpy include/linux/string.h:348 [inline]
BUG: KASAN: null-ptr-deref in llcp_sock_getname+0x358/0x460
net/nfc/llcp_sock.c:531
PGD 8f0b8067
Read of size 63 at addr 0000000000000000 by task syz-executor725/7509
P4D 8f0b8067

PUD 998b2067
CPU: 1 PID: 7509 Comm: syz-executor725 Not tainted 4.19.80 #0
PMD 0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
Oops: 0000 [#1] PREEMPT SMP KASAN
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
CPU: 0 PID: 7510 Comm: syz-executor725 Not tainted 4.19.80 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
kasan_report_error mm/kasan/report.c:352 [inline]
kasan_report mm/kasan/report.c:412 [inline]
kasan_report.cold+0x199/0x2ba mm/kasan/report.c:396
RIP: 0010:memcpy_erms+0x6/0x10 arch/x86/lib/memcpy_64.S:55
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
Code: 90 90 90 90 eb 1e 0f 1f 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3
48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 <f3> a4 c3 0f 1f
80 00 00 00 00 48 89 f8 48 83 fa 20 72 7e 40 38 fe
memcpy+0x24/0x50 mm/kasan/kasan.c:302
RSP: 0018:ffff888092017ba8 EFLAGS: 00010246
memcpy include/linux/string.h:348 [inline]
llcp_sock_getname+0x358/0x460 net/nfc/llcp_sock.c:531
RAX: ffff888092017d32 RBX: ffff888092017d20 RCX: 000000000000003f
RDX: 000000000000003f RSI: 0000000000000000 RDI: ffff888092017d32
sock_getsockopt+0x149a/0x1c66 net/core/sock.c:1265
RBP: ffff888092017bc8 R08: 1ffff11012402fa6 R09: ffffed1012402faf
R10: ffffed1012402fae R11: ffff888092017d70 R12: 000000000000003f
R13: ffff888092017d32 R14: 0000000000000000 R15: ffff888094985b00
FS: 0000000001aa8880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000009c201000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
__sys_getsockopt+0x213/0x240 net/socket.c:1934
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
memcpy include/linux/string.h:348 [inline]
llcp_sock_getname+0x358/0x460 net/nfc/llcp_sock.c:531
sock_getsockopt+0x149a/0x1c66 net/core/sock.c:1265
__do_sys_getsockopt net/socket.c:1949 [inline]
__se_sys_getsockopt net/socket.c:1946 [inline]
__x64_sys_getsockopt+0xbe/0x150 net/socket.c:1946
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4412b9
Code: e8 ac e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 eb 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd270acb18 EFLAGS: 00000246
ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004412b9
__sys_getsockopt+0x213/0x240 net/socket.c:1934
RDX: 000000000000001c RSI: 0000000000000001 RDI: 0000000000000003
RBP: 00000000006cb018 R08: 0000000020000140 R09: 00000000004002c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402030
R13: 00000000004020c0 R14: 0000000000000000 R15: 0000000000000000
==================================================================

syzbot

unread,
Jun 24, 2021, 1:45:06 PM6/24/21
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 93e4ac2a9979a9a4ecc158409ed9c3044dc0ae1f
Author: Krzysztof Kozlowski <krzysztof...@canonical.com>
Date: Mon May 31 07:21:38 2021 +0000

nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=121ea20c300000
start commit: 14260788 Linux 4.19.86
git tree: linux-4.19.y
kernel config: https://syzkaller.appspot.com/x/.config?x=713063ba2df50c01
dashboard link: https://syzkaller.appspot.com/bug?extid=416a511c9ff943512e64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14b2767ee00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14d1bcdae00000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages