syzbot


possible deadlock in ovl_maybe_copy_up

Status: closed as dup on 2023/06/06 09:30
Subsystems: overlayfs
[Documentation on labels]
Reported-by: syzbot+c18f2f6a7b08c51e3025@syzkaller.appspotmail.com
First crash: 1495d, last: 424d
Cause bisection: introduced by (bisect log) [merge commit]:
commit b753c5a7f99f390fc100de18647ce0dcacdceafc
Author: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Wed Aug 14 01:12:45 2019 +0000

  Merge branch 'r8152-RX-improve'

Crash: general protection fault in batadv_iv_ogm_queue_add (log)
Repro: C syz .config
  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
possible deadlock in mnt_want_write (2) integrity overlayfs C done 867 421d 1289d
Discussions (5)
Title Replies (including bot) Last reply
[syzbot] Monthly overlayfs report (May 2023) 0 (1) 2023/05/06 08:19
[syzbot] Monthly overlayfs report 0 (1) 2023/04/05 08:55
Re: [syzbot] possible deadlock in ovl_maybe_copy_up 3 (3) 2021/06/22 11:40
Re: [syzbot] possible deadlock in ovl_maybe_copy_up 1 (1) 2021/06/22 08:53
possible deadlock in ovl_maybe_copy_up 1 (3) 2021/04/04 08:10

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.6.0-rc7-syzkaller-00195-g2af9b20dbb39 #0 Not tainted
------------------------------------------------------
syz-executor395/5029 is trying to acquire lock:
ffff88814c096410 (sb_writers#4){.+.+}-{0:0}, at: ovl_maybe_copy_up+0x121/0x180 fs/overlayfs/copy_up.c:1176

but task is already holding lock:
ffff8880167833e0 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x893/0x1cc0 security/integrity/ima/ima_main.c:266

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&iint->mutex){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x181/0x1340 kernel/locking/mutex.c:747
       process_measurement+0x893/0x1cc0 security/integrity/ima/ima_main.c:266
       ima_file_check+0xc2/0x110 security/integrity/ima/ima_main.c:543
       do_open fs/namei.c:3642 [inline]
       path_openat+0x17a1/0x29c0 fs/namei.c:3797
       do_filp_open+0x1de/0x430 fs/namei.c:3824
       do_sys_openat2+0x176/0x1e0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_openat fs/open.c:1453 [inline]
       __se_sys_openat fs/open.c:1448 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1448
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (sb_writers#4){.+.+}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3868 [inline]
       __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
       lock_acquire kernel/locking/lockdep.c:5753 [inline]
       lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
       percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
       __sb_start_write include/linux/fs.h:1571 [inline]
       sb_start_write include/linux/fs.h:1646 [inline]
       mnt_want_write+0x6f/0x440 fs/namespace.c:403
       ovl_maybe_copy_up+0x121/0x180 fs/overlayfs/copy_up.c:1176
       ovl_open+0x16f/0x330 fs/overlayfs/file.c:166
       do_dentry_open+0x88b/0x1730 fs/open.c:929
       vfs_open fs/open.c:1063 [inline]
       dentry_open+0x13f/0x1d0 fs/open.c:1079
       ima_calc_file_hash+0x2c4/0x4a0 security/integrity/ima/ima_crypto.c:558
       ima_collect_measurement+0x5e2/0x6f0 security/integrity/ima/ima_api.c:289
       process_measurement+0xc87/0x1cc0 security/integrity/ima/ima_main.c:345
       ima_file_check+0xc2/0x110 security/integrity/ima/ima_main.c:543
       do_open fs/namei.c:3642 [inline]
       path_openat+0x17a1/0x29c0 fs/namei.c:3797
       do_filp_open+0x1de/0x430 fs/namei.c:3824
       do_sys_openat2+0x176/0x1e0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_openat fs/open.c:1453 [inline]
       __se_sys_openat fs/open.c:1448 [inline]
       __x64_sys_openat+0x175/0x210 fs/open.c:1448
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&iint->mutex);
                               lock(sb_writers#4);
                               lock(&iint->mutex);
  rlock(sb_writers#4);

 *** DEADLOCK ***

1 lock held by syz-executor395/5029:
 #0: ffff8880167833e0 (&iint->mutex){+.+.}-{3:3}, at: process_measurement+0x893/0x1cc0 security/integrity/ima/ima_main.c:266

stack backtrace:
CPU: 1 PID: 5029 Comm: syz-executor395 Not tainted 6.6.0-rc7-syzkaller-00195-g2af9b20dbb39 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3868 [inline]
 __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136
 lock_acquire kernel/locking/lockdep.c:5753 [inline]
 lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718
 percpu_down_read include/linux/percpu-rwsem.h:51 [inline]
 __sb_start_write include/linux/fs.h:1571 [inline]
 sb_start_write include/linux/fs.h:1646 [inline]
 mnt_want_write+0x6f/0x440 fs/namespace.c:403
 ovl_maybe_copy_up+0x121/0x180 fs/overlayfs/copy_up.c:1176
 ovl_open+0x16f/0x330 fs/overlayfs/file.c:166
 do_dentry_open+0x88b/0x1730 fs/open.c:929
 vfs_open fs/open.c:1063 [inline]
 dentry_open+0x13f/0x1d0 fs/open.c:1079
 ima_calc_file_hash+0x2c4/0x4a0 security/integrity/ima/ima_crypto.c:558
 ima_collect_measurement+0x5e2/0x6f0 security/integrity/ima/ima_api.c:289
 process_measurement+0xc87/0x1cc0 security/integrity/ima/ima_main.c:345
 ima_file_check+0xc2/0x110 security/integrity/ima/ima_main.c:543
 do_open fs/namei.c:3642 [inline]
 path_openat+0x17a1/0x29c0 fs/namei.c:3797
 do_filp_open+0x1de/0x430 fs/namei.c:3824
 do_sys_openat2+0x176/0x1e0 fs/open.c:1422
 do_sys_open fs/open.c:1437 [inline]
 __do_sys_openat fs/open.c:1453 [inline]
 __se_sys_openat fs/open.c:1448 [inline]
 __x64_sys_openat+0x175/0x210 fs/open.c:1448
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc16aae9469
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff32799958 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007fc16aae9469
RDX: 0000000000000043 RSI: 00000000200000c0 RDI: 00000000ffffff

Crashes (1018):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/29 11:44 upstream 2af9b20dbb39 3c418d72 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/10/19 10:02 upstream dd72f9c7e512 342b9c55 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/06/07 00:55 upstream a4d7d7011219 a4ae4f42 .config strace log report syz C ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/05/06 18:38 upstream 2e1e1337881b 90c93c40 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ovl_maybe_copy_up
2022/11/13 01:57 upstream 8f2975c2bb4c 3ead01ad .config strace log report syz C ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/07/11 01:39 linux-next fe57d0d86f03 52ae002a .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2022/12/15 23:56 linux-next 459c73db4069 6f9c033e .config strace log report syz C ci-upstream-linux-next-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2021/04/03 19:18 linux-next 454c576c3f5e 6a81331a .config console log report syz C ci-upstream-linux-next-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/10/27 11:39 upstream 3a568e3a961b bf285f0c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ovl_maybe_copy_up
2023/10/22 02:07 upstream 9c5d00cb7b6b 361b23dc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/10/12 06:16 upstream 8182d7a3f1b8 83165b57 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in ovl_maybe_copy_up
2023/09/28 04:32 upstream 633b47cb009d 2895a507 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/26 09:28 upstream 6465e260f487 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/24 10:34 upstream 3aba70aed91f 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/23 04:36 upstream 8018e02a8703 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/23 02:18 upstream 8018e02a8703 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/22 14:42 upstream 27bbf45eae9c 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/22 02:13 upstream b5cbe7c00aa0 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/21 23:53 upstream b5cbe7c00aa0 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/21 13:21 upstream 42dc814987c1 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/21 10:11 upstream 42dc814987c1 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/20 21:50 upstream 5d2f53532ecc 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/20 20:09 upstream 5d2f53532ecc 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/20 11:54 upstream 2cf0f7156238 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/19 18:12 upstream 2cf0f7156238 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/19 01:16 upstream 2cf0f7156238 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/18 23:15 upstream 2cf0f7156238 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/18 14:08 upstream ce9ecca0238b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/18 12:26 upstream ce9ecca0238b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/18 10:46 upstream ce9ecca0238b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/18 10:05 upstream ce9ecca0238b 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/17 23:14 upstream e789286468a9 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/17 21:26 upstream e789286468a9 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/17 05:15 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/17 02:31 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/16 19:24 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in ovl_maybe_copy_up
2023/09/16 13:45 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/16 12:06 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/16 11:10 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/09/24 18:05 upstream 3aba70aed91f 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in ovl_maybe_copy_up
2023/09/24 02:13 upstream 3aba70aed91f 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/23 13:36 upstream d90b0276af8f 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/23 00:04 upstream 8018e02a8703 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/22 11:05 upstream 27bbf45eae9c 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/22 09:53 upstream 27bbf45eae9c 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/21 20:44 upstream b5cbe7c00aa0 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/21 11:58 upstream 42dc814987c1 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/21 07:49 upstream 42dc814987c1 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/17 20:14 upstream e789286468a9 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/17 00:07 upstream f0b0d403eabb 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/09/16 10:06 upstream 57d88e8a5974 0b6a67ac .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/08/30 14:19 upstream d68b4b6f307d b42ca3a7 .config console log report info ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/08/26 10:00 upstream 382d4cd18475 03d9c195 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/08/15 20:29 upstream 91aa6c412d7f 39990d51 .config console log report info ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/08/14 17:00 upstream 2ccdd1b13c59 39990d51 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/08/08 20:05 upstream 14f9643dc90a 3c27dfcd .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2023/08/06 14:47 upstream f0ab9f34e59e 4ffcc9ef .config console log report info ci-upstream-kasan-gce-selinux-root possible deadlock in ovl_maybe_copy_up
2023/08/30 11:42 upstream d68b4b6f307d b42ca3a7 .config console log report info ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/08/07 12:12 upstream 52a93d39b17d 0ef3dfda .config console log report info ci-qemu-upstream-386 possible deadlock in ovl_maybe_copy_up
2023/07/22 11:21 linux-next ae867bc97b71 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in ovl_maybe_copy_up
2021/01/03 14:41 upstream 3516bd729358 79264ae3 .config console log report info ci-upstream-kasan-gce-root
2020/11/22 09:45 upstream a349e4c65960 0d27f508 .config console log report info ci-upstream-kasan-gce-selinux-root
2020/11/22 09:40 upstream a349e4c65960 0d27f508 .config console log report info ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.