From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f78.google.com (mail-io1-f78.google.com [209.85.166.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F337D190470 for ; Sat, 11 Jan 2025 10:30:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.78 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736591424; cv=none; b=jbd8MLIplZ+nOvdIX3GoBPZOmKPrPkjoWeNsdv17MqnlEBWu/SlI8nfX33pBFn8N/qdOhuQS1/lRTnGU4Oym5y7fsl4eEYZ7oqkUdlvFPZOm6XAkC/G/1JmWajyPnsorQYOlZ9b2sQIwf7ARh6w43OvDv7qGujnxF+dPAA9GN2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736591424; c=relaxed/simple; bh=5O32lzAhM+EgqbW1JikPRLAG+x9jufnGW3wE1DqHR2w=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=tAVANtlftd9/CBkT2x7MVSF+Wrbe4nvURxX//2QRHS/+J30eYgGj7ouvW9UgGxNkAD/NsyE4UoX3246MD9koWzgSgxvG3WOMdQqpxQDGSPTc8piC+IyAxjDAsj7+hAgfZnvc+E9sqzxIhCu6jpxBr7tXnlwFE01+xNNiKpB5LrU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.78 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-io1-f78.google.com with SMTP id ca18e2360f4ac-84cdae60616so252407439f.3 for ; Sat, 11 Jan 2025 02:30:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736591422; x=1737196222; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VSqg2RwLsr2QdTfUEcGbi49Eoo5SryWYkHuqWaDgCxY=; b=E3o0Qubi4Reo+6DkLBrMDfYcwhlBNsodeu6PIA7RkD6XSgYOjdhWIgQufk1zG0nsKV gkL8GGM896euut546YHuzN2AH1dMGpdsjldKBhiLVYVFW66GNz9DYnuzI71LD1PXHBSA vT+Jyyk6fJg3mcmx9YN2G7Fq8OLmVfDbsNpTqmt/sVhAcOMKrcLsCxynJBJ3dl/pukvM Xjfcf+yxJqCKrLana0LsWal/Id1OTANivmq5r7qNruR0t43kfegsPg2ayhT5qeuHtn/m bVuCNkvGDTNg9LHOLP9/pi0RyvL53MkzK/ZxxJwOYY/K3qspkV7ljFBAH5Q8ZRYhhEO6 XGTw== X-Forwarded-Encrypted: i=1; AJvYcCVn5OPVz5CgY5NWCVmHuEcTShnZu8grRq/BtcS94W1phlOTkSmotsHA39zqjAeW9Y6ZWbCu0knGqYjkSf0=@vger.kernel.org X-Gm-Message-State: AOJu0YxIiwSoEEvjMTVRdMZXXxinfQleVXeoCsgBGEBavCXrqZ7pEFN2 AE8hll3bTvMdyXS4FkQCRAkWBki0cQ4vd3v5mhikHnjhRm18i8gMqccopfey2CWtH56k/Meyagl qrsM6P3jYGnUqni3oddB5/HbINAy8a4U1C6dnyNXT+PeN3DuaCiLoyCA= X-Google-Smtp-Source: AGHT+IHYsycE2Qd0CgZhe/p9uNwCPNn0rp8o5q0B7bAG7N7YjyB8zK8qgi/o1PEOAau+eXf4Kp03jDaAcrY8EaVBfPGaS8JlwNdZ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:1687:b0:3a7:85ee:fa78 with SMTP id e9e14a558f8ab-3ce3a9c190dmr104980195ab.18.1736591422054; Sat, 11 Jan 2025 02:30:22 -0800 (PST) Date: Sat, 11 Jan 2025 02:30:22 -0800 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6782483e.050a0220.216c54.001d.GAE@google.com> Subject: [syzbot] [kernel?] possible deadlock in binder_alloc_free_page From: syzbot To: arve@android.com, brauner@kernel.org, cmllamas@google.com, gregkh@linuxfoundation.org, joel@joelfernandes.org, linux-kernel@vger.kernel.org, maco@android.com, surenb@google.com, syzkaller-bugs@googlegroups.com, tkjos@android.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: 7b4b9bf203da Add linux-next specific files for 20250107 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=17d02dc4580000 kernel config: https://syzkaller.appspot.com/x/.config?x=63fa2c9d5e12faef dashboard link: https://syzkaller.appspot.com/bug?extid=799a2d4576c454ac2693 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10302dc4580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/c179cc0c7a3c/disk-7b4b9bf2.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/fdea80f2ec16/vmlinux-7b4b9bf2.xz kernel image: https://storage.googleapis.com/syzbot-assets/a277fcaff608/bzImage-7b4b9bf2.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+799a2d4576c454ac2693@syzkaller.appspotmail.com binder: 7926:7927 ioctl 4018620d 0 returned -22 ====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc6-next-20250107-syzkaller #0 Not tainted ------------------------------------------------------ syz.2.906/7927 is trying to acquire lock: ffff88803376f5c8 (vm_lock){++++}-{0:0}, at: binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 but task is already holding lock: ffff888030320e30 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] ffff888030320e30 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&l->lock){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 list_lru_add+0x59/0x270 mm/list_lru.c:163 list_lru_add_obj+0x17b/0x250 mm/list_lru.c:186 __inode_add_lru fs/inode.c:534 [inline] iput_final fs/inode.c:1923 [inline] iput+0x89c/0xa50 fs/inode.c:1972 __dentry_kill+0x20d/0x630 fs/dcache.c:625 shrink_kill+0xa9/0x2c0 fs/dcache.c:1070 shrink_dentry_list+0x2c0/0x5b0 fs/dcache.c:1097 shrink_dcache_sb+0x25e/0x3e0 fs/dcache.c:1217 reconfigure_super+0x2c6/0x870 fs/super.c:1061 do_remount fs/namespace.c:3100 [inline] path_mount+0xc22/0xfa0 fs/namespace.c:3879 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4088 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&sb->s_type->i_lock_key#23){+.+.}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:351 [inline] __mark_inode_dirty+0x3ff/0xe90 fs/fs-writeback.c:2540 generic_update_time fs/inode.c:2112 [inline] inode_update_time fs/inode.c:2125 [inline] __file_update_time fs/inode.c:2353 [inline] file_update_time+0x3d2/0x450 fs/inode.c:2383 ext4_page_mkwrite+0x210/0x1100 fs/ext4/inode.c:6160 do_page_mkwrite+0x159/0x340 mm/memory.c:3244 wp_page_shared mm/memory.c:3645 [inline] do_wp_page+0x23cd/0x49b0 mm/memory.c:3795 handle_pte_fault mm/memory.c:5905 [inline] __handle_mm_fault+0x24cf/0x70f0 mm/memory.c:6032 handle_mm_fault+0x3e2/0x8c0 mm/memory.c:6201 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x459/0x8b0 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #1 (sb_pagefaults){.+.+}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 percpu_down_read+0x44/0x1b0 include/linux/percpu-rwsem.h:51 __sb_start_write include/linux/fs.h:1773 [inline] sb_start_pagefault include/linux/fs.h:1938 [inline] ext4_page_mkwrite+0x1f9/0x1100 fs/ext4/inode.c:6159 do_page_mkwrite+0x159/0x340 mm/memory.c:3244 do_shared_fault mm/memory.c:5468 [inline] do_fault mm/memory.c:5530 [inline] do_pte_missing mm/memory.c:4047 [inline] handle_pte_fault mm/memory.c:5889 [inline] __handle_mm_fault+0x22dc/0x70f0 mm/memory.c:6032 handle_mm_fault+0x3e2/0x8c0 mm/memory.c:6201 do_user_addr_fault arch/x86/mm/fault.c:1337 [inline] handle_page_fault arch/x86/mm/fault.c:1480 [inline] exc_page_fault+0x459/0x8b0 arch/x86/mm/fault.c:1538 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (vm_lock){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x35f/0x9a0 mm/memory.c:6436 binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0x170/0x470 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0xc4/0xa70 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x138/0x260 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x72d/0x1160 mm/shrinker.c:437 shrink_slab+0x1093/0x14d0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x142/0x280 mm/vmscan.c:439 drop_caches_sysctl_handler+0xbc/0x160 fs/drop_caches.c:68 proc_sys_call_handler+0x5ec/0x920 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x71a/0x9d0 vfs_writev+0x38b/0xbc0 fs/read_write.c:1050 do_writev+0x1b6/0x360 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: vm_lock --> &sb->s_type->i_lock_key#23 --> &l->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&l->lock); lock(&sb->s_type->i_lock_key#23); lock(&l->lock); rlock(vm_lock); *** DEADLOCK *** 4 locks held by syz.2.906/7927: #0: ffff888032732d38 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x254/0x320 fs/file.c:1192 #1: ffff888027bea420 (sb_writers#3){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3016 [inline] #1: ffff888027bea420 (sb_writers#3){.+.+}-{0:0}, at: vfs_writev+0x2d6/0xbc0 fs/read_write.c:1048 #2: ffff888030320e30 (&l->lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock.h:351 [inline] #2: ffff888030320e30 (&l->lock){+.+.}-{3:3}, at: lock_list_lru_of_memcg+0x24c/0x4d0 mm/list_lru.c:77 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline] #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:3}, at: lock_vma_under_rcu+0x1dd/0x9a0 mm/memory.c:6431 stack backtrace: CPU: 1 UID: 0 PID: 7927 Comm: syz.2.906 Not tainted 6.13.0-rc6-next-20250107-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 vma_start_read include/linux/mm.h:749 [inline] lock_vma_under_rcu+0x35f/0x9a0 mm/memory.c:6436 binder_alloc_free_page+0x150/0xd50 drivers/android/binder_alloc.c:1156 __list_lru_walk_one+0x170/0x470 mm/list_lru.c:300 list_lru_walk_one mm/list_lru.c:337 [inline] list_lru_walk_node+0xc4/0xa70 mm/list_lru.c:357 list_lru_walk include/linux/list_lru.h:282 [inline] binder_shrink_scan+0x138/0x260 drivers/android/binder_alloc.c:1226 do_shrink_slab+0x72d/0x1160 mm/shrinker.c:437 shrink_slab+0x1093/0x14d0 mm/shrinker.c:664 drop_slab_node mm/vmscan.c:421 [inline] drop_slab+0x142/0x280 mm/vmscan.c:439 drop_caches_sysctl_handler+0xbc/0x160 fs/drop_caches.c:68 proc_sys_call_handler+0x5ec/0x920 fs/proc/proc_sysctl.c:601 do_iter_readv_writev+0x71a/0x9d0 vfs_writev+0x38b/0xbc0 fs/read_write.c:1050 do_writev+0x1b6/0x360 fs/read_write.c:1096 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc9ae785d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc9af619038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007fc9ae975fa0 RCX: 00007fc9ae785d29 RDX: 0000000000000001 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00007fc9ae801b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc9ae975fa0 R15: 00007ffd15c33b58 syz.2.906 (7927): drop_caches: 2 --- 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 syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title 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. If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup