================================================================== BUG: KASAN: slab-use-after-free in jfs_lazycommit+0x7de/0xb70 fs/jfs/jfs_txnmgr.c:2730 Read of size 4 at addr ffff88802b82b294 by task jfsCommit/105 CPU: 1 PID: 105 Comm: jfsCommit Not tainted 6.2.0-syzkaller-12018-g2fcd07b7ccd5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x143/0x170 mm/kasan/report.c:536 jfs_lazycommit+0x7de/0xb70 fs/jfs/jfs_txnmgr.c:2730 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 29613: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] jfs_fill_super+0xff/0xc50 fs/jfs/super.c:495 mount_bdev+0x271/0x3a0 fs/super.c:1371 legacy_get_tree+0xef/0x190 fs/fs_context.c:610 vfs_get_tree+0x8c/0x270 fs/super.c:1501 do_new_mount+0x28f/0xae0 fs/namespace.c:3042 do_mount fs/namespace.c:3385 [inline] __do_sys_mount fs/namespace.c:3594 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3571 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 20342: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x264/0x3c0 mm/slub.c:3800 generic_shutdown_super+0x134/0x340 fs/super.c:491 kill_block_super+0x7e/0xe0 fs/super.c:1398 deactivate_locked_super+0xa4/0x110 fs/super.c:331 cleanup_mnt+0x490/0x520 fs/namespace.c:1177 task_work_run+0x24a/0x300 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x64/0x2e0 kernel/entry/common.c:296 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:491 kvfree_call_rcu+0x109/0x8d0 kernel/rcu/tree.c:3316 drop_sysctl_table+0x31c/0x460 fs/proc/proc_sysctl.c:1715 drop_sysctl_table+0x32e/0x460 fs/proc/proc_sysctl.c:1718 unregister_sysctl_table+0x8a/0x130 fs/proc/proc_sysctl.c:1753 neigh_sysctl_unregister+0x78/0xa0 net/core/neighbour.c:3895 devinet_sysctl_unregister net/ipv4/devinet.c:2639 [inline] inetdev_destroy net/ipv4/devinet.c:328 [inline] inetdev_event+0x86f/0x1580 net/ipv4/devinet.c:1603 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd4/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1937 [inline] call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] unregister_netdevice_many_notify+0xf4f/0x1a90 net/core/dev.c:10841 unregister_netdevice_many net/core/dev.c:10897 [inline] default_device_exit_batch+0x5c4/0x630 net/core/dev.c:11350 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x767/0xb80 net/core/net_namespace.c:613 process_one_work+0x915/0x13a0 kernel/workqueue.c:2390 worker_thread+0xa63/0x1210 kernel/workqueue.c:2537 kthread+0x270/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88802b82b200 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 148 bytes inside of freed 256-byte region [ffff88802b82b200, ffff88802b82b300) The buggy address belongs to the physical page: page:ffffea0000ae0a80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2b82a head:ffffea0000ae0a80 order:1 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888012441b40 ffffea0001f49580 dead000000000004 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 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 5106, tgid 5106 (syz-executor.2), ts 231184883462, free_ts 231133869808 prep_new_page mm/page_alloc.c:2552 [inline] get_page_from_freelist+0x37e0/0x3970 mm/page_alloc.c:4325 __alloc_pages+0x291/0x7f0 mm/page_alloc.c:5591 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] __kmem_cache_alloc_node+0x1b8/0x2a0 mm/slub.c:3491 kmalloc_trace+0x2a/0x60 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] ____ip_mc_inc_group+0x31d/0xbf0 net/ipv4/igmp.c:1449 __ip_mc_inc_group net/ipv4/igmp.c:1484 [inline] ip_mc_inc_group net/ipv4/igmp.c:1490 [inline] ip_mc_up+0x11f/0x2f0 net/ipv4/igmp.c:1789 inetdev_event+0xfda/0x1580 net/ipv4/devinet.c:1578 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd4/0x170 kernel/notifier.c:455 __dev_notify_flags+0x359/0x650 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8602 do_setlink+0xe93/0x2ae0 net/core/rtnetlink.c:2833 __rtnl_newlink net/core/rtnetlink.c:3623 [inline] rtnl_newlink+0x172d/0x2010 net/core/rtnetlink.c:3670 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6174 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1453 [inline] free_pcp_prepare mm/page_alloc.c:1503 [inline] free_unref_page_prepare+0xf0e/0xf70 mm/page_alloc.c:3387 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3482 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:769 slab_alloc_node mm/slub.c:3452 [inline] __kmem_cache_alloc_node+0x14c/0x2a0 mm/slub.c:3491 kmalloc_trace+0x2a/0x60 mm/slab_common.c:1061 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] ref_tracker_alloc+0x140/0x470 lib/ref_tracker.c:85 __netdev_tracker_alloc include/linux/netdevice.h:4036 [inline] netdev_hold include/linux/netdevice.h:4065 [inline] rx_queue_add_kobject net/core/net-sysfs.c:1084 [inline] net_rx_queue_update_kobjects+0x17a/0x5d0 net/core/net-sysfs.c:1142 register_queue_kobjects net/core/net-sysfs.c:1802 [inline] netdev_register_kobject+0x226/0x310 net/core/net-sysfs.c:2047 register_netdevice+0x1066/0x1790 net/core/dev.c:10044 team_newlink+0x10a/0x170 drivers/net/team/team.c:2207 rtnl_newlink_create net/core/rtnetlink.c:3440 [inline] __rtnl_newlink net/core/rtnetlink.c:3657 [inline] rtnl_newlink+0x1468/0x2010 net/core/rtnetlink.c:3670 rtnetlink_rcv_msg+0x825/0xf40 net/core/rtnetlink.c:6174 netlink_rcv_skb+0x1df/0x430 net/netlink/af_netlink.c:2574 Memory state around the buggy address: ffff88802b82b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b82b200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802b82b280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b82b300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802b82b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================