[v6.1] KASAN: invalid-free in diUnmount

0 views
Skip to first unread message

syzbot

unread,
Mar 12, 2023, 6:37:47 PM3/12/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 1cc3fcf63192 Linux 6.1.18
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15e85a34c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=157296d36f92ea19
dashboard link: https://syzkaller.appspot.com/bug?extid=e8f9034a130a66a2b351
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0e4c0d43698b/disk-1cc3fcf6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a4de39d735de/vmlinux-1cc3fcf6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/82bab928f6e3/Image-1cc3fcf6.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e8f903...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: double-free in kfree+0x104/0x228 mm/slab_common.c:1007
Free of addr ffff000123210000 by task syz-executor.0/4341

CPU: 1 PID: 4341 Comm: syz-executor.0 Not tainted 6.1.18-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:395
kasan_report_invalid_free+0xc4/0x114 mm/kasan/report.c:460
____kasan_slab_free+0x170/0x1c0 mm/kasan/common.c:225
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
kfree+0x104/0x228 mm/slab_common.c:1007
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/0x328 fs/super.c:492
kill_block_super+0x70/0xdc fs/super.c:1441
deactivate_locked_super+0xac/0x124 fs/super.c:332
deactivate_super+0xf0/0x110 fs/super.c:363
cleanup_mnt+0x394/0x41c fs/namespace.c:1186
__cleanup_mnt+0x20/0x30 fs/namespace.c:1193
task_work_run+0x240/0x2f0 kernel/task_work.c:179
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
do_notify_resume+0x2144/0x3470 arch/arm64/kernel/signal.c:1132
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline]
el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Allocated by task 17490:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node_track_caller+0xd0/0x1c0 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437 [inline]
__alloc_skb+0x174/0x580 net/core/skbuff.c:509
alloc_skb include/linux/skbuff.h:1267 [inline]
nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:751 [inline]
nsim_dev_trap_report drivers/net/netdevsim/dev.c:808 [inline]
nsim_dev_trap_report_work+0x1f0/0x924 drivers/net/netdevsim/dev.c:853
process_one_work+0x868/0x16f4 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x24c/0x2d4 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

Freed by task 17490:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
kfree+0x104/0x228 mm/slab_common.c:1007
skb_free_head net/core/skbuff.c:760 [inline]
skb_release_data+0x488/0x6b0 net/core/skbuff.c:789
skb_release_all net/core/skbuff.c:854 [inline]
__kfree_skb net/core/skbuff.c:868 [inline]
consume_skb+0xa0/0x178 net/core/skbuff.c:1033
nsim_dev_trap_report drivers/net/netdevsim/dev.c:824 [inline]
nsim_dev_trap_report_work+0x628/0x924 drivers/net/netdevsim/dev.c:853
process_one_work+0x868/0x16f4 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x24c/0x2d4 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860

The buggy address belongs to the object at ffff000123210000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 0 bytes inside of
4096-byte region [ffff000123210000, ffff000123211000)

The buggy address belongs to the physical page:
page:00000000856ac334 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x163210
head:00000000856ac334 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 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff00012320ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff00012320ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff000123210000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff000123210080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff000123210100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jul 23, 2023, 1:05:48 AM7/23/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: a456e1743881 Linux 6.1.39
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14d9f00ca80000
kernel config: https://syzkaller.appspot.com/x/.config?x=ab4166c71cf155ea
dashboard link: https://syzkaller.appspot.com/bug?extid=e8f9034a130a66a2b351
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1052986ea80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e4a94ce282ec/disk-a456e174.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7442cb7a697f/vmlinux-a456e174.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f51a327db171/bzImage-a456e174.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c379268e81d6/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e8f903...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: double-free in diUnmount+0xef/0x100 fs/jfs/jfs_imap.c:195
Free of addr ffff88807f2b8000 by task syz-executor.2/3578

CPU: 0 PID: 3578 Comm: syz-executor.2 Not tainted 6.1.39-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report_invalid_free+0x10c/0x130 mm/kasan/report.c:460
____kasan_slab_free+0xfb/0x120
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
diUnmount+0xef/0x100 fs/jfs/jfs_imap.c:195
jfs_umount+0x109/0x370 fs/jfs/jfs_umount.c:63
jfs_put_super+0x86/0x180 fs/jfs/super.c:194
generic_shutdown_super+0x130/0x340 fs/super.c:501
kill_block_super+0x7a/0xe0 fs/super.c:1450
deactivate_locked_super+0xa0/0x110 fs/super.c:332
cleanup_mnt+0x490/0x520 fs/namespace.c:1186
task_work_run+0x246/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:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb14447de57
Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd012159f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fb14447de57
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffd01215ab0
RBP: 00007ffd01215ab0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffd01216b70
R13: 00007fb1444c73b9 R14: 000000000001d901 R15: 0000000000000005
</TASK>

