R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffb6c826038 R14: 00007ffb6c825fa0 R15: 00007fffc848c6f8 ================================================================== BUG: KASAN: double-free in jffs2_free_inode+0x39/0x60 fs/jffs2/super.c:52 Free of addr ffff88802dda53e0 by task syz.0.589/7663 CPU: 2 UID: 0 PID: 7663 Comm: syz.0.589 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+0xc3/0xf0 mm/kasan/common.c:235 kasan_slab_pre_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:2693 [inline] slab_free mm/slub.c:6508 [inline] kfree+0x1b6/0x6d0 mm/slub.c:6801 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+0x1d9/0x6d0 fs/inode.c:1473 jffs2_iget+0xb5/0xe30 fs/jffs2/fs.c:265 jffs2_lookup+0x353/0x410 fs/jffs2/dir.c:114 __lookup_slow+0x155/0x320 fs/namei.c:1919 lookup_slow+0x50/0x70 fs/namei.c:1936 walk_component fs/namei.c:2282 [inline] lookup_last fs/namei.c:2789 [inline] path_lookupat+0x5e8/0xc40 fs/namei.c:2813 filename_lookup+0x202/0x590 fs/namei.c:2842 do_fchownat+0xe6/0x1f0 fs/open.c:849 __do_sys_lchown fs/open.c:878 [inline] __se_sys_lchown fs/open.c:876 [inline] __x64_sys_lchown+0x7e/0xc0 fs/open.c:876 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ffb6c59e159 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:00007ffb6a7f6028 EFLAGS: 00000246 ORIG_RAX: 000000000000005e RAX: ffffffffffffffda RBX: 00007ffb6c825fa0 RCX: 00007ffb6c59e159 RDX: 0000000000000000 RSI: 000000000000ee00 RDI: 00002000000001c0 RBP: 00007ffb6a7f6090 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffb6c826038 R14: 00007ffb6c825fa0 R15: 00007fffc848c6f8 Allocated by task 5728: 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:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kasan_kmalloc include/linux/kasan.h:263 [inline] __do_kmalloc_node mm/slub.c:5414 [inline] __kmalloc_node_noprof+0x342/0x880 mm/slub.c:5426 _kmalloc_node_noprof include/linux/slab.h:1200 [inline] __vmalloc_area_node mm/vmalloc.c:3893 [inline] __vmalloc_node_range_noprof+0x3d4/0x1420 mm/vmalloc.c:4104 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4165 alloc_counters net/ipv4/netfilter/ip_tables.c:799 [inline] copy_entries_to_user net/ipv4/netfilter/ip_tables.c:821 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1020 [inline] do_ipt_get_ctl+0x7e0/0xbf0 net/ipv4/netfilter/ip_tables.c:1669 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4873 do_sock_getsockopt+0x50a/0x6e0 net/socket.c:2503 __sys_getsockopt+0x148/0x260 net/socket.c:2534 __do_sys_getsockopt net/socket.c:2541 [inline] __se_sys_getsockopt net/socket.c:2538 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2538 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5728: 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:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2748 [inline] slab_free mm/slub.c:6508 [inline] kfree+0x22b/0x6d0 mm/slub.c:6801 vfree mm/vmalloc.c:3511 [inline] vfree+0x11d/0x6d0 mm/vmalloc.c:3484 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:864 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1020 [inline] do_ipt_get_ctl+0x9d7/0xbf0 net/ipv4/netfilter/ip_tables.c:1669 nf_getsockopt+0x7c/0xe0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x192/0x1e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0xa1/0x110 net/ipv4/tcp.c:4873 do_sock_getsockopt+0x50a/0x6e0 net/socket.c:2503 __sys_getsockopt+0x148/0x260 net/socket.c:2534 __do_sys_getsockopt net/socket.c:2541 [inline] __se_sys_getsockopt net/socket.c:2538 [inline] __x64_sys_getsockopt+0xbd/0x160 net/socket.c:2538 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88802dda53e0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 0 bytes inside of 8-byte region [ffff88802dda53e0, ffff88802dda53e8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88802dda5720 pfn:0x2dda5 flags: 0xfff00000000200(workingset|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000200 ffff88801c042500 ffffea000074f790 ffffea00008cb490 raw: ffff88802dda5720 000000000080007f 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 0xd2c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 8883692034 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1871 prep_new_page mm/page_alloc.c:1879 [inline] get_page_from_freelist+0x110d/0x35d0 mm/page_alloc.c:3943 __alloc_frozen_pages_noprof+0x2eb/0x3300 mm/page_alloc.c:5436 alloc_slab_page mm/slub.c:3347 [inline] allocate_slab mm/slub.c:3462 [inline] new_slab+0xa9/0x6e0 mm/slub.c:3513 refill_objects+0xe3/0x410 mm/slub.c:7417 refill_sheaf mm/slub.c:2885 [inline] __pcs_replace_empty_main+0x35e/0x650 mm/slub.c:4774 alloc_from_pcs mm/slub.c:4850 [inline] slab_alloc_node mm/slub.c:4984 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0x67c/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] usb_set_configuration+0x1064/0x1c60 drivers/usb/core/message.c:2091 usb_generic_driver_probe+0xa1/0xe0 drivers/usb/core/generic.c:250 usb_probe_device+0xef/0x400 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:628 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:706 __driver_probe_device+0x210/0x460 drivers/base/dd.c:868 driver_probe_device+0x4a/0x140 drivers/base/dd.c:898 __device_attach_driver+0x1df/0x320 drivers/base/dd.c:1026 bus_for_each_drv+0x159/0x1e0 drivers/base/bus.c:500 __device_attach+0x1e4/0x4d0 drivers/base/dd.c:1098 page_owner free stack trace missing Memory state around the buggy address: ffff88802dda5280: 00 fc fc fc fa fc fc fc 06 fc fc fc 06 fc fc fc ffff88802dda5300: 00 fc fc fc fa fc fc fc fa fc fc fc 00 fc fc fc >ffff88802dda5380: fa fc fc fc fa fc fc fc 00 fc fc fc fa fc fc fc ^ ffff88802dda5400: 05 fc fc fc fa fc fc fc 05 fc fc fc 06 fc fc fc ffff88802dda5480: 00 fc fc fc 00 fc fc fc 00 fc fc fc 00 fc fc fc ==================================================================