From nobody Sat Feb 7 21:20:29 2026 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) (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 A95B03A1E96 for ; Sat, 27 Dec 2025 03:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766806703; cv=none; b=lKrhqOduQCwYTHIp33d7JhI5CLz1NGQP3P0HZraLd0bxV25ZYFRndyRkQNMEUd+2q/Sw3zoWBLS3wPGAhJXjM1JpAhBzU6KlJxWqyTbqYHe8Or3Hh90hnVrsWn+oULUFpi8uskDlgRAWtCyuzX8LVVCPmIZ+MC0OwhBkPB9DX+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766806703; c=relaxed/simple; bh=maDBDcU5hbt7kUOEvL77wRLyVnWvTDP7elxDBvTLUp4=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=RlU4YDQ0+9uR8xt2Z+x8vDdqmp4CdJCfmhmzWNO7ubwBVUR6aR0k5Sr5d4GDxp7hbiu17Q/Fs0NoSYz5norFKe7deD7JxtGkr4WYqTgId8/ryoxSEuBIOvwPG61hMTcK66O3ME8QhMUwe16euo1UjbDohtM8lSgJwyAJZ0+/dk8= 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.210.71 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-ot1-f71.google.com with SMTP id 46e09a7af769-7cac9cda2d0so15774935a34.0 for ; Fri, 26 Dec 2025 19:38:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766806700; x=1767411500; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BAwvQYu2/VGxJyI7squ60SDMJ2nXEQ5geSUU2ch2Lik=; b=cBTfX7MxDJFYkaPzRZ5FpmDn/CYyLQ7McSwywLWXdbt+iYU4cKT9aqcx+kkHnzmQXW SNOF3ZKlZN4OhCiS5d9chcNvSvpRf574qhr3Pni2muCDlhsJYu6BIgJ1YHthrB5W+pYI HRQwmzJi1QwhfUkdCkifwXPRyh0e6HqPL0RreRyK9EP94oOfUgEAY7Wf01bfDf5H9DNM /T9V2SeYiyVwaqLEoFJNRoFiayq/d68pFKPg+r1Sfio5pJFYRlfW3a3gQi5Sst8MQ54j H68QygTRjaiAZUyzW6sJwZ3Ts1/BwtR3S29eyiuh+/6k5HGucd1RmtgsN7AHrE+xRgjq AeCw== X-Gm-Message-State: AOJu0YxULBNLU+PapRSbFYdd2X6aA0DXY0QeUKCLJIjtxwW1G1inmNUw KmAHO0/PuSEDcQ+CotB4PklJrCflxMRoYS+Y2WtOMegdJNC/DClV5fY6LZE7G4ue66kNOVbeRhv oopJoIK9Fqv1HnOCGaM/9KSlJ3LtGiyixWmyBjfBsA+nVSGUsLzbhYTnfPWQ= X-Google-Smtp-Source: AGHT+IEYvJXlQ7Qeo6x9W3MmTgpJVpLP+PiPht+XanzCoyXFF62XtScZpz6rXQ1xgqmdcb8xP3hDeJkkp637oL1xClPsgbnfmvns Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:b28b:0:b0:659:9a49:9022 with SMTP id 006d021491bc7-65d0eafd703mr8936755eaf.79.1766806700669; Fri, 26 Dec 2025 19:38:20 -0800 (PST) Date: Fri, 26 Dec 2025 19:38:20 -0800 In-Reply-To: <672dbfef.050a0220.69327.0001.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <694f54ac.050a0220.35954c.0085.GAE@google.com> Subject: Forwarded: Re: [syzbot] [ntfs3?] possible deadlock in ntfs_look_for_free_space From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [syzbot] [ntfs3?] possible deadlock in ntfs_look_for_free_space Author: swilczek.lx@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master From b7ce4cc69bc50a5b436e1023d682e27ea7725e16 Mon Sep 17 00:00:00 2001 From: Szymon Wilczek Date: Sat, 27 Dec 2025 04:32:44 +0100 Subject: [PATCH] ntfs3: fix circular locking dependency in run_unpack_ex Syzbot reported a circular locking dependency between wnd->rw_lock (sbi->used.bitmap) and ni->file.run_lock. The deadlock scenario: 1. ntfs_extend_mft() takes ni->file.run_lock then wnd->rw_lock. 2. run_unpack_ex() takes wnd->rw_lock then tries to acquire ni->file.run_lock inside ntfs_refresh_zone(). This creates an AB-BA deadlock. Fix this by using down_read_trylock() instead of down_read() when acquiring run_lock in run_unpack_ex(). If the lock is contended, skip ntfs_refresh_zone() - the MFT zone will be refreshed on the next MFT operation. This breaks the circular dependency since we never block waiting for run_lock while holding wnd->rw_lock. Reported-by: syzbot+d27edf9f96ae85939222@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3Dd27edf9f96ae85939222 Signed-off-by: Szymon Wilczek --- fs/ntfs3/run.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/ntfs3/run.c b/fs/ntfs3/run.c index 395b20492525..dc59cad4fa37 100644 --- a/fs/ntfs3/run.c +++ b/fs/ntfs3/run.c @@ -1131,11 +1131,14 @@ int run_unpack_ex(struct runs_tree *run, struct ntf= s_sb_info *sbi, CLST ino, struct rw_semaphore *lock =3D is_mounted(sbi) ? &sbi->mft.ni->file.run_lock : NULL; - if (lock) - down_read(lock); - ntfs_refresh_zone(sbi); - if (lock) - up_read(lock); + if (lock) { + if (down_read_trylock(lock)) { + ntfs_refresh_zone(sbi); + up_read(lock); + } + } else { + ntfs_refresh_zone(sbi); + } } up_write(&wnd->rw_lock); if (err) --=20 2.52.0