[v6.1] WARNING in fscrypt_destroy_keyring

2 views
Skip to first unread message

syzbot

unread,
Mar 11, 2023, 11:16:55 AM3/11/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 11585e2f8b9d Linux 6.1.17
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16a9f8ccc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=740051f61d5ba775
dashboard link: https://syzkaller.appspot.com/bug?extid=f392c1fbf6f8ef194b04
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=170c890cc80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15ca0a34c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/344bdc1161a0/disk-11585e2f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fbb847890efd/vmlinux-11585e2f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3a06888da390/Image-11585e2f.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/66eaf46542f6/mount_0.gz

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

EXT4-fs (loop0): Test dummy encryption mode enabled
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: writeback.
fscrypt: AES-256-CTS-CBC using implementation "cts-cbc-aes-ce"
------------[ cut here ]------------
WARNING: CPU: 0 PID: 4308 at fs/crypto/keyring.c:242 fscrypt_destroy_keyring+0x174/0x244 fs/crypto/keyring.c:242
Modules linked in:
CPU: 0 PID: 4308 Comm: syz-executor377 Not tainted 6.1.17-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 : fscrypt_destroy_keyring+0x174/0x244 fs/crypto/keyring.c:242
lr : fscrypt_destroy_keyring+0x174/0x244 fs/crypto/keyring.c:242
sp : ffff80001dc97970
x29: ffff80001dc97970 x28: 1ffff00002ae5aa9 x27: dfff800000000000
x26: 0000000000000000 x25: 0000000000000002 x24: 1fffe0001b2df825
x23: dfff800000000000 x22: 0000000000000002 x21: ffff0000d97c0000
x20: ffff0000c26ea000 x19: ffff0000d96fc128 x18: ffff80001dc97320
x17: ffff80001572d000 x16: ffff8000083099b4 x15: ffff8000081c35f8
x14: 1ffff00002ae60b0 x13: dfff800000000000 x12: 0000000000000001
x11: ff80800008bb2ecc x10: 0000000000000000 x9 : ffff800008bb2ecc
x8 : ffff0000d90eb680 x7 : ffff800008b5e4fc x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff800008bb2e08
x2 : 0000000000000000 x1 : 0000000000000002 x0 : 0000000000000001
Call trace:
fscrypt_destroy_keyring+0x174/0x244 fs/crypto/keyring.c:242
generic_shutdown_super+0xac/0x328 fs/super.c:483
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
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x554/0x1a88 kernel/exit.c:869
do_group_exit+0x194/0x22c kernel/exit.c:1019
__do_sys_exit_group kernel/exit.c:1030 [inline]
__se_sys_exit_group kernel/exit.c:1028 [inline]
__wake_up_parent+0x0/0x60 kernel/exit.c:1028
__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: 15414
hardirqs last enabled at (15413): [<ffff8000083a2090>] call_rcu+0x614/0xa40 kernel/rcu/tree.c:2833
hardirqs last disabled at (15414): [<ffff80001224ba94>] el1_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:405
softirqs last enabled at (15230): [<ffff800008020ee8>] softirq_handle_end kernel/softirq.c:414 [inline]
softirqs last enabled at (15230): [<ffff800008020ee8>] __do_softirq+0xd88/0xff4 kernel/softirq.c:600
softirqs last disabled at (15223): [<ffff80000802b598>] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79
---[ end trace 0000000000000000 ]---
Unable to handle kernel paging request at virtual address dfff800000000003
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
[dfff800000000003] address between user and kernel address ranges
Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 4308 Comm: syz-executor377 Tainted: G W 6.1.17-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
pstate: 804000c5 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __lock_acquire+0x104/0x764c kernel/locking/lockdep.c:4926
lr : lock_acquire+0x300/0x8e4 kernel/locking/lockdep.c:5669
sp : ffff80001dc97060
x29: ffff80001dc97300 x28: 1ffff00002ae60af x27: ffff800008bb29f0
x26: 0000000000000001 x25: ffff700003b92e30 x24: 0000000000000000
x23: 0000000000000000 x22: 0000000000000000 x21: 0000000000000000
x20: 0000000000000000 x19: 0000000000000018 x18: ffff80001dc97398
x17: ffff80001572d000 x16: ffff80001224ff0c x15: ffff8000081c35f8
x14: 1ffff00002ae60b0 x13: ffff80001dc97180 x12: dfff800000000000
x11: ffff80000830edcc x10: ffff80001573057c x9 : 00000000000000f3
x8 : 0000000000000003 x7 : ffff800008bb29f0 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000018
Call trace:
__lock_acquire+0x104/0x764c kernel/locking/lockdep.c:4926
lock_acquire+0x300/0x8e4 kernel/locking/lockdep.c:5669
__raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
_raw_spin_lock+0x54/0x6c kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:350 [inline]
fscrypt_put_master_key_activeref+0xa0/0x408 fs/crypto/keyring.c:96
put_crypt_info+0x1e4/0x29c fs/crypto/keysetup.c:512
fscrypt_put_encryption_info+0x44/0x6c fs/crypto/keysetup.c:709
ext4_clear_inode+0x154/0x174 fs/ext4/super.c:1445
ext4_evict_inode+0x6ec/0x146c fs/ext4/inode.c:346
evict+0x260/0x68c fs/inode.c:664
iput_final fs/inode.c:1747 [inline]
iput+0x988/0xa6c fs/inode.c:1773
hook_sb_delete+0x688/0xa10 security/landlock/fs.c:1012
security_sb_delete+0x50/0x94 security/security.c:922
generic_shutdown_super+0xb4/0x328 fs/super.c:484
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
exit_task_work include/linux/task_work.h:38 [inline]
do_exit+0x554/0x1a88 kernel/exit.c:869
do_group_exit+0x194/0x22c kernel/exit.c:1019
__do_sys_exit_group kernel/exit.c:1030 [inline]
__se_sys_exit_group kernel/exit.c:1028 [inline]
__wake_up_parent+0x0/0x60 kernel/exit.c:1028
__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
Code: f006a628 b9436108 34000208 d343fe68 (386c6908)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: f006a628 adrp x8, 0xd4c7000
4: b9436108 ldr w8, [x8, #864]
8: 34000208 cbz w8, 0x48
c: d343fe68 lsr x8, x19, #3
* 10: 386c6908 ldrb w8, [x8, x12] <-- trapping instruction


---
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 can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Apr 10, 2023, 9:11:22 PM4/10/23
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit d77531fac6a1fd9f1db0195438ba5419d72b96c4
Author: Eric Biggers <ebig...@google.com>
Date: Mon Mar 13 22:12:29 2023 +0000

fscrypt: destroy keyring after security_sb_delete()

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

#syz fix: fscrypt: destroy keyring after security_sb_delete()

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