From nobody Tue Apr 7 01:01:14 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.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 C27923563F6 for ; Tue, 17 Mar 2026 08:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773735991; cv=none; b=rUFbuyxfdB/w5qxxI5cqn336FJ0JrMakMBpnYC+Bvq82ZIOg5bYYPsTTcIUYJ1rJObF3ae9IqBBgGOhwvel/ZoXtVshL06gmkNH2x6lKdh5ot39lxSuTXB/5twoupyHZTMfmtAvQwijPXg4FdCrBBIyrCKg5JO2YnPkeWMBNf5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773735991; c=relaxed/simple; bh=/Vo/TcBV/gtDFeD72SW8fiaB30eLusF6/QQ0c8tz0I4=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=R6Y6gsW68a6ZJ+C0ItD06Xu53Pc2SXoUkQEi+zjUMBCRxeBochMb6RbsmuOuE5idaV4mEV1S5f2QFWU6kXrg+F41i8tM16AZ7/KW0QAhBpWDnIUd3UNQ4bTJasVs6pMktr2kn+QIJk4nVCmnK9kfykPUld0tzy1eLGhiBpCuZ9Y= 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.161.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-oo1-f71.google.com with SMTP id 006d021491bc7-67bd1b31789so46351187eaf.0 for ; Tue, 17 Mar 2026 01:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773735988; x=1774340788; 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=sRsleizg5CeqxNqYjOhIGY1dalsvvAlHH7fJxxTjQPo=; b=ITxeXs3kXzIKngkD2R1kAyFUIqB3wySE+VqR3Z0pqFD4Ef2o+p1HZ1DaXnAYFksgv/ mUPN9i9cZv2i4ia3QRFfl8Sfs0uRVUeW3lZeBuSGU0MRSKbXDiRf1jvDGoMqqxTrTg71 H10g9qL3sfIdCII0Xk/XkSLFTTxCWFv0wDJ4KSLW7NaYll0vxoKeM5y/f5hwsCAzgTen WtNSjovqi1quNLGYyzwWv7Uj3rdRKuFfOXK8jdWoIk+IPhVBAnHL/EFMbsN8FyW9a7ht 1ZVXnrpi6aXs96B4vuU+XD9rUHE6HG6N4oDlwrqLG5HJwWGHVEA/wfQJkrz6Xbe+nyuA e8Ww== X-Gm-Message-State: AOJu0YxiP3di+OIFpFoPMlQ7fpkohwoeU5yIuG2kdAj3gBsU9ZjTiMDP o1uOYBHkaavbKnldnwHvJ3RCgwYnnfMrgNjjPczxPaFWkFY1qzE2NOZA3Y9Rj06yBm2vAv7++jG Oyi6T/pbTr9IteDILB7VRCFxhEn7prMGme9lF11KxF6OMLO/Jn798r2BXzVs= 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:6820:151a:b0:679:dcb5:b83e with SMTP id 006d021491bc7-67bdaa62c6bmr10276920eaf.58.1773735988729; Tue, 17 Mar 2026 01:26:28 -0700 (PDT) Date: Tue, 17 Mar 2026 01:26:28 -0700 In-Reply-To: <69b8c713.a00a0220.3b25d1.0029.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69b91034.050a0220.12d28.016e.GAE@google.com> Subject: Forwarded: [PATCH] nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_save_to_shadow_map 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: [PATCH] nilfs2: fix NULL i_assoc_inode dereference in nilfs_mdt_sa= ve_to_shadow_map Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master The DAT inode's btree node cache (i_assoc_inode) is initialized lazily during btree operations. However, nilfs_mdt_save_to_shadow_map() assumes i_assoc_inode is already initialized when copying dirty pages to the shadow map during GC. If NILFS_IOCTL_CLEAN_SEGMENTS is called immediately after mount before any btree operation has occurred on the DAT inode, i_assoc_inode is NULL leading to a general protection fault. Fix this by calling nilfs_attach_btree_node_cache() on the DAT inode in nilfs_dat_read() at mount time, ensuring i_assoc_inode is always initialized before any GC operation can use it. Reported-by: syzbot+4b4093b1f24ad789bf37@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D4b4093b1f24ad789bf37 Signed-off-by: Deepanshu Kartikey --- fs/nilfs2/dat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nilfs2/dat.c b/fs/nilfs2/dat.c index 674380837ab9..888dc1831c86 100644 --- a/fs/nilfs2/dat.c +++ b/fs/nilfs2/dat.c @@ -524,6 +524,9 @@ int nilfs_dat_read(struct super_block *sb, size_t entry= _size, if (err) goto failed; =20 + err =3D nilfs_attach_btree_node_cache(dat); + if (err) + goto failed; err =3D nilfs_read_inode_common(dat, raw_inode); if (err) goto failed; --=20 2.43.0