================================================================== 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_port_do_add net/netfilter/ipset/ip_set_bitmap_port.c:74 [inline] BUG: KASAN: slab-out-of-bounds in bitmap_port_add+0xea/0x10a0 net/netfilter/ipset/ip_set_bitmap_gen.h:136 Read of size 8 at addr ffff88809c364940 by task syz-executor.3/7419 CPU: 1 PID: 7419 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_port_do_add net/netfilter/ipset/ip_set_bitmap_port.c:74 [inline] bitmap_port_add+0xea/0x10a0 net/netfilter/ipset/ip_set_bitmap_gen.h:136 bitmap_port_uadt+0x551/0x890 net/netfilter/ipset/ip_set_bitmap_port.c:172 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:0x45aff9 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:00007f4f195b9c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f4f195ba6d4 RCX: 000000000045aff9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000008c8 R14: 00000000004c9dfc R15: 000000000075bf2c Allocated by task 7416: 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_port net/netfilter/ipset/ip_set_bitmap_port.c:207 [inline] bitmap_port_create+0x32e/0x740 net/netfilter/ipset/ip_set_bitmap_port.c:249 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 7229: 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 tomoyo_path_perm+0x218/0x380 security/tomoyo/file.c:842 tomoyo_inode_getattr+0x13/0x20 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xb0/0x100 security/security.c:1182 vfs_getattr+0x1c/0x40 fs/stat.c:115 vfs_statx+0xd8/0x150 fs/stat.c:191 vfs_stat include/linux/fs.h:3203 [inline] __do_sys_newstat+0x85/0xe0 fs/stat.c:341 __se_sys_newstat fs/stat.c:337 [inline] __x64_sys_newstat+0x4f/0x70 fs/stat.c:337 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809c364940 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff88809c364940, ffff88809c364960) The buggy address belongs to the page: page:ffffea000270d900 refcount:1 mapcount:0 mapping:ffff8880aa4001c0 index:0xffff88809c364fc1 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00027a9808 ffffea0002a3e388 ffff8880aa4001c0 raw: ffff88809c364fc1 ffff88809c364000 000000010000003c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809c364800: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809c364880: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc >ffff88809c364900: fb fb fb fb fc fc fc fc 04 fc fc fc fc fc fc fc ^ ffff88809c364980: fb fb fb fb fc fc fc fc fb fb fb fb fc fc fc fc ffff88809c364a00: 00 fc fc fc fc fc fc fc fb fb fb fb fc fc fc fc ==================================================================