================================================================== BUG: KASAN: slab-out-of-bounds in test_bit include/asm-generic/bitops-instrumented.h:237 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_ip_do_add net/netfilter/ipset/ip_set_bitmap_ip.c:83 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_ip_add+0xea/0x10a0 net/netfilter/ipset/ip_set_bitmap_gen.h:136 Read of size 8 at addr ffff8880a5fbe880 by task syz-executor.3/7340 CPU: 1 PID: 7340 Comm: syz-executor.3 Not tainted 5.2.0-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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f mm/kasan/report.c:482 kasan_report+0x12/0x20 mm/kasan/common.c:614 check_memory_region_inline mm/kasan/generic.c:185 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/generic.c:191 kasan_check_read+0x11/0x20 mm/kasan/common.c:94 test_bit include/asm-generic/bitops-instrumented.h:237 [inline] bitmap_ip_do_add net/netfilter/ipset/ip_set_bitmap_ip.c:83 [inline] bitmap_ip_add+0xea/0x10a0 net/netfilter/ipset/ip_set_bitmap_gen.h:136 bitmap_ip_uadt+0x611/0x940 net/netfilter/ipset/ip_set_bitmap_ip.c:186 call_ad+0x178/0x560 net/netfilter/ipset/ip_set_core.c:1515 ip_set_ad.isra.27+0x411/0xb30 net/netfilter/ipset/ip_set_core.c:1601 ip_set_uadd+0x11/0x20 net/netfilter/ipset/ip_set_core.c:1625 nfnetlink_rcv_msg+0x946/0xc10 net/netfilter/nfnetlink.c:229 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 nfnetlink_rcv+0x15d/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x43b/0x640 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x765/0xc50 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:653 ___sys_sendmsg+0x647/0x950 net/socket.c:2306 __sys_sendmsg+0xd9/0x180 net/socket.c:2344 __do_sys_sendmsg net/socket.c:2353 [inline] __se_sys_sendmsg net/socket.c:2351 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2351 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45b159 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:00007f289cad0c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f289cad16d4 RCX: 000000000045b159 RDX: 0000000000000000 RSI: 0000000020000300 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008dc R14: 00000000004ca08f R15: 000000000075bf2c Allocated by task 7340: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.12+0xc7/0xd0 mm/kasan/common.c:489 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc mm/slab.c:3654 [inline] __kmalloc+0x15d/0x760 mm/slab.c:3663 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:742 [inline] ip_set_alloc+0x1b/0x30 net/netfilter/ipset/ip_set_core.c:255 init_map_ip net/netfilter/ipset/ip_set_bitmap_ip.c:223 [inline] bitmap_ip_create+0x540/0xd00 net/netfilter/ipset/ip_set_bitmap_ip.c:315 ip_set_create+0x5aa/0x1150 net/netfilter/ipset/ip_set_core.c:942 nfnetlink_rcv_msg+0x946/0xc10 net/netfilter/nfnetlink.c:229 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 nfnetlink_rcv+0x15d/0x3b0 net/netfilter/nfnetlink.c:563 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x43b/0x640 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x765/0xc50 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:633 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:653 ___sys_sendmsg+0x647/0x950 net/socket.c:2306 __sys_sendmsg+0xd9/0x180 net/socket.c:2344 __do_sys_sendmsg net/socket.c:2353 [inline] __se_sys_sendmsg net/socket.c:2351 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2351 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7182: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3426 [inline] kfree+0x108/0x2c0 mm/slab.c:3755 single_release+0x8b/0xc0 fs/seq_file.c:609 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:185 [inline] exit_to_usermode_loop+0x24e/0x2e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x462/0x540 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a5fbe880 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8880a5fbe880, ffff8880a5fbe8a0) The buggy address belongs to the page: page:ffffea000297ef80 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff8880a5fbefc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea000297c888 ffffea000293ff88 ffff8880aa4001c0 raw: ffff8880a5fbefc1 ffff8880a5fbe000 0000000100000039 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a5fbe780: 00 00 fc fc fc fc fc fc fb fb fb fb fc fc fc fc ffff8880a5fbe800: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff8880a5fbe880: 04 fc fc fc fc fc fc fc 00 05 fc fc fc fc fc fc ^ ffff8880a5fbe900: 00 00 fc fc fc fc fc fc 00 fc fc fc fc fc fc fc ffff8880a5fbe980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================