KASAN: null-ptr-deref Write in rdma_resolve_addr

22 views
Skip to first unread message

syzbot

unread,
Mar 9, 2018, 6:59:03 PM3/9/18
to dasaratharama...@intel.com, dled...@redhat.com, j...@ziepe.ca, leo...@mellanox.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, ma...@mellanox.com, mo...@mellanox.com, pa...@mellanox.com, syzkall...@googlegroups.com
Hello,

syzbot hit the following crash on upstream commit
719ea86151f31f9d30dc854e028d05dc4afb3224 (Fri Mar 9 17:46:14 2018 +0000)
Merge branch 'overlayfs-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs

syzkaller reproducer is attached.
Raw console output is attached.
compiler: gcc (GCC) 7.1.1 20170620
.config is attached.
user-space arch: i386

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+1d8c43...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

audit: type=1400 audit(1520631872.633:8): avc: denied { map } for
pid=4111 comm="syz-execprog" path="/root/syzkaller-shm114526152" dev="sda1"
ino=16482 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:file_t:s0 tclass=file permissive=1
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: null-ptr-deref in memcpy include/linux/string.h:345 [inline]
BUG: KASAN: null-ptr-deref in rdma_resolve_addr+0x12e/0x26c0
drivers/infiniband/core/cma.c:2920
Write of size 28 at addr 00000000000000a0 by task syz-executor0/4154

CPU: 0 PID: 4154 Comm: syz-executor0 Not tainted 4.16.0-rc4+ #257
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x24d lib/dump_stack.c:53
kasan_report_error mm/kasan/report.c:352 [inline]
kasan_report+0x140/0x360 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x137/0x190 mm/kasan/kasan.c:267
memcpy+0x37/0x50 mm/kasan/kasan.c:303
memcpy include/linux/string.h:345 [inline]
rdma_resolve_addr+0x12e/0x26c0 drivers/infiniband/core/cma.c:2920
ucma_resolve_ip+0x142/0x1f0 drivers/infiniband/core/ucma.c:677
ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1627
__vfs_write+0xef/0x970 fs/read_write.c:480
vfs_write+0x189/0x510 fs/read_write.c:544
SYSC_write fs/read_write.c:589 [inline]
SyS_write+0xef/0x220 fs/read_write.c:581
do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7efec99
RSP: 002b:00000000f7ed909c EFLAGS: 00000286 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00000000200025c0
RDX: 0000000000000048 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
==================================================================
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 4154 Comm: syz-executor0 Tainted: G B 4.16.0-rc4+
#257
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x24d lib/dump_stack.c:53
panic+0x1e4/0x41c kernel/panic.c:183
kasan_end_report+0x50/0x50 mm/kasan/report.c:180
kasan_report_error mm/kasan/report.c:359 [inline]
kasan_report+0x149/0x360 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x137/0x190 mm/kasan/kasan.c:267
memcpy+0x37/0x50 mm/kasan/kasan.c:303
memcpy include/linux/string.h:345 [inline]
rdma_resolve_addr+0x12e/0x26c0 drivers/infiniband/core/cma.c:2920
ucma_resolve_ip+0x142/0x1f0 drivers/infiniband/core/ucma.c:677
ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1627
__vfs_write+0xef/0x970 fs/read_write.c:480
vfs_write+0x189/0x510 fs/read_write.c:544
SYSC_write fs/read_write.c:589 [inline]
SyS_write+0xef/0x220 fs/read_write.c:581
do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7efec99
RSP: 002b:00000000f7ed909c EFLAGS: 00000286 ORIG_RAX: 0000000000000004
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00000000200025c0
RDX: 0000000000000048 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
If you want to test a patch for this bug, please reply with:
#syz test: git://repo/address.git branch
and provide the patch inline or as an attachment.
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
raw.log.txt
repro.syz.txt
config.txt

syzbot

