syzbot


KASAN: invalid-free in diUnmount

Status: upstream: reported C repro on 2023/06/18 11:33
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+5c604c1cc148275ab8a6@syzkaller.appspotmail.com
First crash: 318d, last: 227d
Fix bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[PATCH] jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount 6 (6) 2023/07/18 19:46
Bug presence (3)
Date Name Commit Repro Result
2023/09/17 linux-5.15.y (ToT) aff03380bda4 C [report] KASAN: invalid-free in diUnmount
2023/06/18 upstream (ToT) 8c1f0c38b310 C [report] KASAN: invalid-free in diUnmount
2023/09/17 upstream (ToT) f0b0d403eabb C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: invalid-free in diUnmount jfs C error 98 222d 519d 26/26 closed as dup on 2023/07/18 16:07
linux-6.1 KASAN: invalid-free in diUnmount missing-backport origin:lts-only C done 4 229d 416d 0/3 upstream: reported C repro on 2023/03/12 22:37
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2024/03/22 12:16 1h25m fix candidate upstream error job log (0)
2024/02/11 18:37 0m fix candidate upstream error job log (0)
2024/01/02 18:29 0m fix candidate upstream error job log (0)
2023/11/27 07:05 1m fix candidate upstream error job log (0)
2023/10/17 05:08 0m fix candidate upstream error job log (0)
2023/07/31 17:49 0m bisect fix linux-5.15.y error job log (0)

Sample crash report:
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584
read_mapping_page failed!
jfs_mount_rw: diMount failed!
==================================================================
BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3499 [inline]
BUG: KASAN: double-free or invalid-free in kfree+0x178/0x410 mm/slub.c:4559

CPU: 1 PID: 3962 Comm: syz-executor354 Not tainted 5.15.117-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 kasan_report_invalid_free+0x64/0x94 mm/kasan/report.c:373
 ____kasan_slab_free+0x134/0x164
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0x178/0x410 mm/slub.c:4559
 diUnmount+0xf4/0x10c fs/jfs/jfs_imap.c:195
 jfs_umount+0x110/0x338 fs/jfs/jfs_umount.c:63
 jfs_put_super+0x90/0x188 fs/jfs/super.c:194
 generic_shutdown_super+0x130/0x29c fs/super.c:475
 kill_block_super+0x70/0xdc fs/super.c:1405
 deactivate_locked_super+0xb8/0x13c fs/super.c:335
 deactivate_super+0x108/0x128 fs/super.c:366
 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143
 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150
 task_work_run+0x130/0x1e4 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x688/0x2134 kernel/exit.c:872
 do_group_exit+0x110/0x268 kernel/exit.c:994
 __do_sys_exit_group kernel/exit.c:1005 [inline]
 __se_sys_exit_group kernel/exit.c:1003 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1003
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 3962:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x27c/0x47c mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 kobject_uevent_env+0x26c/0x898 lib/kobject_uevent.c:524
 kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:642
 __kobject_del+0xd8/0x2d4 lib/kobject.c:625
 kobject_cleanup lib/kobject.c:704 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x2dc/0x438 lib/kobject.c:761
 net_rx_queue_update_kobjects+0x3b4/0x42c net/core/net-sysfs.c:1124
 remove_queue_kobjects net/core/net-sysfs.c:1822 [inline]
 netdev_unregister_kobject+0xf0/0x204 net/core/net-sysfs.c:1976
 unregister_netdevice_many+0x12c8/0x189c net/core/dev.c:11096
 unregister_netdevice_queue+0x2d0/0x31c net/core/dev.c:11002
 unregister_netdevice include/linux/netdevice.h:3015 [inline]
 __tun_detach+0xb74/0x12b0 drivers/net/tun.c:685
 tun_detach drivers/net/tun.c:701 [inline]
 tun_chr_close+0x118/0x20c drivers/net/tun.c:3431
 __fput+0x30c/0x7f0 fs/file_table.c:280
 ____fput+0x20/0x30 fs/file_table.c:308
 task_work_run+0x130/0x1e4 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x688/0x2134 kernel/exit.c:872
 do_group_exit+0x110/0x268 kernel/exit.c:994
 __do_sys_exit_group kernel/exit.c:1005 [inline]
 __se_sys_exit_group kernel/exit.c:1003 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1003
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 3962:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0x178/0x410 mm/slub.c:4559
 kobject_uevent_env+0x354/0x898 lib/kobject_uevent.c:626
 kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:642
 __kobject_del+0xd8/0x2d4 lib/kobject.c:625
 kobject_cleanup lib/kobject.c:704 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x2dc/0x438 lib/kobject.c:761
 net_rx_queue_update_kobjects+0x3b4/0x42c net/core/net-sysfs.c:1124
 remove_queue_kobjects net/core/net-sysfs.c:1822 [inline]
 netdev_unregister_kobject+0xf0/0x204 net/core/net-sysfs.c:1976
 unregister_netdevice_many+0x12c8/0x189c net/core/dev.c:11096
 unregister_netdevice_queue+0x2d0/0x31c net/core/dev.c:11002
 unregister_netdevice include/linux/netdevice.h:3015 [inline]
 __tun_detach+0xb74/0x12b0 drivers/net/tun.c:685
 tun_detach drivers/net/tun.c:701 [inline]
 tun_chr_close+0x118/0x20c drivers/net/tun.c:3431
 __fput+0x30c/0x7f0 fs/file_table.c:280
 ____fput+0x20/0x30 fs/file_table.c:308
 task_work_run+0x130/0x1e4 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x688/0x2134 kernel/exit.c:872
 do_group_exit+0x110/0x268 kernel/exit.c:994
 __do_sys_exit_group kernel/exit.c:1005 [inline]
 __se_sys_exit_group kernel/exit.c:1003 [inline]
 __wake_up_parent+0x0/0x60 kernel/exit.c:1003
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000c76a0000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 0 bytes inside of
 4096-byte region [ffff0000c76a0000, ffff0000c76a1000)
The buggy address belongs to the page:
page:000000005cf71b91 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076a0
head:000000005cf71b91 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0002a80
raw: 0000000000000000 0000000080040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000c769ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000c769ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000c76a0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff0000c76a0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000c76a0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/18 11:32 linux-5.15.y 471e639e59d1 f3921d4d .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: invalid-free in diUnmount
* Struck through repros no longer work on HEAD.