syzbot


KASAN: slab-out-of-bounds in rds_cong_queue_updates

Status: closed as invalid on 2018/03/06 09:01
Subsystems: rds
[Documentation on labels]
Reported-by: syzbot+c6e0380895bd7dc4b6bd@syzkaller.appspotmail.com
First crash: 2735d, last: 2735d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __read_once_size include/linux/compiler.h:188 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: slab-out-of-bounds in refcount_read include/linux/refcount.h:42 [inline]
BUG: KASAN: slab-out-of-bounds in check_net include/net/net_namespace.h:228 [inline]
BUG: KASAN: slab-out-of-bounds in rds_destroy_pending net/rds/rds.h:868 [inline]
BUG: KASAN: slab-out-of-bounds in rds_cong_queue_updates+0x4d3/0x4f0 net/rds/cong.c:226
WARNING: CPU: 0 PID: 6694 at net/bridge/netfilter/ebtables.c:2063 ebt_size_mwt net/bridge/netfilter/ebtables.c:2063 [inline]
WARNING: CPU: 0 PID: 6694 at net/bridge/netfilter/ebtables.c:2063 size_entry_mwt net/bridge/netfilter/ebtables.c:2140 [inline]
WARNING: CPU: 0 PID: 6694 at net/bridge/netfilter/ebtables.c:2063 compat_copy_entries+0xd92/0x1150 net/bridge/netfilter/ebtables.c:2179
Read of size 4 at addr ffff8801b3c58144 by task syz-executor4/6684

CPU: 1 PID: 6684 Comm: syz-executor4 Not tainted 4.16.0-rc4+ #252
Kernel panic - not syncing: panic_on_warn set ...

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
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
 __read_once_size include/linux/compiler.h:188 [inline]
 atomic_read arch/x86/include/asm/atomic.h:27 [inline]
 refcount_read include/linux/refcount.h:42 [inline]
 check_net include/net/net_namespace.h:228 [inline]
 rds_destroy_pending net/rds/rds.h:868 [inline]
 rds_cong_queue_updates+0x4d3/0x4f0 net/rds/cong.c:226
 rds_recv_rcvbuf_delta.part.2+0x289/0x320 net/rds/recv.c:118
 rds_recv_rcvbuf_delta net/rds/recv.c:377 [inline]
 rds_recv_incoming+0xeb4/0x11d0 net/rds/recv.c:377
 rds_loop_xmit+0x149/0x320 net/rds/loop.c:82
 rds_send_xmit+0xbcd/0x26b0 net/rds/send.c:355
 rds_sendmsg+0x1fcb/0x2390 net/rds/send.c:1208
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:640
 SYSC_sendto+0x361/0x5c0 net/socket.c:1747
 SyS_sendto+0x40/0x50 net/socket.c:1715
 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:0xf7fbcc99
RSP: 002b:00000000f77b809c EFLAGS: 00000286 ORIG_RAX: 0000000000000171
RAX: ffffffffffffffda RBX: 0000000000000014 RCX: 0000000020f7db7f
RDX: 0000000000000481 RSI: 0000000000000000 RDI: 000000002069affb
RBP: 0000000000000010 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

CPU: 0 PID: 6694 Comm: syz-executor1 Not tainted 4.16.0-rc4+ #252
Allocated by task 4277:
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
Call Trace:
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3541
 getname_flags+0xcb/0x580 fs/namei.c:138
 getname+0x19/0x20 fs/namei.c:209
 do_sys_open+0x2e7/0x6d0 fs/open.c:1053
 C_SYSC_open fs/open.c:1096 [inline]
 compat_SyS_open+0x2a/0x40 fs/open.c:1094
 panic+0x1e4/0x41c kernel/panic.c:183
 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

Freed by task 4277:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 __warn+0x1dc/0x200 kernel/panic.c:547
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3485 [inline]
 kmem_cache_free+0x83/0x2a0 mm/slab.c:3743
 report_bug+0x211/0x2d0 lib/bug.c:184
 putname+0xee/0x130 fs/namei.c:258
 do_sys_open+0x31b/0x6d0 fs/open.c:1068
 fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
 C_SYSC_open fs/open.c:1096 [inline]
 compat_SyS_open+0x2a/0x40 fs/open.c:1094
 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline]
 do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392
 fixup_bug arch/x86/kernel/traps.c:247 [inline]
 do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139

The buggy address belongs to the object at ffff8801b3c58580
 which belongs to the cache names_cache of size 4096
The buggy address is located 1084 bytes to the left of
 4096-byte region [ffff8801b3c58580, ffff8801b3c59580)
The buggy address belongs to the page:
page:ffffea0006cf1600 count:1 mapcount:0 mapping:ffff8801b3c58580 index:0x0
 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801b3c58580 0000000000000000 0000000100000001
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
raw: ffffea0006e9eaa0 ffffea0006e97ba0 ffff8801da5d6600 0000000000000000
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
page dumped because: kasan: bad access detected
RIP: 0010:ebt_size_mwt net/bridge/netfilter/ebtables.c:2063 [inline]
RIP: 0010:size_entry_mwt net/bridge/netfilter/ebtables.c:2140 [inline]
RIP: 0010:compat_copy_entries+0xd92/0x1150 net/bridge/netfilter/ebtables.c:2179

RSP: 0018:ffff8801d35777e8 EFLAGS: 00010216
Memory state around the buggy address:
RAX: 0000000000010000 RBX: 0000000000000000 RCX: ffffffff851ad5c2
RDX: 00000000000004b2 RSI: ffffc90001419000 RDI: 0000000000000000
 ffff8801b3c58000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
RBP: ffff8801d3577968 R08: 000000000000004c R09: 0000000000000000
 ffff8801b3c58080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
R10: ffffffff88613380 R11: 0000000000000001 R12: 0000000000000004
R13: dffffc0000000000 R14: ffff8801d35779c8 R15: 0000000000000004
>ffff8801b3c58100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                           ^
 ffff8801b3c58180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801b3c58200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
 compat_do_replace+0x398/0x7d0 net/bridge/netfilter/ebtables.c:2268
 compat_do_ebt_set_ctl+0x22a/0x2d0 net/bridge/netfilter/ebtables.c:2350
 compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline]
 compat_nf_setsockopt+0x88/0x130 net/netfilter/nf_sockopt.c:156
 compat_ip_setsockopt+0x8b/0xd0 net/ipv4/ip_sockglue.c:1285
 inet_csk_compat_setsockopt+0x95/0x120 net/ipv4/inet_connection_sock.c:1041
 compat_tcp_setsockopt+0x3d/0x70 net/ipv4/tcp.c:2916
 compat_sock_common_setsockopt+0xb2/0x140 net/core/sock.c:2986
 C_SYSC_setsockopt net/compat.c:403 [inline]
 compat_SyS_setsockopt+0x17c/0x410 net/compat.c:386
 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:0xf7fd6c99
RSP: 002b:00000000f77d209c EFLAGS: 00000286 ORIG_RAX: 000000000000016e
RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000000000000
RDX: 0000000000000080 RSI: 00000000200000c0 RDI: 00000000000001c0
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..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/06 03:24 upstream 094b58e1040a aef0b792 .config console log report ci-upstream-kasan-gce-386
* Struck through repros no longer work on HEAD.