[v6.1] WARNING in ext4_dirty_folio

8 views
Skip to first unread message

syzbot

unread,
Jul 8, 2023, 9:03:58 AM7/8/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 61fd484b2cf6 Linux 6.1.38
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12bd33e8a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=6f0f33ddb500fad0
dashboard link: https://syzkaller.appspot.com/bug?extid=6d41dcf689b8618244d6
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/898eff1fdc20/disk-61fd484b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/c5a649af018f/vmlinux-61fd484b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/30a2cee1f58d/Image-61fd484b.gz.xz

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

------------[ cut here ]------------
WARNING: CPU: 0 PID: 8466 at fs/ext4/inode.c:3645 ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
Modules linked in:
CPU: 0 PID: 8466 Comm: syz-executor.2 Not tainted 6.1.38-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
lr : ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
sp : ffff80002bc27980
x29: ffff80002bc27980 x28: 1fffff8000971ca8 x27: 1fffff8000971ca9
x26: dfff800000000000 x25: 05ffc80000000013 x24: 1fffff8000971ca8
x23: 1fffff8000971ca9 x22: dfff800000000000 x21: fffffc0004b8e568
x20: ffff0000e2505518 x19: fffffc0004b8e540 x18: ffff80002bc27520
x17: ffff8000155cd000 x16: ffff800008301d74 x15: 0000000000000000
x14: 0000000000000002 x13: 0800000000000000 x12: 0000000000040000
x11: 000000000003ffff x10: ffff80001ec2e000 x9 : ffff800008e5cb04
x8 : 0000000000040000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff800008831764
x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000
Call trace:
ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
folio_mark_dirty+0x118/0x198 mm/page-writeback.c:2749
unpin_user_pages_dirty_lock+0x244/0x464 mm/gup.c:343
xdp_umem_unpin_pages net/xdp/xdp_umem.c:26 [inline]
xdp_umem_pin_pages net/xdp/xdp_umem.c:121 [inline]
xdp_umem_reg net/xdp/xdp_umem.c:218 [inline]
xdp_umem_create+0x874/0xd6c net/xdp/xdp_umem.c:251
xsk_setsockopt+0x74c/0x9e4 net/xdp/xsk.c:1107
__sys_setsockopt+0x3a8/0x70c net/socket.c:2252
__do_sys_setsockopt net/socket.c:2263 [inline]
__se_sys_setsockopt net/socket.c:2260 [inline]
__arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2260
__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: 22950
hardirqs last enabled at (22949): [<ffff800008850ac4>] count_memcg_events include/linux/memcontrol.h:1061 [inline]
hardirqs last enabled at (22949): [<ffff800008850ac4>] count_memcg_event_mm+0x1b0/0x308 include/linux/memcontrol.h:1093
hardirqs last disabled at (22950): [<ffff80001210cb4c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (21188): [<ffff800008020d74>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (21188): [<ffff800008020d74>] __do_softirq+0xc14/0xea0 kernel/softirq.c:600
softirqs last disabled at (21163): [<ffff80000802a994>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 8466 at mm/page-writeback.c:2615 __folio_mark_dirty+0xd4/0xd04
Modules linked in:
CPU: 1 PID: 8466 Comm: syz-executor.2 Tainted: G W 6.1.38-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __folio_mark_dirty+0xd4/0xd04
lr : __folio_mark_dirty+0xd4/0xd04
sp : ffff80002bc278b0
x29: ffff80002bc278d0 x28: dfff800000000000 x27: 0000000000000000
x26: dfff800000000000 x25: 05ffc80000000013 x24: fffffc0004b8e558
x23: 05ffc8000000001b x22: ffff0000e2505518 x21: 1fffff8000971ca8
x20: ffff0000e2505520 x19: fffffc0004b8e540 x18: ffff80002bc275a0
x17: ffff8000155cd000 x16: ffff80000831bb60 x15: 000000000002b592
x14: 000000006d06a68b x13: dfff800000000000 x12: 0000000000040000
x11: 000000000003ffff x10: ffff80001ec2e000 x9 : ffff80000876e680
x8 : 0000000000040000 x7 : 0000000000000000 x6 : 0000000000000000
x5 : ffff8000188d4670 x4 : 0000000000000008 x3 : ffff80000831bc90
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
__folio_mark_dirty+0xd4/0xd04
block_dirty_folio+0x184/0x21c fs/buffer.c:640
ext4_dirty_folio+0x108/0x170 fs/ext4/inode.c:3646
folio_mark_dirty+0x118/0x198 mm/page-writeback.c:2749
unpin_user_pages_dirty_lock+0x244/0x464 mm/gup.c:343
xdp_umem_unpin_pages net/xdp/xdp_umem.c:26 [inline]
xdp_umem_pin_pages net/xdp/xdp_umem.c:121 [inline]
xdp_umem_reg net/xdp/xdp_umem.c:218 [inline]
xdp_umem_create+0x874/0xd6c net/xdp/xdp_umem.c:251
xsk_setsockopt+0x74c/0x9e4 net/xdp/xsk.c:1107
__sys_setsockopt+0x3a8/0x70c net/socket.c:2252
__do_sys_setsockopt net/socket.c:2263 [inline]
__se_sys_setsockopt net/socket.c:2260 [inline]
__arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2260
__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: 23114
hardirqs last enabled at (23113): [<ffff80000827b66c>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last enabled at (23113): [<ffff80000827b66c>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000
hardirqs last disabled at (23114): [<ffff8000121ef7c8>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (23114): [<ffff8000121ef7c8>] _raw_spin_lock_irqsave+0xa4/0xb4 kernel/locking/spinlock.c:162
softirqs last enabled at (23084): [<ffff800008020d74>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (23084): [<ffff800008020d74>] __do_softirq+0xc14/0xea0 kernel/softirq.c:600
softirqs last disabled at (22953): [<ffff80000802a994>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---


---
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.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Jul 8, 2023, 10:27:51 AM7/8/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 61fd484b2cf6 Linux 6.1.38
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12298fb4a80000
kernel config: https://syzkaller.appspot.com/x/.config?x=6f0f33ddb500fad0
dashboard link: https://syzkaller.appspot.com/bug?extid=6d41dcf689b8618244d6
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=124ed412a80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=105a4018a80000
mounted in repro: https://storage.googleapis.com/syzbot-assets/f5947e553c2a/mount_0.gz

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

------------[ cut here ]------------
WARNING: CPU: 1 PID: 22 at fs/ext4/inode.c:3645 ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
Modules linked in:
CPU: 1 PID: 22 Comm: kworker/1:0 Not tainted 6.1.38-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Workqueue: events xdp_umem_release_deferred
pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
lr : ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
sp : ffff800019c77a00
x29: ffff800019c77a00 x28: 1fffff800070fdf8 x27: 1fffff800070fdf9
x26: dfff800000000000 x25: 05ffc80000000053 x24: 1fffff800070fdf8
x23: 1fffff800070fdf9 x22: dfff800000000000 x21: fffffc000387efe8
x20: ffff0000dfac22f0 x19: fffffc000387efc0 x18: ffff800019c772a0
x17: ffff8000088aad88 x16: ffff800008301d74 x15: ffff80000880b280
x14: ffff80000895e8f4 x13: ffff80000802a8f8 x12: 0000000000000001
x11: ff80800008e5cb04 x10: 0000000000000000 x9 : ffff800008e5cb04
x8 : ffff0000c0a4b780 x7 : ffff80000896cd78 x6 : ffff80000896a200
x5 : ffff0000d9e8df58 x4 : ffff800011fee804 x3 : ffff800008831764
x2 : 0000000000000001 x1 : 0000000000000001 x0 : 0000000000000000
Call trace:
ext4_dirty_folio+0x12c/0x170 fs/ext4/inode.c:3645
folio_mark_dirty+0x118/0x198 mm/page-writeback.c:2749
unpin_user_pages_dirty_lock+0x244/0x464 mm/gup.c:343
xdp_umem_unpin_pages net/xdp/xdp_umem.c:26 [inline]
xdp_umem_release+0xd4/0x220 net/xdp/xdp_umem.c:61
xdp_umem_release_deferred+0x20/0x30 net/xdp/xdp_umem.c:71
process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
irq event stamp: 32556
hardirqs last enabled at (32555): [<ffff80000896e0a4>] kasan_quarantine_put+0xdc/0x204 mm/kasan/quarantine.c:242
hardirqs last disabled at (32556): [<ffff80001210cb4c>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (31364): [<ffff800010b20d30>] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32
softirqs last disabled at (31362): [<ffff800010b20cfc>] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 22 at mm/page-writeback.c:2615 __folio_mark_dirty+0xd4/0xd04
Modules linked in:
CPU: 1 PID: 22 Comm: kworker/1:0 Tainted: G W 6.1.38-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Workqueue: events xdp_umem_release_deferred
pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __folio_mark_dirty+0xd4/0xd04
lr : __folio_mark_dirty+0xd4/0xd04
sp : ffff800019c77930
x29: ffff800019c77950 x28: dfff800000000000 x27: 0000000000000000
x26: dfff800000000000 x25: 05ffc80000000053 x24: fffffc000387efd8
x23: 05ffc8000000005b x22: ffff0000dfac22f0 x21: 1fffff800070fdf8
x20: ffff0000dfac22f8 x19: fffffc000387efc0 x18: ffff800019c77620
x17: ffff8000155cd000 x16: ffff80000831bb60 x15: 000000000000c07f
x14: 000000003bd5ee91 x13: dfff800000000000 x12: ffff70000338ef0c
x11: ff8080000876e680 x10: 0000000000000000 x9 : ffff80000876e680
x8 : ffff0000c0a4b780 x7 : 0000000000000000 x6 : 0000000000000000
x5 : ffff8000187861f0 x4 : 0000000000000008 x3 : ffff80000831bc90
x2 : 0000000000000001 x1 : 0000000000000000 x0 : 0000000000000000
Call trace:
__folio_mark_dirty+0xd4/0xd04
block_dirty_folio+0x184/0x21c fs/buffer.c:640
ext4_dirty_folio+0x108/0x170 fs/ext4/inode.c:3646
folio_mark_dirty+0x118/0x198 mm/page-writeback.c:2749
unpin_user_pages_dirty_lock+0x244/0x464 mm/gup.c:343
xdp_umem_unpin_pages net/xdp/xdp_umem.c:26 [inline]
xdp_umem_release+0xd4/0x220 net/xdp/xdp_umem.c:61
xdp_umem_release_deferred+0x20/0x30 net/xdp/xdp_umem.c:71
process_one_work+0x7ac/0x1404 kernel/workqueue.c:2289
worker_thread+0x8e4/0xfec kernel/workqueue.c:2436
kthread+0x250/0x2d8 kernel/kthread.c:376
ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860
irq event stamp: 32594
hardirqs last enabled at (32593): [<ffff80000827b66c>] raw_spin_rq_unlock_irq kernel/sched/sched.h:1367 [inline]
hardirqs last enabled at (32593): [<ffff80000827b66c>] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:5000
hardirqs last disabled at (32594): [<ffff8000121ef7c8>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
hardirqs last disabled at (32594): [<ffff8000121ef7c8>] _raw_spin_lock_irqsave+0xa4/0xb4 kernel/locking/spinlock.c:162
softirqs last enabled at (32582): [<ffff800008020d74>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (32582): [<ffff800008020d74>] __do_softirq+0xc14/0xea0 kernel/softirq.c:600
softirqs last disabled at (32559): [<ffff80000802a994>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---


---
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 30, 2023, 5:42:32 AM9/30/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 8ac268436e6d52f3bb4d212df9395aec97afaa00
git tree: upstream
Author: Lorenzo Stoakes <lsto...@gmail.com>
Date: Thu May 4 21:27:52 2023 +0000

mm/gup: disallow FOLL_LONGTERM GUP-nonfast writing to file-backed mappings

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=152c351a680000
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