syzbot


KASAN: stack-out-of-bounds Read in rdma_bind_addr

Status: closed as dup on 2018/03/22 15:26
Reported-by: syzbot+28b14b75b4a9314ead4a@syzkaller.appspotmail.com
First crash: 1797d, last: 1783d
Duplicate of (1):
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: null-ptr-deref Write in rdma_resolve_addr C 66 1785d 1796d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: stack-out-of-bounds Read in rdma_bind_addr (2) C 4 1776d 1776d 0/24 closed as dup on 2018/04/04 06:24

Sample crash report:
audit: type=1400 audit(1521780999.588:6): avc:  denied  { map } for  pid=4230 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(1521781005.981:7): avc:  denied  { map } for  pid=4244 comm="syzkaller174354" path="/root/syzkaller174354706" dev="sda1" ino=16481 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: stack-out-of-bounds in memcpy include/linux/string.h:345 [inline]
BUG: KASAN: stack-out-of-bounds in rdma_bind_addr+0x13b/0x1d60 drivers/infiniband/core/cma.c:3361
Read of size 48 at addr ffff8801c3d4fa50 by task syzkaller174354/4244

CPU: 1 PID: 4244 Comm: syzkaller174354 Not tainted 4.16.0-rc6+ #362
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
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/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+0x23/0x50 mm/kasan/kasan.c:302
 memcpy include/linux/string.h:345 [inline]
 rdma_bind_addr+0x13b/0x1d60 drivers/infiniband/core/cma.c:3361
 ucma_bind_ip+0x10a/0x190 drivers/infiniband/core/ucma.c:639
 ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1649
 __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:0x43fdd9
RSP: 002b:00007ffd8e4d62d8 EFLAGS: 00000217 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fdd9
RDX: 0000000000000090 RSI: 0000000020000080 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000217 R12: 0000000000401700
R13: 0000000000401790 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:ffffea00070f53c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 ffffea00070f0101 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c3d4f900: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f2
 ffff8801c3d4f980: f2 f2 f2 f2 f2 f2 04 f2 f2 f2 f3 f3 f3 f3 00 00
>ffff8801c3d4fa00: 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 f2 f2
                                                             ^
 ffff8801c3d4fa80: f2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
 ffff8801c3d4fb00: f1 f1 f1 00 f2 f2 f2 f3 f3 f3 f3 00 00 00 00 00
==================================================================

Crashes (10):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce 2018/03/23 04:59 upstream c4f4d2f91772 2e9d9054 .config console log report syz C
ci-upstream-kasan-gce 2018/03/08 18:30 upstream 1b88accf6a65 acd0caa5 .config console log report syz C
ci-upstream-kasan-gce-386 2018/03/23 04:59 upstream c4f4d2f91772 2e9d9054 .config console log report syz
ci-upstream-kasan-gce-386 2018/03/08 18:22 upstream 1b88accf6a65 acd0caa5 .config console log report syz
ci-upstream-kasan-gce 2018/03/21 04:39 upstream 3215b9d57a2c 113a43ff .config console log report
ci-upstream-kasan-gce 2018/03/18 13:11 upstream 8f5fd927c3a7 08dacaa0 .config console log report
ci-upstream-kasan-gce 2018/03/16 22:36 upstream df09348f78dc 08dacaa0 .config console log report
ci-upstream-kasan-gce 2018/03/11 16:00 upstream 3266b5bd97ea 36d1c454 .config console log report
ci-upstream-kasan-gce-386 2018/03/17 22:22 upstream 8f5fd927c3a7 08dacaa0 .config console log report
ci-upstream-kasan-gce-386 2018/03/17 21:46 upstream 8f5fd927c3a7 08dacaa0 .config console log report
* Struck through repros no longer work on HEAD.