[ 138.199466][ T1337] ieee802154 phy0 wpan0: encryption failed: -22 [ 138.199519][ T1337] ieee802154 phy1 wpan1: encryption failed: -22 [ 140.505540][ T1030] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [ 140.505562][ T1030] ata1.00: irq_stat 0x40000000 [ 140.505572][ T1030] ata1.00: failed command: WRITE DMA EXT [ 140.505578][ T1030] ata1.00: cmd 35/00:f8:f6:c9:04/00:09:00:00:00/e0 tag 14 dma 1306624 out [ 140.505578][ T1030] res 41/04:f8:f6:c9:04/00:09:00:00:00/e0 Emask 0x1 (device error) [ 140.505606][ T1030] ata1.00: status: { DRDY ERR } [ 140.505614][ T1030] ata1.00: error: { ABRT } [ 140.506662][ T1030] ata1.00: configured for UDMA/100 [ 140.507612][ T1030] ata1: EH complete Warning: Permanently added '[localhost]:18960' (ED25519) to the list of known hosts. [*] Reproducer for deadlock in ima_path_truncate starting... [+] Mounted securityfs (or already mounted). [ 145.314384][ T25] audit: type=1807 audit(1795573689.665:2): action=measure func=FILE_CHECK res=1 [+] Loaded IMA policy 'measure func=FILE_CHECK'. [ 145.322445][ T5659] ima: policy update completed [ 145.322603][ T25] audit: type=1802 audit(1795573689.675:3): pid=5659 uid=0 auid=4294967295 ses=4294967295 subj=unconfined op=policy_update cause=completed comm="syz-executor272" res=1 errno=0 [+] Synthesized ext4 image at /tmp/ext4.img (16777216 bytes, 4096 inodes). [ 145.605843][ T1030] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0 [ 145.605866][ T1030] ata1.00: irq_stat 0x40000000 [ 145.605878][ T1030] ata1.00: failed command: WRITE DMA EXT [ 145.605884][ T1030] ata1.00: cmd 35/00:98:36:e1:04/00:08:00:00:00/e0 tag 14 dma 1126400 out [ 145.605884][ T1030] res 41/04:98:36:e1:04/00:08:00:00:00/e0 Emask 0x1 (device error) [ 145.605914][ T1030] ata1.00: status: { DRDY ERR } [ 145.605921][ T1030] ata1.00: error: { ABRT } [ 145.608799][ T1030] ata1.00: configured for UDMA/100 [ 145.609795][ T1030] ata1: EH complete [ 145.663740][ T5659] loop0: detected capacity change from 0 to 32768 [+] Bound /tmp/ext4.img to /dev/loop0. [ 145.696751][ T25] audit: type=1800 audit(1795573690.055:4): pid=4712 uid=0 auid=4294967295 ses=4294967295 subj=unconfined op=collect_data cause=failed comm="udevd" name="uevent" dev="sysfs" ino=14984 res=0 errno=-22 [ 145.725589][ T5659] EXT4-fs (loop0): mounted filesystem 42424242-4242-4242-4242-424242424242 r/w without journal. Quota mode: none. [+] Mounted ext4 on /tmp/upper_fs. [ 145.735276][ T5659] ext4 filesystem being mounted at /tmp/upper_fs supports timestamps until 2038-01-19 (0x7fffffff) [ 145.769761][ T25] audit: type=1800 audit(1795573690.125:5): pid=4712 uid=0 auid=4294967295 ses=4294967295 subj=unconfined op=collect_data cause=failed comm="udevd" name="uevent" dev="sysfs" ino=14984 res=0 errno=-22 [+] Mounted overlay on /tmp/ovl. [+] Opened /dev/cachefiles. [+] Set cachefiles dir /tmp/ovl/cache. [ 145.894886][ T5659] netfs: Cache "CacheFiles" added (type cachefiles) [ 145.894911][ T5659] CacheFiles: File cache on CacheFiles registered [+] Bound cachefiles. [+] Created socketpair. [+] Started 9P server thread. [+] Mounted 9p with fscache on /tmp/9p. [*] Step 1: Opening 9p file f1 to trigger IMA measurement and fscache cookie lookup... [ 146.009463][ T25] audit: type=1800 audit(1795573690.365:6): pid=5664 uid=0 auid=4294967295 ses=4294967295 subj=unconfined op=collect_data cause=failed comm="udevd" name="uevent" dev="sysfs" ino=126647 res=0 errno=-22 [+] Opened /tmp/9p/f1. [*] Waiting 500ms for fscache worker (Link 3: ovl_i_mutex -> sb_writers)... [*] Step 2: Dirtying 9p pagecache and truncating to trigger Link 2... [+] Wrote 4096 bytes to /tmp/9p/f1. [+] Opened /tmp/9p/f1 with O_TRUNC. [ 146.787647][ T5659] evm: overlay not supported [*] Step 3: Creating target file on upper_fs and overlayfs... [+] Created /tmp/upper_fs/target. [+] Opened /tmp/upper_fs/target O_RDONLY to attach IMA iint. [ 147.009107][ T5659] [ 147.010294][ T5659] ====================================================== [ 147.013394][ T5659] WARNING: possible circular locking dependency detected [ 147.016547][ T5659] syzkaller #0 Not tainted [ 147.018556][ T5659] ------------------------------------------------------ [ 147.021704][ T5659] syz-executor272/5659 is trying to acquire lock: [ 147.024446][ T5659] ffff88801359bed0 (&ima_iint_mutex_key[depth]){+.+.}-{4:4}, at: ima_path_truncate+0xd3/0x190 [ 147.028986][ T5659] [ 147.028986][ T5659] but task is already holding lock: [ 147.032222][ T5659] ffff888051144478 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 [ 147.036072][ T5659] [ 147.036072][ T5659] which lock already depends on the new lock. [ 147.036072][ T5659] [ 147.040628][ T5659] [ 147.040628][ T5659] the existing dependency chain (in reverse order) is: [ 147.044499][ T5659] [ 147.044499][ T5659] -> #3 (sb_writers#4){.+.+}-{0:0}: [ 147.047730][ T5659] sb_start_write+0x48/0x1c0 [ 147.050104][ T5659] mnt_want_write+0x41/0x90 [ 147.052368][ T5659] ovl_xattr_set+0x15c/0x5e0 [ 147.054759][ T5659] __vfs_setxattr+0x442/0x480 [ 147.057082][ T5659] __vfs_setxattr_noperm+0x12a/0x660 [ 147.059593][ T5659] vfs_setxattr+0x151/0x370 [ 147.061830][ T5659] cachefiles_preset_object_xattr+0x142/0x3e0 [ 147.064693][ T5659] cachefiles_create_tmpfile+0x3e7/0x790 [ 147.067183][ T5659] cachefiles_create_file+0x78/0x140 [ 147.069793][ T5659] cachefiles_look_up_object+0x38c/0x7b0 [ 147.072480][ T5659] cachefiles_lookup_cookie+0x374/0x750 [ 147.075002][ T5659] fscache_cookie_worker+0xa77/0x1170 [ 147.077605][ T5659] process_scheduled_works+0xc3d/0x1630 [ 147.082116][ T5659] worker_thread+0xa47/0xfb0 [ 147.084360][ T5659] kthread+0x38b/0x480 [ 147.086310][ T5659] ret_from_fork+0x514/0xb70 [ 147.088631][ T5659] ret_from_fork_asm+0x1a/0x30 [ 147.091002][ T5659] [ 147.091002][ T5659] -> #2 (&ovl_i_mutex_key[depth]){+.+.}-{4:4}: [ 147.094649][ T5659] down_write+0x91/0x200 [ 147.096877][ T5659] ovl_write_iter+0x1fb/0x3b0 [ 147.099147][ T5659] vfs_iocb_iter_write+0x245/0x5e0 [ 147.101616][ T5659] __cachefiles_write+0x6c9/0xbd0 [ 147.104063][ T5659] netfs_advance_write+0x328/0x4b0 [ 147.106493][ T5659] netfs_writepages+0x12d3/0x22b0 [ 147.108901][ T5659] do_writepages+0x338/0x560 [ 147.111132][ T5659] filemap_fdatawrite+0x1e9/0x2f0 [ 147.113616][ T5659] v9fs_vfs_setattr_dotl+0x4dc/0xab0 [ 147.116198][ T5659] notify_change+0xbba/0xea0 [ 147.118354][ T5659] do_truncate+0x1c2/0x250 [ 147.120299][ T5659] path_openat+0x18a6/0x20f0 [ 147.122357][ T5659] do_file_open+0x23e/0x4a0 [ 147.124534][ T5659] do_sys_openat2+0x115/0x200 [ 147.126809][ T5659] __x64_sys_openat+0x138/0x170 [ 147.129093][ T5659] do_syscall_64+0x171/0x540 [ 147.131447][ T5659] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 147.134290][ T5659] [ 147.134290][ T5659] -> #1 (&sb->s_type->i_mutex_key#25){++++}-{4:4}: [ 147.137978][ T5659] down_read_interruptible+0x4b/0x3b0 [ 147.140557][ T5659] netfs_start_io_read+0x25/0x180 [ 147.142970][ T5659] netfs_buffered_read_iter+0xd6/0x160 [ 147.145515][ T5659] __kernel_read+0x4ca/0x960 [ 147.147689][ T5659] integrity_kernel_read+0x89/0xd0 [ 147.150248][ T5659] ima_calc_file_hash+0x451/0x890 [ 147.152705][ T5659] ima_collect_measurement+0x51b/0xa00 [ 147.155358][ T5659] process_measurement+0x1272/0x1c10 [ 147.157945][ T5659] ima_file_check+0xdc/0x130 [ 147.160238][ T5659] security_file_post_open+0xb3/0x260 [ 147.162574][ T5659] path_openat+0x1748/0x20f0 [ 147.164759][ T5659] do_file_open+0x23e/0x4a0 [ 147.167001][ T5659] do_sys_openat2+0x115/0x200 [ 147.169267][ T5659] __x64_sys_openat+0x138/0x170 [ 147.171661][ T5659] do_syscall_64+0x171/0x540 [ 147.173892][ T5659] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 147.176614][ T5659] [ 147.176614][ T5659] -> #0 (&ima_iint_mutex_key[depth]){+.+.}-{4:4}: [ 147.180326][ T5659] __lock_acquire+0x164c/0x2de0 [ 147.182629][ T5659] lock_acquire+0x115/0x350 [ 147.184823][ T5659] __mutex_lock+0x197/0x15a0 [ 147.187013][ T5659] ima_path_truncate+0xd3/0x190 [ 147.189345][ T5659] security_path_truncate+0x1d0/0x310 [ 147.192011][ T5659] vfs_truncate+0x46e/0x540 [ 147.194255][ T5659] ksys_truncate+0xf3/0x1c0 [ 147.196407][ T5659] __x64_sys_truncate+0x5b/0x70 [ 147.198740][ T5659] do_syscall_64+0x171/0x540 [ 147.200982][ T5659] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 147.203805][ T5659] [ 147.203805][ T5659] other info that might help us debug this: [ 147.203805][ T5659] [ 147.208267][ T5659] Chain exists of: [ 147.208267][ T5659] &ima_iint_mutex_key[depth] --> &ovl_i_mutex_key[depth] --> sb_writers#4 [ 147.208267][ T5659] [ 147.214542][ T5659] Possible unsafe locking scenario: [ 147.214542][ T5659] [ 147.217808][ T5659] CPU0 CPU1 [ 147.220118][ T5659] ---- ---- [ 147.222506][ T5659] rlock(sb_writers#4); [ 147.224375][ T5659] lock(&ovl_i_mutex_key[depth]); [ 147.227392][ T5659] lock(sb_writers#4); [ 147.230411][ T5659] lock(&ima_iint_mutex_key[depth]); [ 147.232849][ T5659] [ 147.232849][ T5659] *** DEADLOCK *** [ 147.232849][ T5659] [ 147.236372][ T5659] locks held by syz-executor272/5659: 1, on CPU#0: [ 147.239156][ T5659] #0: ffff888051144478 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 [ 147.243222][ T5659] [ 147.243222][ T5659] stack backtrace: [ 147.248088][ T5659] CPU: 0 UID: 0 PID: 5659 Comm: syz-executor272 Not tainted syzkaller #0 PREEMPT(full) [ 147.252004][ T5659] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 [ 147.256460][ T5659] Call Trace: [ 147.257990][ T5659] [ 147.259323][ T5659] dump_stack_lvl+0xe8/0x150 [ 147.261290][ T5659] print_circular_bug+0x2e2/0x300 [ 147.263541][ T5659] check_noncircular+0x12f/0x150 [ 147.265854][ T5659] __lock_acquire+0x164c/0x2de0 [ 147.268022][ T5659] ? kasan_quarantine_put+0xbb/0x1f0 [ 147.270409][ T5659] lock_acquire+0x115/0x350 [ 147.272467][ T5659] ? ima_path_truncate+0xd3/0x190 [ 147.274835][ T5659] __mutex_lock+0x197/0x15a0 [ 147.276882][ T5659] ? ima_path_truncate+0xd3/0x190 [ 147.279142][ T5659] ? current_check_access_path+0x205/0x510 [ 147.281761][ T5659] ? ima_path_truncate+0xd3/0x190 [ 147.284244][ T5659] ? __pfx___mutex_lock+0x10/0x10 [ 147.286516][ T5659] ? apparmor_path_truncate+0x38b/0x450 [ 147.288993][ T5659] ? __pfx_apparmor_path_truncate+0x10/0x10 [ 147.291792][ T5659] ima_path_truncate+0xd3/0x190 [ 147.293982][ T5659] security_path_truncate+0x1d0/0x310 [ 147.296365][ T5659] vfs_truncate+0x46e/0x540 [ 147.298380][ T5659] ? __pfx_vfs_truncate+0x10/0x10 [ 147.300669][ T5659] ? do_getname+0x151/0x250 [ 147.302709][ T5659] ksys_truncate+0xf3/0x1c0 [ 147.304763][ T5659] ? __pfx_ksys_truncate+0x10/0x10 [ 147.307147][ T5659] ? __pfx_ksys_write+0x10/0x10 [ 147.309360][ T5659] __x64_sys_truncate+0x5b/0x70 [ 147.311550][ T5659] do_syscall_64+0x171/0x540 [ 147.313689][ T5659] ? trace_irq_disable+0x3b/0x140 [ 147.316040][ T5659] ? entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 147.318709][ T5659] ? clear_bhb_loop+0x70/0xc0 [ 147.320923][ T5659] entry_SYSCALL_64_after_hwframe+0x77/0x7f [ 147.323567][ T5659] RIP: 0033:0x7f0e2c62c7c7 [ 147.325642][ T5659] Code: 44 00 00 31 ff e8 89 f7 ff ff 48 8b 2d f2 81 2a 00 85 c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 0f 1f 44 00 00 b8 4c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 d0 ff ff ff f7 d8 64 89 02 b8 [ 147.334323][ T5659] RSP: 002b:00007ffe754e2898 EFLAGS: 00000246 ORIG_RAX: 000000000000004c [ 147.338171][ T5659] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f0e2c62c7c7 [ 147.341827][ T5659] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 00007f0e2c69ea92 [ 147.345380][ T5659] RBP: 00007ffe754e2940 R08: 0000000000000000 R09: 0000000000000000 [ 147.348892][ T5659] R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0e2c69eab0 [ 147.352492][ T5659] R13: 00007ffe754e28c0 R14: 00007ffe754e2980 R15: 00007f0e2c69e8cf [ 147.356055][ T5659] [+] Created /tmp/ovl/target. [+] Opened /tmp/ovl/target O_RDONLY to attach IMA iint. [*] Truncating target files to trigger circular locking dependency warning... [+] Reproducer completed all steps successfully. [ 148.926209][ T5659] CacheFiles: File cache on CacheFiles unregistering [ 148.926243][ T5659] netfs: Withdrawing cache "CacheFiles" (6 objs)