================================================================== BUG: KASAN: slab-out-of-bounds in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:110 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_ip_gc_test net/netfilter/ipset/ip_set_bitmap_ip.c:76 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_ip_gc+0x100/0x4f0 net/netfilter/ipset/ip_set_bitmap_gen.h:277 Read of size 8 at addr ffff888052309140 by task syz-executor.0/9642 CPU: 0 PID: 9642 Comm: syz-executor.0 Not tainted 5.5.0-rc6-next-20200116-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 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:641 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192 __kasan_check_read+0x11/0x20 mm/kasan/common.c:95 test_bit include/asm-generic/bitops/instrumented-non-atomic.h:110 [inline] bitmap_ip_gc_test net/netfilter/ipset/ip_set_bitmap_ip.c:76 [inline] bitmap_ip_gc+0x100/0x4f0 net/netfilter/ipset/ip_set_bitmap_gen.h:277 call_timer_fn+0x1ac/0x780 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0x6c3/0x1790 kernel/time/timer.c:1786 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:write_comp_data+0x68/0x70 kernel/kcov.c:232 Code: 00 00 4e 8d 14 dd 28 00 00 00 4d 39 d0 72 1b 49 83 c1 01 4a 89 7c 10 e0 4a 89 74 10 e8 4a 89 54 10 f0 4a 89 4c d8 20 4c 89 08 0f 1f 80 00 00 00 00 55 40 0f b6 d6 40 0f b6 f7 31 ff 48 89 e5 RSP: 0018:ffffc90002007850 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: 0000000000000012 RCX: ffffffff86e59d4d RDX: 0000000000000040 RSI: 0000000000000019 RDI: 0000000000000005 RBP: ffffc90002007870 R08: ffff88809557c280 R09: fffffbfff16a51ba R10: fffffbfff16a51b9 R11: ffffffff8b528dcf R12: ffffffff8905bc60 R13: 0000000000000038 R14: 00000000000002e8 R15: 0000000000776172 do_ipv6_setsockopt.isra.0+0x28d/0x4290 net/ipv6/ipv6_sockglue.c:167 ipv6_setsockopt+0xff/0x180 net/ipv6/ipv6_sockglue.c:944 tcp_setsockopt net/ipv4/tcp.c:3158 [inline] tcp_setsockopt+0x8f/0xe0 net/ipv4/tcp.c:3152 sock_common_setsockopt+0x94/0xd0 net/core/sock.c:3149 __sys_setsockopt+0x261/0x4c0 net/socket.c:2130 __do_sys_setsockopt net/socket.c:2146 [inline] __se_sys_setsockopt net/socket.c:2143 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:2143 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45deca Code: 49 89 ca b8 37 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 6a 8b fb ff c3 66 0f 1f 84 00 00 00 00 00 49 89 ca b8 36 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 4a 8b fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007fffd1c5cbe8 EFLAGS: 00000206 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007fffd1c5cc10 RCX: 000000000045deca RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 000000000071bcc0 R08: 00000000000002e8 R09: 0000000000004000 R10: 000000000071afa0 R11: 0000000000000206 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000029 R15: 000000000071af40 Allocated by task 10015: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:560 [inline] kzalloc include/linux/slab.h:669 [inline] ip_set_alloc+0x38/0x5e net/netfilter/ipset/ip_set_core.c:255 init_map_ip net/netfilter/ipset/ip_set_bitmap_ip.c:223 [inline] bitmap_ip_create+0x6ec/0xc20 net/netfilter/ipset/ip_set_bitmap_ip.c:327 ip_set_create+0x6f1/0x1500 net/netfilter/ipset/ip_set_core.c:1111 nfnetlink_rcv_msg+0xcf2/0xfb0 net/netfilter/nfnetlink.c:229 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 nfnetlink_rcv+0x1ba/0x460 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:672 ____sys_sendmsg+0x753/0x880 net/socket.c:2343 ___sys_sendmsg+0x100/0x170 net/socket.c:2397 __sys_sendmsg+0x105/0x1d0 net/socket.c:2430 __do_sys_sendmsg net/socket.c:2439 [inline] __se_sys_sendmsg net/socket.c:2437 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2437 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 2855: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 aio_free_ring+0x356/0x460 fs/aio.c:322 free_ioctx+0x1e/0x70 fs/aio.c:588 process_one_work+0xa05/0x17a0 kernel/workqueue.c:2264 worker_thread+0x98/0xe40 kernel/workqueue.c:2410 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff888052308000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4416 bytes inside of 8192-byte region [ffff888052308000, ffff88805230a000) The buggy address belongs to the page: page:ffffea000148c200 refcount:1 mapcount:0 mapping:ffff8880aa4021c0 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea000149c708 ffffea0001437008 ffff8880aa4021c0 raw: 0000000000000000 ffff888052308000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888052309000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888052309080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888052309100: 00 00 00 00 00 00 00 00 04 fc fc fc fc fc fc fc ^ ffff888052309180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888052309200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================