R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f1851e26038 R14: 00007f1851e25fa0 R15: 00007fffea257328 ================================================================== BUG: KASAN: double-free in jffs2_free_inode+0x39/0x60 fs/jffs2/super.c:52 Free of addr ffff888039749000 by task syz.1.206/6974 CPU: 3 UID: 0 PID: 6974 Comm: syz.1.206 Not tainted syzkaller #0 PREEMPT(full) 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+0xd8/0x110 mm/kasan/common.c:248 kasan_slab_pre_free include/linux/kasan.h:202 [inline] slab_free_hook mm/slub.c:2725 [inline] slab_free mm/slub.c:6637 [inline] kfree+0x1b8/0x6d0 mm/slub.c:6930 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_symlink fs/namei.c:5864 [inline] __se_sys_symlink fs/namei.c:5860 [inline] __x64_sys_symlink+0x79/0xb0 fs/namei.c:5860 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:0x7f1851b9e0d9 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:00007f1852aaa028 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007f1851e25fa0 RCX: 00007f1851b9e0d9 RDX: 0000000000000000 RSI: 0000200000000800 RDI: 0000200000000540 RBP: 00007f1852aaa090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007f1851e26038 R14: 00007f1851e25fa0 R15: 00007fffea257328 Allocated by task 6949: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 poison_kmalloc_redzone mm/kasan/common.c:412 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:267 [inline] __do_kmalloc_node mm/slub.c:5531 [inline] __kmalloc_noprof+0x32f/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] memcg_init_list_lru_one mm/list_lru.c:471 [inline] __memcg_list_lru_alloc+0x6b2/0x8d0 mm/list_lru.c:613 memcg_list_lru_alloc+0x1ac/0x330 mm/list_lru.c:642 __memcg_slab_post_alloc_hook+0x277/0x10b0 mm/memcontrol.c:3704 memcg_slab_post_alloc_hook mm/slub.c:2549 [inline] slab_post_alloc_hook mm/slub.c:4739 [inline] slab_alloc_node mm/slub.c:5033 [inline] kmem_cache_alloc_lru_noprof+0x4f1/0x6a0 mm/slub.c:5066 jffs2_alloc_inode+0x25/0x50 fs/jffs2/super.c:42 alloc_inode+0x68/0x250 fs/inode.c:338 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_symlink fs/namei.c:5864 [inline] __se_sys_symlink fs/namei.c:5860 [inline] __x64_sys_symlink+0x79/0xb0 fs/namei.c:5860 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 6282: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x40 mm/kasan/common.c:79 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:599 poison_slab_object mm/kasan/common.c:267 [inline] __kasan_slab_free+0x73/0x90 mm/kasan/common.c:299 kasan_slab_free include/linux/kasan.h:239 [inline] slab_free_hook mm/slub.c:2780 [inline] slab_free mm/slub.c:6637 [inline] kfree+0x22d/0x6d0 mm/slub.c:6930 memcg_destroy_list_lru mm/list_lru.c:498 [inline] list_lru_destroy mm/list_lru.c:726 [inline] list_lru_destroy+0x3ea/0x710 mm/list_lru.c:718 deactivate_locked_super+0xdd/0x130 fs/super.c:564 deactivate_super fs/super.c:586 [inline] deactivate_super+0xea/0x110 fs/super.c:582 cleanup_mnt+0xb7/0x160 fs/namespace.c:1396 task_work_run+0x150/0x240 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x1d8/0x700 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline] do_syscall_64+0x661/0x7b0 arch/x86/entry/syscall_64.c:107 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888039749000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes inside of 256-byte region [ffff888039749000, ffff888039749100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x39748 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801d442b40 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801d442b40 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffffffffffff81 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5847, tgid 5847 (syz-executor), ts 50601425185 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1873 prep_new_page mm/page_alloc.c:1881 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3963 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5505 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:7546 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_noprof+0x677/0x840 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kzalloc_noprof include/linux/slab.h:1312 [inline] new_dir fs/proc/proc_sysctl.c:968 [inline] get_subdir fs/proc/proc_sysctl.c:1012 [inline] sysctl_mkdir_p fs/proc/proc_sysctl.c:1322 [inline] __register_sysctl_table+0xbe4/0x1650 fs/proc/proc_sysctl.c:1397 register_net_sysctl_sz+0x325/0x420 net/sysctl_net.c:172 lowpan_frags_ns_sysctl_register net/ieee802154/6lowpan/reassembly.c:388 [inline] lowpan_frags_init_net net/ieee802154/6lowpan/reassembly.c:464 [inline] lowpan_frags_init_net+0x252/0x3a0 net/ieee802154/6lowpan/reassembly.c:449 ops_init+0x1e2/0x5f0 net/core/net_namespace.c:137 setup_net+0x117/0x3a0 net/core/net_namespace.c:448 copy_net_ns+0x343/0x7a0 net/core/net_namespace.c:589 create_new_namespaces+0x3ea/0xac0 kernel/nsproxy.c:132 unshare_nsproxy_namespaces+0xf6/0x210 kernel/nsproxy.c:234 ksys_unshare+0x44f/0x980 kernel/fork.c:3321 page last free pid 5847 tgid 5847 ts 50576572397 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1415 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2971 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:364 kasan_slab_alloc include/linux/kasan.h:257 [inline] slab_post_alloc_hook mm/slub.c:4720 [inline] slab_alloc_node mm/slub.c:5033 [inline] __kmalloc_cache_noprof+0x278/0x6d0 mm/slub.c:5676 _kmalloc_noprof include/linux/slab.h:991 [inline] netdev_create_hash net/core/dev.c:13354 [inline] netdev_init+0xa0/0x3c0 net/core/dev.c:13370 ops_init+0x1e2/0x5f0 net/core/net_namespace.c:137 setup_net+0x117/0x3a0 net/core/net_namespace.c:448 copy_net_ns+0x343/0x7a0 net/core/net_namespace.c:589 create_new_namespaces+0x3ea/0xac0 kernel/nsproxy.c:132 unshare_nsproxy_namespaces+0xf6/0x210 kernel/nsproxy.c:234 ksys_unshare+0x44f/0x980 kernel/fork.c:3321 __do_sys_unshare kernel/fork.c:3387 [inline] __se_sys_unshare kernel/fork.c:3385 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3385 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: ffff888039748f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888039748f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888039749000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888039749080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888039749100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================