unread,
Mar 14, 2018, 12:39:04 AM3/14/18
to dasaratharama...@intel.com, dled...@redhat.com, j...@ziepe.ca, leo...@mellanox.com, linux-...@vger.kernel.org, linux...@vger.kernel.org, ma...@mellanox.com, mo...@mellanox.com, pa...@mellanox.com, syzkall...@googlegroups.com
syzbot has found reproducer for the following crash on upstream commit
fc6eabbbf8ef99efed778dd5afabc83c21dba585 (Mon Mar 12 17:47:03 2018 +0000)
Merge tag 'nfs-for-4.16-4' of
git://git.linux-nfs.org/projects/trondmy/linux-nfs

So far this crash happened 16 times on upstream.
C reproducer is attached.
syzkaller reproducer is attached.
Raw console output is attached.
compiler: gcc (GCC) 7.1.1 20170620
.config is attached.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+1d8c43...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed.

==================================================================
BUG: KASAN: null-ptr-deref in memcpy include/linux/string.h:345 [inline]
BUG: KASAN: null-ptr-deref in rdma_resolve_addr+0x12e/0x26c0
drivers/infiniband/core/cma.c:2920
Write of size 28 at addr 00000000000000a0 by task syzkaller326171/7671

CPU: 0 PID: 7671 Comm: syzkaller326171 Not tainted 4.16.0-rc5+ #352
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x24d lib/dump_stack.c:53
kasan_report_error mm/kasan/report.c:352 [inline]
kasan_report+0x140/0x360 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x137/0x190 mm/kasan/kasan.c:267
memcpy+0x37/0x50 mm/kasan/kasan.c:303
memcpy include/linux/string.h:345 [inline]
rdma_resolve_addr+0x12e/0x26c0 drivers/infiniband/core/cma.c:2920
ucma_resolve_ip+0x142/0x1f0 drivers/infiniband/core/ucma.c:677
ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1633
__vfs_write+0xef/0x970 fs/read_write.c:480
vfs_write+0x189/0x510 fs/read_write.c:544
SYSC_write fs/read_write.c:589 [inline]
SyS_write+0xef/0x220 fs/read_write.c:581
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446b29
RSP: 002b:00007f72069e1da8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000006e29fc RCX: 0000000000446b29
RDX: 000000000000002e RSI: 0000000020000c40 RDI: 0000000000000004
RBP: 00000000006e29f8 R08: 00007f72069e2700 R09: 0000000000000000
R10: 00007f72069e2700 R11: 0000000000000246 R12: 006d635f616d6472
R13: 2f646e6162696e69 R14: 666e692f7665642f R15: 0000000000000004
==================================================================
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 7671 Comm: syzkaller326171 Tainted: G B
4.16.0-rc5+ #352
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x194/0x24d lib/dump_stack.c:53
panic+0x1e4/0x41c kernel/panic.c:183
kasan_end_report+0x50/0x50 mm/kasan/report.c:180
kasan_report_error mm/kasan/report.c:359 [inline]
kasan_report+0x149/0x360 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x137/0x190 mm/kasan/kasan.c:267
memcpy+0x37/0x50 mm/kasan/kasan.c:303
memcpy include/linux/string.h:345 [inline]
rdma_resolve_addr+0x12e/0x26c0 drivers/infiniband/core/cma.c:2920
ucma_resolve_ip+0x142/0x1f0 drivers/infiniband/core/ucma.c:677
ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1633
__vfs_write+0xef/0x970 fs/read_write.c:480
vfs_write+0x189/0x510 fs/read_write.c:544
SYSC_write fs/read_write.c:589 [inline]
SyS_write+0xef/0x220 fs/read_write.c:581
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x446b29
RSP: 002b:00007f72069e1da8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000006e29fc RCX: 0000000000446b29
RDX: 000000000000002e RSI: 0000000020000c40 RDI: 0000000000000004
RBP: 00000000006e29f8 R08: 00007f72069e2700 R09: 0000000000000000
R10: 00007f72069e2700 R11: 0000000000000246 R12: 006d635f616d6472
R13: 2f646e6162696e69 R14: 666e692f7665642f R15: 0000000000000004
raw.log.txt
repro.syz.txt
repro.c.txt
config.txt
Reply all
Reply to author
Forward
0 new messages