================================================================== 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_port_gc_test net/netfilter/ipset/ip_set_bitmap_port.c:67 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_port_gc+0x112/0x4f0 net/netfilter/ipset/ip_set_bitmap_gen.h:277 Read of size 8 at addr ffff8880a35d43c0 by task syz-executor.2/18042 CPU: 1 PID: 18042 Comm: syz-executor.2 Not tainted 5.5.0-rc7-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/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 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_port_gc_test net/netfilter/ipset/ip_set_bitmap_port.c:67 [inline] bitmap_port_gc+0x112/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:arch_local_irq_restore arch/x86/include/asm/paravirt.h:752 [inline] RIP: 0010:slab_alloc mm/slab.c:3313 [inline] RIP: 0010:kmem_cache_alloc+0x283/0x710 mm/slab.c:3484 Code: 7e 0f 85 dc fe ff ff e8 bc 24 4e ff e9 d2 fe ff ff e8 b1 45 c8 ff 48 83 3d 91 ee e0 07 00 0f 84 51 03 00 00 48 8b 7d d0 57 9d <0f> 1f 44 00 00 e9 68 fe ff ff 31 d2 be 35 02 00 00 48 c7 c7 d6 d7 RSP: 0018:ffffc900178a6fa0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000007 RBX: 0000000000092800 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000282 RBP: ffffc900178a7008 R08: ffff888039278640 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a75e7700 R13: ffff8880a75e7700 R14: 0000000000092800 R15: ffff888065cc8f00 mempool_alloc_slab+0x47/0x60 mm/mempool.c:513 mempool_alloc+0x169/0x380 mm/mempool.c:393 bio_alloc_bioset+0x3b9/0x680 block/bio.c:480 bio_alloc include/linux/bio.h:400 [inline] submit_bh_wbc+0x1c5/0x8f0 fs/buffer.c:3086 __block_write_full_page+0x7fe/0x11b0 fs/buffer.c:1807 block_write_full_page+0x21f/0x270 fs/buffer.c:2993 blkdev_writepage+0x25/0x30 fs/block_dev.c:609 __writepage+0x66/0x110 mm/page-writeback.c:2303 write_cache_pages+0x80c/0x13f0 mm/page-writeback.c:2238 generic_writepages mm/page-writeback.c:2329 [inline] generic_writepages+0xed/0x160 mm/page-writeback.c:2318 blkdev_writepages+0x1e/0x30 fs/block_dev.c:2060 do_writepages+0xfa/0x2a0 mm/page-writeback.c:2344 __filemap_fdatawrite_range+0x2bc/0x3b0 mm/filemap.c:421 filemap_write_and_wait_range mm/filemap.c:681 [inline] filemap_write_and_wait_range+0xfc/0x1d0 mm/filemap.c:675 generic_file_read_iter+0x1327/0x2cf0 mm/filemap.c:2294 blkdev_read_iter+0x120/0x190 fs/block_dev.c:2039 call_read_iter include/linux/fs.h:1896 [inline] do_iter_readv_writev+0x711/0x8f0 fs/read_write.c:691 do_iter_read+0x27c/0x660 fs/read_write.c:933 vfs_readv+0xf0/0x160 fs/read_write.c:997 do_preadv+0x1c4/0x280 fs/read_write.c:1089 __do_sys_preadv fs/read_write.c:1139 [inline] __se_sys_preadv fs/read_write.c:1134 [inline] __x64_sys_preadv+0x9a/0xf0 fs/read_write.c:1134 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b349 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2e63d72c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00007f2e63d736d4 RCX: 000000000045b349 RDX: 0000000000000001 RSI: 0000000020000040 RDI: 0000000000000007 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 000000000000082c R14: 00000000004c9a3e R15: 000000000075bf2c Allocated by task 7077: save_stack+0x23/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:486 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:670 [inline] ip_set_alloc+0x38/0x5e net/netfilter/ipset/ip_set_core.c:255 init_map_port net/netfilter/ipset/ip_set_bitmap_port.c:234 [inline] bitmap_port_create+0x3dc/0x7c0 net/netfilter/ipset/ip_set_bitmap_port.c:276 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+0x58c/0x7d0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:639 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:659 ____sys_sendmsg+0x753/0x880 net/socket.c:2330 ___sys_sendmsg+0x100/0x170 net/socket.c:2384 __sys_sendmsg+0x105/0x1d0 net/socket.c:2417 __do_sys_sendmsg net/socket.c:2426 [inline] __se_sys_sendmsg net/socket.c:2424 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2424 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9987: 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:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 kvfree+0x61/0x70 mm/util.c:603 __vunmap+0x6ba/0x950 mm/vmalloc.c:2311 __vfree+0x41/0xd0 mm/vmalloc.c:2355 vfree+0x5f/0x90 mm/vmalloc.c:2385 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:883 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x750/0x960 net/ipv6/netfilter/ip6_tables.c:1709 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x7a/0xd0 net/netfilter/nf_sockopt.c:122 ipv6_getsockopt net/ipv6/ipv6_sockglue.c:1400 [inline] ipv6_getsockopt+0x205/0x280 net/ipv6/ipv6_sockglue.c:1380 tcp_getsockopt net/ipv4/tcp.c:3690 [inline] tcp_getsockopt+0x8f/0xe0 net/ipv4/tcp.c:3684 sock_common_getsockopt+0x94/0xd0 net/core/sock.c:3108 __sys_getsockopt+0x16d/0x310 net/socket.c:2162 __do_sys_getsockopt net/socket.c:2177 [inline] __se_sys_getsockopt net/socket.c:2174 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:2174 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a35d43c0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880a35d43c0, ffff8880a35d43e0) The buggy address belongs to the page: page:ffffea00028d7500 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff8880a35d4fc1 raw: 00fffe0000000200 ffffea0002789088 ffffea00027fd7c8 ffff8880aa4001c0 raw: ffff8880a35d4fc1 ffff8880a35d4000 000000010000003f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a35d4280: 05 fc fc fc fc fc fc fc 05 fc fc fc fc fc fc fc ffff8880a35d4300: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a35d4380: 00 01 fc fc fc fc fc fc 04 fc fc fc fc fc fc fc ^ ffff8880a35d4400: 00 01 fc fc fc fc fc fc 00 00 06 fc fc fc fc fc ffff8880a35d4480: 00 00 00 04 fc fc fc fc 05 fc fc fc fc fc fc fc ==================================================================