R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fb8f3626038 R14: 00007fb8f3625fa0 R15: 00007ffdd9907cb8 ================================================================== BUG: KASAN: double-free in jffs2_free_inode+0x39/0x60 fs/jffs2/super.c:52 Free of addr ffff8880377bf440 by task syz.4.1038/9171 CPU: 1 UID: 0 PID: 9171 Comm: syz.4.1038 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report_invalid_free+0xb8/0x190 mm/kasan/report.c:557 check_slab_allocation+0xc3/0xf0 mm/kasan/common.c:246 kasan_slab_pre_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:2725 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x1b6/0x6d0 mm/slub.c:6923 jffs2_free_inode+0x39/0x60 fs/jffs2/super.c:52 i_callback fs/inode.c:317 [inline] alloc_inode+0x153/0x250 fs/inode.c:352 iget_locked+0x1d4/0x6c0 fs/inode.c:1494 jffs2_iget+0xb5/0xe30 fs/jffs2/fs.c:265 jffs2_lookup+0x353/0x410 fs/jffs2/dir.c:114 lookup_one_qstr_excl+0x1cd/0x250 fs/namei.c:1816 __start_dirop fs/namei.c:2926 [inline] start_dirop fs/namei.c:2948 [inline] filename_create+0x1cf/0x400 fs/namei.c:5108 filename_symlinkat+0xe1/0x5a0 fs/namei.c:5831 __do_sys_symlinkat fs/namei.c:5857 [inline] __se_sys_symlinkat fs/namei.c:5852 [inline] __x64_sys_symlinkat+0x9c/0xe0 fs/namei.c:5852 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fb8f33a94d9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb8f41ee028 EFLAGS: 00000246 ORIG_RAX: 000000000000010a RAX: ffffffffffffffda RBX: 00007fb8f3625fa0 RCX: 00007fb8f33a94d9 RDX: 0000200000001940 RSI: ffffffffffffff9c RDI: 0000200000001900 RBP: 00007fb8f41ee090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fb8f3626038 R14: 00007fb8f3625fa0 R15: 00007ffdd9907cb8 Allocated by task 5783: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:409 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:426 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5531 [inline] __kmalloc_node_noprof+0x342/0x870 mm/slub.c:5543 _kmalloc_node_noprof include/linux/slab.h:1200 [inline] __vmalloc_area_node mm/vmalloc.c:3930 [inline] __vmalloc_node_range_noprof+0x424/0x1440 mm/vmalloc.c:4152 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4213 alloc_counters net/ipv6/netfilter/ip6_tables.c:821 [inline] copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:843 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1043 [inline] do_ip6t_get_ctl+0x7e0/0xc30 net/ipv6/netfilter/ip6_tables.c:1684 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x207/0x2a0 net/ipv6/ipv6_sockglue.c:1371 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4885 do_sock_getsockopt+0x415/0x570 net/socket.c:2505 __sys_getsockopt+0x148/0x260 net/socket.c:2536 __do_sys_getsockopt net/socket.c:2543 [inline] __se_sys_getsockopt net/socket.c:2540 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2540 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5783: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:264 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:296 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6630 [inline] kfree+0x22b/0x6d0 mm/slub.c:6923 vfree mm/vmalloc.c:3548 [inline] vfree+0x122/0x850 mm/vmalloc.c:3521 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:886 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1043 [inline] do_ip6t_get_ctl+0xa0b/0xc30 net/ipv6/netfilter/ip6_tables.c:1684 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x207/0x2a0 net/ipv6/ipv6_sockglue.c:1371 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4885 do_sock_getsockopt+0x415/0x570 net/socket.c:2505 __sys_getsockopt+0x148/0x260 net/socket.c:2536 __do_sys_getsockopt net/socket.c:2543 [inline] __se_sys_getsockopt net/socket.c:2540 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2540 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880377bf440 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff8880377bf440, ffff8880377bf448) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x377bf flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801d442500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000800080 00000000f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0xd2cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5791, tgid 5791 (syz-executor), ts 51080461369 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_slab_page mm/slub.c:3384 [inline] allocate_slab mm/slub.c:3499 [inline] new_slab+0xb1/0x6d0 mm/slub.c:3550 refill_objects+0xe3/0x410 mm/slub.c:7539 refill_sheaf mm/slub.c:2917 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4811 alloc_from_pcs mm/slub.c:4887 [inline] slab_alloc_node mm/slub.c:5021 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_node_track_caller_noprof+0x6a3/0x870 mm/slub.c:5662 kvasprintf+0xbc/0x150 lib/kasprintf.c:25 kvasprintf_const+0x66/0x1a0 lib/kasprintf.c:49 kobject_set_name_vargs+0x5a/0x140 lib/kobject.c:274 kobject_add_varg lib/kobject.c:368 [inline] kobject_init_and_add+0xe7/0x180 lib/kobject.c:457 rx_queue_add_kobject net/core/net-sysfs.c:1274 [inline] net_rx_queue_update_kobjects+0x384/0x760 net/core/net-sysfs.c:1336 register_queue_kobjects net/core/net-sysfs.c:2134 [inline] netdev_register_kobject+0x2c6/0x410 net/core/net-sysfs.c:2385 register_netdevice+0x1313/0x26b0 net/core/dev.c:11740 veth_newlink+0x3eb/0xd00 drivers/net/veth.c:1907 rtnl_newlink_create net/core/rtnetlink.c:4006 [inline] __rtnl_newlink net/core/rtnetlink.c:4135 [inline] rtnl_newlink+0x1697/0x2620 net/core/rtnetlink.c:4252 page last free pid 5859 tgid 5859 ts 50930588174 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:361 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] __do_kmalloc_node mm/slub.c:5530 [inline] __kmalloc_noprof+0x2cc/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] tomoyo_realpath_from_path+0xb6/0x690 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x276/0x460 security/tomoyo/file.c:827 security_inode_getattr+0x116/0x280 security/security.c:1918 vfs_getattr fs/stat.c:263 [inline] vfs_fstat+0x4b/0xe0 fs/stat.c:285 __do_sys_newfstat+0x8b/0x110 fs/stat.c:555 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x7b0 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff8880377bf300: 05 fc fc fc 05 fc fc fc fa fc fc fc fa fc fc fc ffff8880377bf380: 05 fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc >ffff8880377bf400: 05 fc fc fc 05 fc fc fc fa fc fc fc fa fc fc fc ^ ffff8880377bf480: fa fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc ffff8880377bf500: 05 fc fc fc 05 fc fc fc 05 fc fc fc 05 fc fc fc ==================================================================