From nobody Mon Apr 6 09:49:46 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 D414329B766 for ; Fri, 20 Mar 2026 06:25:23 +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=1773987925; cv=none; b=W581kDHEICPq0luFrRuMoJXOTS5MXgmSvc4SFTXhAJOz+fK1vxXKMV3y8y/LrVJ3Y2uP3lmdff7ArMkMM1tymPQXMRcT9DfIPN2YR+JtJY9Xwu9874AtU4ogqo71ttznxd2ZRdIz/0pYRlmKbNMKR5I1HLfSILYcomElEo7/wMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773987925; c=relaxed/simple; bh=HoG3+7Lxt5B5v7BpOnxLp3LaadC69bzU5YbVQ2Al9O4=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=E2TAGqeAKa8julJH5MrkfDug6yDpi2dbXKqREuLY0TxV37Aohi4UAXN5KNXKw5TeqYgNMQMDELGMPBm2f6PTWagbFubZnAezXA1wuYWprW0XToyNyIHOjqDABA7kclsYVkjIGyExZj4pJ5D4BZrMPlDBZfdVZJ9tchNXOJXbDCs= 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-67a1e063795so34336701eaf.1 for ; Thu, 19 Mar 2026 23:25:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773987923; x=1774592723; 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=ZrserMBFtFO+pOWMWHycAxfydkl0ekf/B7rc5f3Ak7k=; b=ieOzui/lZyjBQr7+jth+uN1AwOxuGvfHNO1X7RdiCddtXoF/v41z6ggLnCe1AWYMSM ThZWw+wOkv0YNPcX9pElJ2ShViuLBe0MbfdPeUNbfI+p0twjnaKosYVFsrnB1of6Ep4h jlx6ILfg4X+7QWsadVg5CKe95OYCp3jtfBKJY7uW4M2SxPV9LHzZkCm1YbI9jvKTs1S4 LOnJr0+3f/V/GuZaFMCm00i7q6wSaa7+zo9Bxa1J7FcyaVRGzbqpx3Ujq9XkToaYLtM5 k0zCShUu/fdO2wnqAGflm7S7YoQUS6l1sdg6wldrL/IgGajF2tV3+Zy0fqV4T2L9tzkq DAqQ== X-Gm-Message-State: AOJu0Yws8vOUOlexvVB5QrvmGWb1crEbMFeLOG3+0JJBI7cJEUtxXsO/ 0U+ScMpgsQszP3p8BYHcAM5SC0xq7vckfRRaNvLD3YJfAY1mbkhiQatN+pATLrH8sQxCeTNdVMh SAYaEXU54x2rN3eE9TzEVvGxFSiXI9yZyQ9TOdbWFB3LUL4yJBm9+j3JK0RI= 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:2901:b0:67b:cb84:677a with SMTP id 006d021491bc7-67c1840f157mr4541526eaf.24.1773987922856; Thu, 19 Mar 2026 23:25:22 -0700 (PDT) Date: Thu, 19 Mar 2026 23:25:22 -0700 In-Reply-To: <69bba3ff.050a0220.227207.0031.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69bce852.050a0220.3bf4de.000f.GAE@google.com> Subject: Forwarded: [PATCH] nilfs2: fix missing continue after -ENOENT in nilfs_ioctl_mark_blocks_dirty() 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 missing continue after -ENOENT in nilfs_ioctl_= mark_blocks_dirty() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master nilfs_ioctl_mark_blocks_dirty() calls nilfs_bmap_lookup_at_level() to get the current block number of each block descriptor. When the lookup returns -ENOENT, meaning the block does not exist, it sets bd_blocknr to 0 and continues processing. However, if bd_oblocknr is also 0, the subsequent check: if (bdescs[i].bd_blocknr !=3D bdescs[i].bd_oblocknr) continue; will not skip the block, and nilfs_bmap_mark() will be called on a non-existent block. This causes nilfs_btree_do_lookup() to return -ENOENT, triggering the WARN_ON(ret =3D=3D -ENOENT). Fix this by adding a continue statement after setting bd_blocknr to 0 when the lookup returns -ENOENT, so that dead blocks are always skipped regardless of the value of bd_oblocknr. Fixes: 7942b919f732 ("nilfs2: ioctl operations") Reported-by: syzbot+98a040252119df0506f8@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D98a040252119df0506f8 Signed-off-by: Deepanshu Kartikey --- fs/nilfs2/ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index e17b8da66491..1615a314f557 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -745,6 +745,7 @@ static int nilfs_ioctl_mark_blocks_dirty(struct the_nil= fs *nilfs, if (ret !=3D -ENOENT) return ret; bdescs[i].bd_blocknr =3D 0; + continue; } if (bdescs[i].bd_blocknr !=3D bdescs[i].bd_oblocknr) /* skip dead block */ --=20 2.43.0