KASAN: null-ptr-deref Read in llcp_sock_getname

22 views
Skip to first unread message

syzbot

unread,
Oct 31, 2019, 1:39:08 AM10/31/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: ef244c30 Linux 4.19.81
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17de730ae00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a3e67c0671e5c5e7
dashboard link: https://syzkaller.appspot.com/bug?extid=80fb126e7f7d8b1a5914
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

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

==================================================================
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
Read of size 1 at addr 0000000000000000 by task syz-executor.4/27784

CPU: 0 PID: 27784 Comm: syz-executor.4 Not tainted 4.19.81 #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+0x172/0x1f0 lib/dump_stack.c:113
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
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
memcpy+0x24/0x50 mm/kasan/kasan.c:302
memcpy include/linux/string.h:348 [inline]
llcp_sock_getname+0x358/0x460 net/nfc/llcp_sock.c:531
__sys_getpeername+0x12b/0x290 net/socket.c:1735
__do_sys_getpeername net/socket.c:1748 [inline]
__se_sys_getpeername net/socket.c:1745 [inline]
__x64_sys_getpeername+0x73/0xb0 net/socket.c:1745
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x459f49
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:00007f8640beec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000034
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459f49
RDX: 0000000020000840 RSI: 00000000200007c0 RDI: 0000000000000023
RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f8640bef6d4
R13: 00000000004c0bf0 R14: 00000000004d37a8 R15: 00000000ffffffff
==================================================================
audit: type=1800 audit(1572496701.990:285): pid=27804 uid=0 auid=4294967295
ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
op=collect_data cause=failed(directio) comm="syz-executor.0" name="file0"
dev="loop0" ino=88 res=0


---
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

unread,
Dec 8, 2019, 3:14:10 PM12/8/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: fb683b5e Linux 4.19.88
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14ca5c2ee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=aa0c39a6a0078b1c
dashboard link: https://syzkaller.appspot.com/bug?extid=80fb126e7f7d8b1a5914
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1095c282e00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14def446e00000

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

audit: type=1400 audit(1575835857.214:35): avc: denied { map } for
pid=7641 comm="bash" path="/bin/bash" dev="sda1" ino=1457
scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=system_u:object_r:file_t:s0 tclass=file permissive=1
audit: type=1400 audit(1575835863.834:36): avc: denied { map } for
pid=7656 comm="syz-executor943" path="/root/syz-executor943995212"
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: 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
Read of size 43 at addr 0000000000000000 by task syz-executor943/7656

CPU: 1 PID: 7656 Comm: syz-executor943 Not tainted 4.19.88-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_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
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
memcpy+0x24/0x50 mm/kasan/kasan.c:302
memcpy include/linux/string.h:348 [inline]
llcp_sock_getname+0x358/0x460 net/nfc/llcp_sock.c:531
__sys_getpeername+0x12b/0x290 net/socket.c:1735
__do_sys_getpeername net/socket.c:1748 [inline]
__se_sys_getpeername net/socket.c:1745 [inline]
__x64_sys_getpeername+0x73/0xb0 net/socket.c:1745
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440349
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff33e94a18 EFLAGS: 00000246 ORIG_RAX: 0000000000000034
RAX: ffffffffffffffda RBX: fe7f62c7329d9aaa RCX: 0000000000440349
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 65e500001d7ef6cc R08: 00007fff33e94b88 R09: 00007fff33e94b88
R10: 00007fff33e94b88 R11: 0000000000000246 R12: 211e267fffffffff
R13: ffff000000004d02 R14: aac8030fa4d62b9c R15: d303a55487e71188
==================================================================

Reply all
Reply to author
Forward
0 new messages