[v6.1] WARNING in kvfree

7 views
Skip to first unread message

syzbot

unread,
Mar 31, 2023, 10:05:53 AM3/31/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3b29299e5f60 Linux 6.1.22
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=154e2e7dc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbb9a1f6f7f5a1d9
dashboard link: https://syzkaller.appspot.com/bug?extid=403fcf14b61d7ef57dd1
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/2affbd06cbfd/disk-3b29299e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8b22d1baf827/vmlinux-3b29299e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d5e3891c88bf/Image-3b29299e.gz.xz

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

EXT4-fs: Warning: mounting with an experimental mount option 'dioread_nolock' for blocksize < PAGE_SIZE
EXT4-fs (loop2): 1 truncate cleaned up
EXT4-fs (loop2): mounted filesystem without journal. Quota mode: writeback.
------------[ cut here ]------------
WARNING: CPU: 0 PID: 7773 at mm/slab_common.c:923 free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
Modules linked in:
CPU: 0 PID: 7773 Comm: syz-executor.2 Not tainted 6.1.22-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
lr : kfree+0x10c/0x1b8 mm/slab_common.c:1001
sp : ffff80001ecf74e0
x29: ffff80001ecf74e0 x28: ffff0000d743d800 x27: dfff800000000000
x26: 0000000000000020 x25: ffff000127aef5a4 x24: 0000000000000020
x23: ffff0000db510800 x22: 0000000000000000 x21: ffff800008808174
x20: ffff000127aef5a4 x19: fffffc00049ebbc0 x18: ffff80001ecf6e60
x17: 0000000000000000 x16: ffff8000120d9934 x15: ffff800008a6534c
x14: ffff800008a64f1c x13: ffff800008061bb4 x12: 0000000000040000
x11: 00000000000133aa x10: ffff800022519000 x9 : 00000000049ebbc0
x8 : ffff800017e93000 x7 : ffff800008061ea0 x6 : ffff8000080620b0
x5 : ffff0000c1f7e288 x4 : ffff80001ecf72b0 x3 : 0000000000000000
x2 : 0000000000000006 x1 : ffff000127aef5a4 x0 : fffffc00049ebbc0
Call trace:
free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
kfree+0x10c/0x1b8 mm/slab_common.c:1001
kvfree+0x40/0x50 mm/util.c:627
ext4_xattr_move_to_block fs/ext4/xattr.c:2629 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
ext4_expand_extra_isize_ea+0xcbc/0x1688 fs/ext4/xattr.c:2784
__ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5890
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
__ext4_mark_inode_dirty+0x484/0x8fc fs/ext4/inode.c:6011
__ext4_unlink+0x758/0x988 fs/ext4/namei.c:3255
ext4_unlink+0x1d8/0x7d0 fs/ext4/namei.c:3298
vfs_unlink+0x2f0/0x508 fs/namei.c:4252
do_unlinkat+0x4c8/0x82c fs/namei.c:4320
__do_sys_unlinkat fs/namei.c:4363 [inline]
__se_sys_unlinkat fs/namei.c:4356 [inline]
__arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4356
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 4630
hardirqs last enabled at (4629): [<ffff8000089680cc>] kasan_quarantine_put+0xdc/0x204 mm/kasan/quarantine.c:242
hardirqs last disabled at (4630): [<ffff8000120d55ec>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (4034): [<ffff800008032b74>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (4032): [<ffff800008032b40>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
object pointer: 0x000000007ee6e2ae
==================================================================
BUG: KASAN: invalid-free in kfree+0x10c/0x1b8 mm/slab_common.c:1001
Free of addr ffff000127aef5a4 by task syz-executor.2/7773

CPU: 0 PID: 7773 Comm: syz-executor.2 Tainted: G W 6.1.22-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_kfree_large+0xa4/0xc0 mm/kasan/common.c:272
kasan_kfree_large include/linux/kasan.h:185 [inline]
free_large_kmalloc+0x70/0x15c mm/slab_common.c:927
kfree+0x10c/0x1b8 mm/slab_common.c:1001
kvfree+0x40/0x50 mm/util.c:627
ext4_xattr_move_to_block fs/ext4/xattr.c:2629 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
ext4_expand_extra_isize_ea+0xcbc/0x1688 fs/ext4/xattr.c:2784
__ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5890
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
__ext4_mark_inode_dirty+0x484/0x8fc fs/ext4/inode.c:6011
__ext4_unlink+0x758/0x988 fs/ext4/namei.c:3255
ext4_unlink+0x1d8/0x7d0 fs/ext4/namei.c:3298
vfs_unlink+0x2f0/0x508 fs/namei.c:4252
do_unlinkat+0x4c8/0x82c fs/namei.c:4320
__do_sys_unlinkat fs/namei.c:4363 [inline]
__se_sys_unlinkat fs/namei.c:4356 [inline]
__arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4356
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

The buggy address belongs to the physical page:
page:00000000330f11da refcount:2 mapcount:0 mapping:00000000274e2bc3 index:0x1 pfn:0x167aef
memcg:ffff0000d8ff0000
aops:def_blk_aops ino:700002
flags: 0x5ffce000002205e(referenced|uptodate|dirty|lru|workingset|private|mappedtodisk|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffce000002205e fffffc00032d05c8 fffffc0004a67648 ffff0000c049bf10
raw: 0000000000000001 ffff00012312a3a0 00000002ffffffff ffff0000d8ff0000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000127aef480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff000127aef500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff000127aef580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffff000127aef600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff000127aef680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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,
May 7, 2023, 8:05:05 AM5/7/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1788c522280000
kernel config: https://syzkaller.appspot.com/x/.config?x=aea4bb7802570997
dashboard link: https://syzkaller.appspot.com/bug?extid=403fcf14b61d7ef57dd1
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=125860dc280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12ab92b8280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ec11c1903c52/disk-ca48fc16.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8ce41c1ad391/vmlinux-ca48fc16.xz
kernel image: https://storage.googleapis.com/syzbot-assets/affba5631cad/Image-ca48fc16.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/12eb7de95ed7/mount_0.gz

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

EXT4-fs: Warning: mounting with an experimental mount option 'dioread_nolock' for blocksize < PAGE_SIZE
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4217 at mm/slab_common.c:923 free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
Modules linked in:
CPU: 0 PID: 4217 Comm: syz-executor366 Not tainted 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
lr : kfree+0x10c/0x1b8 mm/slab_common.c:1001
sp : ffff80001d9c74e0
x29: ffff80001d9c74e0 x28: ffff0000cb50dc00 x27: dfff800000000000
x26: 0000000000000020 x25: ffff0001b2e275a4 x24: 0000000000000020
x23: ffff0000cb50df00 x22: 0000000000000000 x21: ffff800008809f54
x20: ffff0001b2e275a4 x19: fffffc0006cb89c0 x18: ffff80001d9c69e0
x17: ffff80001558d000 x16: ffff8000120e6354 x15: ffff800008a69cdc
x14: ffff800008a698ac x13: ffff800008061bb4 x12: 0000000000000003
x11: ff80800008098054 x10: 0000000000000000 x9 : 0000000006cb89c0
x8 : ffff800017ea4000 x7 : ffff800008061ea0 x6 : ffff8000080620b0
x5 : ffff0000cc8d4178 x4 : ffff80001d9c72b0 x3 : 0000000000000000
x2 : 0000000000000006 x1 : ffff0001b2e275a4 x0 : fffffc0006cb89c0
Call trace:
free_large_kmalloc+0x34/0x15c mm/slab_common.c:924
kfree+0x10c/0x1b8 mm/slab_common.c:1001
kvfree+0x40/0x50 mm/util.c:627
ext4_xattr_move_to_block fs/ext4/xattr.c:2629 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
ext4_expand_extra_isize_ea+0xcbc/0x1688 fs/ext4/xattr.c:2784
__ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5890
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5933 [inline]
__ext4_mark_inode_dirty+0x484/0x8fc fs/ext4/inode.c:6011
__ext4_unlink+0x758/0x988 fs/ext4/namei.c:3255
ext4_unlink+0x1d8/0x7d0 fs/ext4/namei.c:3298
vfs_unlink+0x2f0/0x508 fs/namei.c:4252
do_unlinkat+0x4c8/0x82c fs/namei.c:4320
__do_sys_unlinkat fs/namei.c:4363 [inline]
__se_sys_unlinkat fs/namei.c:4356 [inline]
__arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4356
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581
irq event stamp: 19094
hardirqs last enabled at (19093): [<ffff80000896b310>] kasan_quarantine_put+0xdc/0x204 mm/kasan/quarantine.c:242
hardirqs last disabled at (19094): [<ffff8000120e200c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (18910): [<ffff800008032b74>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (18908): [<ffff800008032b40>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
object pointer: 0x00000000d64fdf11
==================================================================
BUG: KASAN: invalid-free in kfree+0x10c/0x1b8 mm/slab_common.c:1001
Free of addr ffff0001b2e275a4 by task syz-executor366/4217

CPU: 0 PID: 4217 Comm: syz-executor366 Tainted: G W 6.1.27-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
page:000000009404f30f refcount:3 mapcount:0 mapping:00000000793fb8c4 index:0x1 pfn:0x1f2e27
memcg:ffff0000c0930000
aops:def_blk_aops ino:700000
flags: 0x5ffc6000002204e(referenced|uptodate|dirty|workingset|private|mappedtodisk|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc6000002204e 0000000000000000 dead000000000122 ffff0000c054bf10
raw: 0000000000000001 ffff0000e24443a0 00000003ffffffff ffff0000c0930000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0001b2e27480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0001b2e27500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff0001b2e27580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffff0001b2e27600: 00 00 00 00


---
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,
Jun 6, 2023, 3:35:31 PM6/6/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit c5fa4eedddd1c8342ce533cb401c0e693e55b4e3
Author: Theodore Ts'o <ty...@mit.edu>
Date: Sun Apr 30 07:04:13 2023 +0000

ext4: fix invalid free tracking in ext4_xattr_move_to_block()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11fa3495280000
start commit: ca48fc16c493 Linux 6.1.27
git tree: linux-6.1.y
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: ext4: fix invalid free tracking in ext4_xattr_move_to_block()

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