sctp_copy_one_addr+0x5d/0x170 net/sctp/bind_addr.c:449 sctp_bind_addr_copy+0x173/0x47c net/sctp/bind_addr.c:71 sctp_assoc_set_bind_addr_from_ep+0x165/0x1c0 net/sctp/associola.c:1600 __sctp_connect+0x6ca/0xd90 net/sctp/socket.c:1215 ================================================================== BUG: KASAN: slab-out-of-bounds in find_first_bit+0xf7/0x100 lib/find_bit.c:107 __sctp_setsockopt_connectx+0x134/0x190 net/sctp/socket.c:1368 Read of size 8 at addr ffff8801d43ec010 by task syz-executor3/10096 sctp_getsockopt_connectx3 net/sctp/socket.c:1453 [inline] sctp_getsockopt+0xc1e/0x7c55 net/sctp/socket.c:7484 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:3042 __sys_getsockopt+0x1ad/0x390 net/socket.c:1949 __do_sys_getsockopt net/socket.c:1960 [inline] __se_sys_getsockopt net/socket.c:1957 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:1957 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x455e29 Code: 1d ba 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 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb843bb5c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 00007fb843bb66d4 RCX: 0000000000455e29 RDX: 000000000000006f RSI: 0000000000000084 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 000000002045c000 R09: 0000000000000000 R10: 0000000020707ff0 R11: 0000000000000246 R12: 0000000000000014 R13: 00000000004c53a0 R14: 00000000004ca9a0 R15: 000000000000000e CPU: 1 PID: 10096 Comm: syz-executor3 Not tainted 4.18.0-rc3-next-20180709+ #2 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+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 find_first_bit+0xf7/0x100 lib/find_bit.c:107 shrink_slab_memcg mm/vmscan.c:580 [inline] shrink_slab+0x5d0/0xdb0 mm/vmscan.c:672 ------------[ cut here ]------------ kernel BUG at mm/vmscan.c:593! invalid opcode: 0000 [#1] SMP KASAN shrink_node+0x429/0x16a0 mm/vmscan.c:2736 CPU: 0 PID: 1532 Comm: kswapd0 Not tainted 4.18.0-rc3-next-20180709+ #2 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:shrink_slab_memcg mm/vmscan.c:593 [inline] RIP: 0010:shrink_slab+0xb3e/0xdb0 mm/vmscan.c:672 Code: 8d a8 fd ff ff shrink_zones mm/vmscan.c:2965 [inline] do_try_to_free_pages+0x3e7/0x1290 mm/vmscan.c:3027 f0 48 0f b3 08 try_to_free_pages+0x4b2/0xb80 mm/vmscan.c:3242 e8 ed b5 da ff 48 8b 85 c0 fd ff ff c7 00 __perform_reclaim mm/page_alloc.c:3769 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:3790 [inline] __alloc_pages_slowpath+0x953/0x2d00 mm/page_alloc.c:4191 f8 f8 f8 f8 c6 40 04 f8 e9 5d fb ff ff e8 d2 b5 da ff <0f> 0b e8 cb b5 da ff 48 __alloc_pages_nodemask+0xa7c/0xdb0 mm/page_alloc.c:4390 8b 9d d8 fd ff ff 31 ff 48 __alloc_pages include/linux/gfp.h:456 [inline] __alloc_pages_node include/linux/gfp.h:469 [inline] kmem_getpages mm/slab.c:1409 [inline] cache_grow_begin+0x91/0x710 mm/slab.c:2677 89 de e8 fallback_alloc+0x203/0x2c0 mm/slab.c:3219 ea ____cache_alloc_node+0x1c7/0x1e0 mm/slab.c:3287 b6 slab_alloc_node mm/slab.c:3327 [inline] kmem_cache_alloc_node_trace+0xe9/0x770 mm/slab.c:3661 RSP: 0018:ffff8801d3ec74c0 EFLAGS: 00010293 kmalloc_node include/linux/slab.h:551 [inline] new_vmap_block mm/vmalloc.c:856 [inline] vb_alloc mm/vmalloc.c:1009 [inline] vm_map_ram+0x663/0xea0 mm/vmalloc.c:1167 RAX: ffff8801d3eb40c0 RBX: ffff8801d3ec7710 RCX: ffffffff81a1c182 RDX: 0000000000000000 RSI: ffffffff81a1c48e RDI: 0000000000000007 RBP: ffff8801d3ec7738 R08: ffff8801d3eb40c0 R09: ffffed0039836518 R10: ffffed0039836518 R11: ffff8801cc1b28c7 R12: dffffc0000000000 R13: ffff8801cc3331f0 R14: 0000000000000000 R15: ffff8801d3ec7550 FS: 0000000000000000(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000001ddb7d0 CR3: 00000001b388d000 CR4: 00000000001406f0 DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: ion_heap_clear_pages+0x2a/0x70 drivers/staging/android/ion/ion_heap.c:100 ion_heap_sglist_zero+0x224/0x2d0 drivers/staging/android/ion/ion_heap.c:121 shrink_node+0x429/0x16a0 mm/vmscan.c:2736 ion_heap_buffer_zero+0xf8/0x150 drivers/staging/android/ion/ion_heap.c:143 ion_system_heap_free+0x1d8/0x250 drivers/staging/android/ion/ion_system_heap.c:163 ion_buffer_destroy+0x15c/0x1c0 drivers/staging/android/ion/ion.c:119 _ion_heap_freelist_drain+0x445/0x6b0 drivers/staging/android/ion/ion_heap.c:199 kswapd_shrink_node mm/vmscan.c:3458 [inline] balance_pgdat+0x7ca/0x1010 mm/vmscan.c:3568 ion_heap_freelist_drain+0x1f/0x30 drivers/staging/android/ion/ion_heap.c:209 ion_buffer_create drivers/staging/android/ion/ion.c:86 [inline] ion_alloc+0x39b/0xa60 drivers/staging/android/ion/ion.c:409 kswapd+0x82e/0x12f0 mm/vmscan.c:3790 ion_ioctl+0x216/0x41e drivers/staging/android/ion/ion-ioctl.c:76 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 kthread+0x345/0x410 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:415 Modules linked in: ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 Dumping ftrace buffer: do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 (ftrace buffer empty) ---[ end trace 8d88eea635191b57 ]--- RIP: 0010:shrink_slab_memcg mm/vmscan.c:593 [inline] RIP: 0010:shrink_slab+0xb3e/0xdb0 mm/vmscan.c:672 Code: entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x455e29 8d Code: 1d ba fb a8 ff c3 66 2e 0f 1f fd 84 00 00 00 00 ff 00 66 90 48 ff 89 f8 48 89 f0 f7 48 89 d6 48 48 89 ca 4d 89 c2 0f 4d 89 c8 4c b3 8b 4c 24 08 08 0f 05 <48> 3d 01 e8 f0 ff ff 0f 83 ed eb b9 fb ff c3 b5 66 2e 0f 1f 84 da 00 00 00 00 ff RSP: 002b:00007f165c4a2c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f165c4a36d4 RCX: 0000000000455e29 48 RDX: 0000000020000500 RSI: 00000000c0184900 RDI: 0000000000000015 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff 8b R13: 00000000004bd9c2 R14: 00000000004cc128 R15: 0000000000000000 85 Allocated by task 7445: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 c0 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3689 fd kmalloc_node include/linux/slab.h:555 [inline] kvmalloc_node+0x65/0xf0 mm/util.c:423 kvmalloc include/linux/mm.h:557 [inline] memcg_expand_one_shrinker_map mm/memcontrol.c:341 [inline] memcg_expand_shrinker_maps+0x1b1/0x3c0 mm/memcontrol.c:416 prealloc_memcg_shrinker mm/vmscan.c:185 [inline] prealloc_shrinker+0x29e/0x450 mm/vmscan.c:366 ff alloc_super+0x8dd/0xb10 fs/super.c:264 sget_userns+0x276/0x860 fs/super.c:615 ff sget+0x10b/0x150 fs/super.c:667 mount_nodev+0x38/0x120 fs/super.c:1393 c7 fuse_mount+0x34/0x40 fs/fuse/inode.c:1212 legacy_get_tree+0x118/0x440 fs/fs_context.c:659 00 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1751 do_new_mount fs/namespace.c:2567 [inline] do_mount+0x6c1/0x1fb0 fs/namespace.c:2889 f8 ksys_mount+0x12d/0x140 fs/namespace.c:3105 __do_sys_mount fs/namespace.c:3119 [inline] __se_sys_mount fs/namespace.c:3116 [inline] __x64_sys_mount+0xbe/0x150 fs/namespace.c:3116 f8 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe f8 Freed by task 2869: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 f8 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x260 mm/slab.c:3813 c6 single_release+0x8f/0xb0 fs/seq_file.c:596 __fput+0x35d/0x930 fs/file_table.c:215 40 ____fput+0x15/0x20 fs/file_table.c:251 task_work_run+0x1ec/0x2a0 kernel/task_work.c:113 04 tracehook_notify_resume include/linux/tracehook.h:192 [inline] exit_to_usermode_loop+0x313/0x370 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 f8 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801d43ec000 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 16 bytes inside of 32-byte region [ffff8801d43ec000, ffff8801d43ec020) The buggy address belongs to the page: page:ffffea000750fb00 count:1 mapcount:0 mapping:ffff8801da8001c0 index:0xffff8801d43ecfc1 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea00073874c8 ffffea00074c9e88 ffff8801da8001c0 raw: ffff8801d43ecfc1 ffff8801d43ec000 0000000100000039 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d43ebf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d43ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d43ec000: 00 00 06 fc fc fc fc fc 00 00 06 fc fc fc fc fc ^ ffff8801d43ec080: 00 00 06 fc fc fc fc fc 00 00 06 fc fc fc fc fc ffff8801d43ec100: 00 00 06 fc fc fc fc fc 00 00 06 fc fc fc fc fc ==================================================================