Allocated by task 3642:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node_track_caller+0xb1/0x220 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437 [inline]
__alloc_skb+0x130/0x620 net/core/skbuff.c:510
alloc_skb include/linux/skbuff.h:1268 [inline]
alloc_skb_with_frags+0xa4/0x740 net/core/skbuff.c:6143
sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2726
sock_alloc_send_skb include/net/sock.h:1896 [inline]
mld_newpack+0x1c0/0xa90 net/ipv6/mcast.c:1748
add_grhead net/ipv6/mcast.c:1851 [inline]
add_grec+0x1492/0x19a0 net/ipv6/mcast.c:1989
mld_send_cr net/ipv6/mcast.c:2115 [inline]
mld_ifc_work+0x68f/0xc90 net/ipv6/mcast.c:2653
process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2289
worker_thread+0xa5f/0x1210 kernel/workqueue.c:2436
kthread+0x26e/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Freed by task 3642:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
skb_free_head net/core/skbuff.c:760 [inline]
skb_release_data+0x5de/0x7a0 net/core/skbuff.c:789
skb_release_all net/core/skbuff.c:854 [inline]
__kfree_skb net/core/skbuff.c:868 [inline]
kfree_skb_reason+0x16f/0x390 net/core/skbuff.c:891
kfree_skb include/linux/skbuff.h:1217 [inline]
ip6_mc_input+0x980/0xb80 net/ipv6/ip6_input.c:588
NF_HOOK+0x364/0x410 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5496 [inline]
__netif_receive_skb+0x1c6/0x530 net/core/dev.c:5610
process_backlog+0x347/0x700 net/core/dev.c:5938
__napi_poll+0xc7/0x470 net/core/dev.c:6505
napi_poll net/core/dev.c:6572 [inline]
net_rx_action+0x70f/0xeb0 net/core/dev.c:6683
__do_softirq+0x2e9/0xa4c kernel/softirq.c:571

The buggy address belongs to the object at ffff88807f2b8000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 0 bytes inside of
2048-byte region [ffff88807f2b8000, ffff88807f2b8800)

The buggy address belongs to the physical page:
page:ffffea0001fcae00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7f2b8
head:ffffea0001fcae00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888012442000
raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3642, tgid 3642 (kworker/0:8), ts 122045325965, free_ts 122027212821
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
prep_new_page mm/page_alloc.c:2540 [inline]
get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xa71/0x1080 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437 [inline]
__alloc_skb+0x130/0x620 net/core/skbuff.c:510
alloc_skb include/linux/skbuff.h:1268 [inline]
alloc_skb_with_frags+0xa4/0x740 net/core/skbuff.c:6143
sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2726
sock_alloc_send_skb include/net/sock.h:1896 [inline]
mld_newpack+0x1c0/0xa90 net/ipv6/mcast.c:1748
add_grhead net/ipv6/mcast.c:1851 [inline]
add_grec+0x1492/0x19a0 net/ipv6/mcast.c:1989
mld_send_cr net/ipv6/mcast.c:2115 [inline]
mld_ifc_work+0x68f/0xc90 net/ipv6/mcast.c:2653
process_one_work+0x8aa/0x11f0 kernel/workqueue.c:2289
worker_thread+0xa5f/0x1210 kernel/workqueue.c:2436
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1460 [inline]
free_pcp_prepare mm/page_alloc.c:1510 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
free_unref_page+0x98/0x570 mm/page_alloc.c:3484
free_large_kmalloc+0xfb/0x190 mm/slab_common.c:932
diMount+0x653/0x870 fs/jfs/jfs_imap.c:115
jfs_mount_rw+0x307/0x640 fs/jfs/jfs_mount.c:238
jfs_remount+0x3cd/0x6a0 fs/jfs/super.c:454
reconfigure_super+0x3c5/0x7c0 fs/super.c:957
vfs_fsconfig_locked fs/fsopen.c:254 [inline]
__do_sys_fsconfig fs/fsopen.c:439 [inline]
__se_sys_fsconfig+0x98b/0xec0 fs/fsopen.c:314
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff88807f2b7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807f2b7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807f2b8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807f2b8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807f2b8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Sep 15, 2023, 4:09:13 PM9/15/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 09045dae0d90 Linux 6.1.53
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17a97730680000
kernel config: https://syzkaller.appspot.com/x/.config?x=195b6ef285251409
dashboard link: https://syzkaller.appspot.com/bug?extid=e8f9034a130a66a2b351
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1468ecac680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=103f42f8680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c3b1bb820e74/disk-09045dae.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4c5cfb0563d9/vmlinux-09045dae.xz
kernel image: https://storage.googleapis.com/syzbot-assets/c682edb60d96/bzImage-09045dae.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/121823923012/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e8f903...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: double-free in diUnmount+0xef/0x100 fs/jfs/jfs_imap.c:195
Free of addr ffff888022030000 by task syz-executor425/3546

