Linux filesystem development
 help / color / mirror / Atom feed
From: Jeremy Bingham <jbingham@gmail.com>
To: syzbot+cie60057db19604ba2@syzkaller.appspotmail.com
Cc: brauner@kernel.org, hch@infradead.org, jack@suse.cz,
	jbingham@gmail.com, jkoolstra@xs4all.nl,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzbot@lists.linux.dev, syzkaller-bugs@googlegroups.com,
	syzkaller@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: [syzbot ci] Re: minix: convert to iomap and add direct I/O
Date: Mon, 29 Jun 2026 20:05:35 -0700	[thread overview]
Message-ID: <20260630030535.3309854-1-jbingham@gmail.com> (raw)
In-Reply-To: 6a42024c.9dc7bc9d.3393b4.0006.GAE@google.com

#syz test

minix: add the same dentry check as ext4_get_link to minix_get_link

It turns out that minix_get_link does need to have both the sb_bread and
the sb_getblk paths, like ext4_get_link does. It working with just the
sb_bread one initially was deceptive.
---
 fs/minix/namei.c | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/fs/minix/namei.c b/fs/minix/namei.c
index e245f55a68ff..a4caaa3f7c9a 100644
--- a/fs/minix/namei.c
+++ b/fs/minix/namei.c
@@ -393,12 +393,23 @@ const char *minix_get_link(struct dentry *dentry, struct inode *inode,
 	else
 		blk = v2_block_to_cpu(*(v2_i_data(inode)));
 
-	bh = sb_bread(sb, blk);
-	if (IS_ERR(bh))
-		return ERR_CAST(bh);
-	if (!bh) {
-		pr_err("bad symlink on inode %llu", inode->i_ino);
-		return ERR_PTR(-EFSCORRUPTED);
+	/* This tried dodging the dentry check that ext4 does, but it turns out
+	 * that it's necessary after all.
+	 */
+	if (!dentry) {
+		bh = sb_getblk(sb, blk);
+		if (!bh || !buffer_uptodate(bh)) {
+			brelse(bh);
+			return ERR_PTR(-ECHILD);
+		}
+	} else {
+		bh = sb_bread(sb, blk);
+		if (IS_ERR(bh))
+			return ERR_CAST(bh);
+		if (!bh) {
+			pr_err("bad symlink on inode %llu", inode->i_ino);
+			return ERR_PTR(-EFSCORRUPTED);
+		}
 	}
 
 	set_delayed_call(callback, minix_free_link, bh);
-- 
2.47.3


  reply	other threads:[~2026-06-30  3:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28  5:15 [PATCH v2 0/4] minix: convert to iomap and add direct I/O Jeremy Bingham
2026-06-28  5:15 ` [PATCH v2 1/4] minix: add iomap infrastructure Jeremy Bingham
2026-07-01 18:06   ` Darrick J. Wong
2026-07-01 18:32     ` Jeremy Bingham
2026-06-28  5:15 ` [PATCH v2 2/4] minix: convert address space operations to iomap Jeremy Bingham
2026-07-01 18:14   ` Darrick J. Wong
2026-07-01 18:37     ` Jeremy Bingham
2026-07-01 18:47       ` Darrick J. Wong
2026-06-28  5:15 ` [PATCH v2 3/4] minix: convert file operations to iomap and add Jeremy Bingham
2026-07-01 18:21   ` Darrick J. Wong
2026-07-01 18:42     ` Jeremy Bingham
2026-06-28  5:15 ` [PATCH v2 4/4] minix: fix symlink and truncate for iomap Jeremy Bingham
2026-06-29  5:27 ` [syzbot ci] Re: minix: convert to iomap and add direct I/O syzbot ci
2026-06-30  3:05   ` Jeremy Bingham [this message]
2026-06-30  4:05     ` syzbot ci
2026-07-01 18:00 ` [PATCH v2 0/4] " Darrick J. Wong
2026-07-02 18:42   ` Jeremy Bingham
     [not found] <6a3ed243.656f0a6b.201ab1.0000.GAE@google.com>
2026-06-26 20:21 ` [syzbot ci] " Jeremy Bingham
  -- strict thread matches above, loose matches on Subject: below --
2026-06-25 21:48 [PATCH 0/3] " Jeremy Bingham
2026-06-26  7:07 ` [syzbot ci] " syzbot ci
2026-06-26 19:25   ` Jeremy Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260630030535.3309854-1-jbingham@gmail.com \
    --to=jbingham@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jkoolstra@xs4all.nl \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+cie60057db19604ba2@syzkaller.appspotmail.com \
    --cc=syzbot@lists.linux.dev \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=syzkaller@googlegroups.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox