Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp2051433lqp; Tue, 16 Apr 2024 06:14:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/zb4FFZFUoZu7H4dqxd3AkQfdVdfGWSV0RDC6i7I99nvzTq1MGDknkxzkicTjEjdmRrHqzOa3+0brpqkOpz/ovk+UfXePjVpR0o8ZxQ== X-Google-Smtp-Source: AGHT+IFeEXcSbl6psoglGxFRvCn/gRd9B18SvvY2uBTOY7gdlAjAFarg5wNCQVttHQx4LROfLrDM X-Received: by 2002:a17:906:f196:b0:a51:c62f:3c91 with SMTP id gs22-20020a170906f19600b00a51c62f3c91mr2472194ejb.21.1713273280799; Tue, 16 Apr 2024 06:14:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713273280; cv=pass; d=google.com; s=arc-20160816; b=AitJP2vcTFcQWVn6dP9BnfWj6CagA4ETxHnF2/LT9NbblLu5qtgCeaPfxnmVzJvZ7j 7IXM5s/Phaw4VhCCIcw7LRtl+w/Jp2+4VVQzzY1Aj/l9YsjgqWYbKqwtWdCm35o5zeox 4Wa+t7bb4iI3LQ0iD2lYO6bBWJyH7QDLE5ewLRFTvhQxP2rRaxPZA5HqAmE7jXrELwPO f2daKlvHuX1X1IbMkHswWwxzzymrtkDgu4eW/TT7nflpZpCVOk5gLAMYHinZw+m9Lc3M 5D/dP+Wc+TzcdVTdC8O9YItqbtaN5ZKE0tr0G2hEjYvtOsBVfXyBFSx7nwNkHOu3Y6on fbzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:from:subject:message-id:date:mime-version:list-unsubscribe :list-subscribe:list-id:precedence; bh=H6OYGGa+wa2bluQBe1fsFpWf24/pbrMDuPRSn5WUZ0s=; fh=0508DUK1J7fZ8/JOP0Gu/VJ5567K7FH5FR9c9THyrpw=; b=ty1X2a7mBdV0gFRCIStKQM2wRVUm9QLVo+4bOTbMhd7pooM5ty/nrGEyIgvbaYfUpG YdHkIVVZA9fRwQCkhA/gFa43TNztZsjgx0uiy0vGACeZxf3+9/tZHpHQbMAhg8hqI1oW sLyPr161m/UEWIUL1sEkkM0wlZ3jW1djEu8dK4LdL7BvjuZzKijm/PNY0VyCL9esnJ1P K8luWsSjYGuqGJRs4IhAz7QLwt25mgB7IjChfsE2eMRLcQ7wCHUWJZ9BaPjXEOzvq59W kkcxCUIgQGVNmRM6KZpALAtuvkqbfxpMqM2iHDH5QFJtOF1rXbFOFP/UdT2xTYpYAkNW xiNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-146856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d13-20020a170906040d00b00a4710de549fsi5748876eja.635.2024.04.16.06.14.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 06:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=m3kw2wvrgufz5godrsrytgd7.apphosting.bounces.google.com); spf=pass (google.com: domain of linux-kernel+bounces-146856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 49B701F216EF for ; Tue, 16 Apr 2024 13:14:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EC1C12AAE7; Tue, 16 Apr 2024 13:14:23 +0000 (UTC) Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) (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 0F75B1292C9 for ; Tue, 16 Apr 2024 13:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713273262; cv=none; b=g/veikIciJQTcx5RfvD4VpMRHUFeLbn7daVcZ2DNVG9VN8DQ9N+yV0AnJlx/TMvUTj0am/r4K+tdUnFvA9L5w0jU5bvbr/veE6+BWHt8l8IRi3iwohTNr89+Q38h1TOEW5G0UkJydefFhMlwdarSBhNnCgsTL9Oo0P072hYdQ24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713273262; c=relaxed/simple; bh=H2aDO5hRUHxVtBzoQM9q506rMIo3n75KR3eMoKFiDYc=; h=MIME-Version:Date:Message-ID:Subject:From:To:Content-Type; b=XTqo6URdvlVmcWZ8bVwEkUBZYbb9HPoGtznx7oFmVrM2TuXdlvJTEDp/zQJXb5NzyUpdGsbeTFp9j+hUZSyvqA2BkkGRokwOx/ldKwh+U/5NgGff1tdul+RtpS+19MGQFxwl6klSvkN67sxUgBENWbT4ouk1na686W1nHGhpxgk= 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.70 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-f70.google.com with SMTP id ca18e2360f4ac-7d9913d3174so195840839f.0 for ; Tue, 16 Apr 2024 06:14:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713273260; x=1713878060; h=to:from:subject:message-id:date:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=H6OYGGa+wa2bluQBe1fsFpWf24/pbrMDuPRSn5WUZ0s=; b=XIE7lC2PlFb5mnw0hxQKCfi0+KoY056OhNAMEGvTfook0AJSjYg46reJlF6+Ofrww4 +nihU+8dmsjiousOw1Utb8XmCs8ct6gsjlJIq3KdyjEp60UCVnBnpbS43r6hyHGBihHE aKq4ooBQKGfsH0FJaV8na7FCtU8kXwYYIXl21uWfcvVqAKgf0+FGfXjzJdX9GNHTkVMD A5r3L8+jbMtI5trxJy4srXEy7EHsj4es70HynWEi7Or5xZH2ma6VZCzuoHdKEzrRLfRk 311e6W7MwPs0wyQOo3Y8DaWG+VIJLDKMxV0ZkYr0smhmIDt9zlSsKhazTvMf8gAuoP27 OKSA== X-Forwarded-Encrypted: i=1; AJvYcCX13T/oND4/LN4ECMhZmSsSPqmC7gkaOqzg2UFHQaqEDOFQu3qfMieb3xmr+zfb6xyPBT0mEfsOgZJk88R+ozpikhm6m/55F6AKngWX X-Gm-Message-State: AOJu0YyaL8nx0F0I9YbtELLRg3+JYIok+ejhAHWWHB0TgOdmI0TL0JTD FQRodRIHZSWyPGmR/d6JzU0pXOSMVo9S4uMNSrTjRCw/aMNAC3tygmJvkZ6pZ/5qYhuYmKHo2tO sp728dtYxkDXOkw152qgJnW8pdfmgF4HcR1+vVz4D2VVKuuGK9qHUc6I= 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:6638:8917:b0:482:fa6f:78f1 with SMTP id jc23-20020a056638891700b00482fa6f78f1mr571514jab.6.1713273260230; Tue, 16 Apr 2024 06:14:20 -0700 (PDT) Date: Tue, 16 Apr 2024 06:14:20 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000145ce00616368490@google.com> Subject: [syzbot] [exfat?] possible deadlock in exfat_page_mkwrite From: syzbot To: linkinjeon@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, sj1557.seo@samsung.com, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Hello, syzbot found the following issue on: HEAD commit: 66e4190e92ce Add linux-next specific files for 20240416 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=15817767180000 kernel config: https://syzkaller.appspot.com/x/.config?x=c247afaa437e6409 dashboard link: https://syzkaller.appspot.com/bug?extid=d88216a7af9446d57d59 compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 Unfortunately, I don't have any reproducer for this issue yet. Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/86891dae5f9c/disk-66e4190e.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/1ca383660bf2/vmlinux-66e4190e.xz kernel image: https://storage.googleapis.com/syzbot-assets/bf6ff37d3fcc/bzImage-66e4190e.xz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+d88216a7af9446d57d59@syzkaller.appspotmail.com ====================================================== WARNING: possible circular locking dependency detected 6.9.0-rc4-next-20240416-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/17125 is trying to acquire lock: ffff88805e616b38 (&sb->s_type->i_mutex_key#24){++++}-{3:3}, at: inode_lock include/linux/fs.h:791 [inline] ffff88805e616b38 (&sb->s_type->i_mutex_key#24){++++}-{3:3}, at: exfat_page_mkwrite+0x43a/0xea0 fs/exfat/file.c:629 but task is already holding lock: ffff88802dc76518 (sb_pagefaults#4){.+.+}-{0:0}, at: do_page_mkwrite+0x19b/0x480 mm/memory.c:3097 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (sb_pagefaults#4){.+.+}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1659 [inline] sb_start_pagefault include/linux/fs.h:1824 [inline] exfat_page_mkwrite+0x161/0xea0 fs/exfat/file.c:619 do_page_mkwrite+0x19b/0x480 mm/memory.c:3097 do_shared_fault mm/memory.c:4977 [inline] do_fault mm/memory.c:5039 [inline] do_pte_missing mm/memory.c:3881 [inline] handle_pte_fault+0x1298/0x6dc0 mm/memory.c:5359 __handle_mm_fault mm/memory.c:5500 [inline] handle_mm_fault+0x10e7/0x1bb0 mm/memory.c:5665 do_user_addr_fault arch/x86/mm/fault.c:1420 [inline] handle_page_fault arch/x86/mm/fault.c:1512 [inline] exc_page_fault+0x2b9/0x900 arch/x86/mm/fault.c:1570 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 __put_user_4+0x11/0x20 arch/x86/lib/putuser.S:86 __sys_socketpair+0x186/0x720 net/socket.c:1756 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 gup_fast_fallback+0x24c/0x2b40 mm/gup.c:3442 pin_user_pages_fast+0xcc/0x160 mm/gup.c:3566 iov_iter_extract_user_pages lib/iov_iter.c:1583 [inline] iov_iter_extract_pages+0x3db/0x720 lib/iov_iter.c:1646 dio_refill_pages fs/direct-io.c:173 [inline] dio_get_page fs/direct-io.c:214 [inline] do_direct_IO fs/direct-io.c:916 [inline] __blockdev_direct_IO+0x150a/0x49b0 fs/direct-io.c:1249 blockdev_direct_IO include/linux/fs.h:3182 [inline] exfat_direct_IO+0x1b4/0x3d0 fs/exfat/inode.c:526 generic_file_read_iter+0x231/0x430 mm/filemap.c:2783 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x9c4/0xbd0 fs/read_write.c:476 ksys_read+0x1a0/0x2c0 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#24){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:791 [inline] exfat_page_mkwrite+0x43a/0xea0 fs/exfat/file.c:629 do_page_mkwrite+0x19b/0x480 mm/memory.c:3097 do_shared_fault mm/memory.c:4977 [inline] do_fault mm/memory.c:5039 [inline] do_pte_missing mm/memory.c:3881 [inline] handle_pte_fault+0x1298/0x6dc0 mm/memory.c:5359 __handle_mm_fault mm/memory.c:5500 [inline] handle_mm_fault+0x10e7/0x1bb0 mm/memory.c:5665 do_user_addr_fault arch/x86/mm/fault.c:1420 [inline] handle_page_fault arch/x86/mm/fault.c:1512 [inline] exc_page_fault+0x2b9/0x900 arch/x86/mm/fault.c:1570 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#24 --> &mm->mmap_lock --> sb_pagefaults#4 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_pagefaults#4); lock(&mm->mmap_lock); lock(sb_pagefaults#4); lock(&sb->s_type->i_mutex_key#24); *** DEADLOCK *** 2 locks held by syz-executor.0/17125: #0: ffff88804e4ce098 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #0: ffff88804e4ce098 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5692 [inline] #0: ffff88804e4ce098 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x2f0 mm/memory.c:5752 #1: ffff88802dc76518 (sb_pagefaults#4){.+.+}-{0:0}, at: do_page_mkwrite+0x19b/0x480 mm/memory.c:3097 stack backtrace: CPU: 1 PID: 17125 Comm: syz-executor.0 Not tainted 6.9.0-rc4-next-20240416-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 check_noncircular+0x36a/0x4a0 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+0x18cb/0x58e0 kernel/locking/lockdep.c:3869 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:791 [inline] exfat_page_mkwrite+0x43a/0xea0 fs/exfat/file.c:629 do_page_mkwrite+0x19b/0x480 mm/memory.c:3097 do_shared_fault mm/memory.c:4977 [inline] do_fault mm/memory.c:5039 [inline] do_pte_missing mm/memory.c:3881 [inline] handle_pte_fault+0x1298/0x6dc0 mm/memory.c:5359 __handle_mm_fault mm/memory.c:5500 [inline] handle_mm_fault+0x10e7/0x1bb0 mm/memory.c:5665 do_user_addr_fault arch/x86/mm/fault.c:1420 [inline] handle_page_fault arch/x86/mm/fault.c:1512 [inline] exc_page_fault+0x2b9/0x900 arch/x86/mm/fault.c:1570 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7f59f325f107 Code: 7e 6f 44 16 e0 48 29 fe 48 83 e1 e0 48 01 ce 0f 1f 40 00 c5 fe 6f 4e 60 c5 fe 6f 56 40 c5 fe 6f 5e 20 c5 fe 6f 26 48 83 c6 80 fd 7f 49 60 c5 fd 7f 51 40 c5 fd 7f 59 20 c5 fd 7f 21 48 83 c1 RSP: 002b:00007ffd52a03428 EFLAGS: 00010203 RAX: 00000000200027c0 RBX: 0000000000000004 RCX: 0000000020003c20 RDX: 0000000000001500 RSI: 00007f59f2e02adf RDI: 00000000200027c0 RBP: 00007f59f33ac050 R08: 0000000000000000 R09: 0000000000000054 R10: 0000000000000000 R11: 0000000000000001 R12: 00007ffd52a035e0 R13: 0000000000000001 R14: ffffffffffffffff R15: 00007f59f3234cb0 --- 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 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