CPU: 1 PID: 3546 Comm: syz-executor425 Not tainted 6.1.53-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report_invalid_free+0x10c/0x130 mm/kasan/report.c:460
____kasan_slab_free+0xfb/0x120
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
diUnmount+0xef/0x100 fs/jfs/jfs_imap.c:195
jfs_umount+0x109/0x370 fs/jfs/jfs_umount.c:63
jfs_put_super+0x86/0x180 fs/jfs/super.c:194
generic_shutdown_super+0x130/0x340 fs/super.c:501
kill_block_super+0x7a/0xe0 fs/super.c:1459
deactivate_locked_super+0xa0/0x110 fs/super.c:332
cleanup_mnt+0x490/0x520 fs/namespace.c:1186
task_work_run+0x246/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:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fbd87b85507
Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffc7a3b6088 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fbd87b85507
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffc7a3b6140
RBP: 00007ffc7a3b6140 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000206 R12: 00007ffc7a3b71c0
R13: 0000555556de96c0 R14: 431bde82d7b634db R15: 00007ffc7a3b71e0
</TASK>

Allocated by task 3546:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc+0xb2/0x230 mm/slab_common.c:968
kmalloc include/linux/slab.h:558 [inline]
tomoyo_realpath_from_path+0xcb/0x5d0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x22c/0x490 security/tomoyo/file.c:771
security_file_open+0x5f/0xa0 security/security.c:1663
do_dentry_open+0x308/0x10f0 fs/open.c:869
do_open fs/namei.c:3557 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3714
do_filp_open+0x230/0x480 fs/namei.c:3741
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 3546:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
tomoyo_realpath_from_path+0x59f/0x5d0 security/tomoyo/realpath.c:286
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x22c/0x490 security/tomoyo/file.c:771
security_file_open+0x5f/0xa0 security/security.c:1663
do_dentry_open+0x308/0x10f0 fs/open.c:869
do_open fs/namei.c:3557 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3714
do_filp_open+0x230/0x480 fs/namei.c:3741
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888022030000
which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 0 bytes inside of
4096-byte region [ffff888022030000, ffff888022031000)

The buggy address belongs to the physical page:
page:ffffea0000880c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x22030
head:ffffea0000880c00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888012442140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3546, tgid 3546 (syz-executor425), ts 71858161136, free_ts 71850423265
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
prep_new_page mm/page_alloc.c:2540 [inline]
get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
__alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xa71/0x1080 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
__do_kmalloc_node mm/slab_common.c:954 [inline]
__kmalloc+0xa1/0x230 mm/slab_common.c:968
kmalloc include/linux/slab.h:558 [inline]
tomoyo_realpath_from_path+0xcb/0x5d0 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_check_open_permission+0x22c/0x490 security/tomoyo/file.c:771
security_file_open+0x5f/0xa0 security/security.c:1663
do_dentry_open+0x308/0x10f0 fs/open.c:869
do_open fs/namei.c:3557 [inline]
path_openat+0x2644/0x2e60 fs/namei.c:3714
do_filp_open+0x230/0x480 fs/namei.c:3741
do_sys_openat2+0x13b/0x500 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_openat fs/open.c:1350 [inline]
__se_sys_openat fs/open.c:1345 [inline]
__x64_sys_openat+0x243/0x290 fs/open.c:1345
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1460 [inline]
free_pcp_prepare mm/page_alloc.c:1510 [inline]
free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
free_unref_page+0x98/0x570 mm/page_alloc.c:3484
free_large_kmalloc+0xfb/0x190 mm/slab_common.c:932
diMount+0x653/0x870 fs/jfs/jfs_imap.c:115
jfs_mount_rw+0x307/0x640 fs/jfs/jfs_mount.c:238
jfs_remount+0x3cd/0x6a0 fs/jfs/super.c:454
reconfigure_super+0x43a/0x870 fs/super.c:966
do_remount fs/namespace.c:2702 [inline]
path_mount+0xe69/0x1090 fs/namespace.c:3362
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
ffff88802202ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802202ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888022030000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888022030080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888022030100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---

syzbot

unread,
Oct 7, 2023, 12:55:32 AM10/7/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 6e2bda2c192d0244b5a78b787ef20aa10cb319b7
git tree: upstream
Author: Liu Shixin via Jfs-discussion <jfs-dis...@lists.sourceforge.net>
Date: Thu Dec 1 12:46:28 2022 +0000

jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1196bef1680000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages