public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+d6ca2daf692c7a82f959@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] Re: kernel BUG in __block_write_begin_int (3)
Date: Thu, 17 Oct 2024 09:02:33 -0700	[thread overview]
Message-ID: <67113519.050a0220.a68d8.000e.GAE@google.com> (raw)
In-Reply-To: <670f8e80.050a0220.d9b66.0163.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: kernel BUG in __block_write_begin_int (3)
Author: dmantipov@yandex.ru

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c964ced7726294d40913f2127c3f185a92cb4a41

diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index fe5b1a30c509..57108bd90e8b 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -483,6 +483,13 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode)
  got_it:
  	from = offset_in_folio(folio, de);
  	to = from + rec_len;
+	if (unlikely(to > folio_size(folio))) {
+		nilfs_error(dir->i_sb, "bad entry in directory #%lu:"
+			    " from=%zu to=%zu size=%zu", dir->i_ino,
+			    from, to, folio_size(folio));
+		err = -EINVAL;
+		goto out_unlock;
+	}
  	err = nilfs_prepare_chunk(folio, from, to);
  	if (err)
  		goto out_unlock;


  reply	other threads:[~2024-10-17 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16  9:59 [syzbot] [nilfs?] kernel BUG in __block_write_begin_int (3) syzbot
2024-10-17 16:02 ` syzbot [this message]
2024-10-17 19:33 ` [PATCH] nilfs2: fix kernel bug due to missing clearing of checked flag Ryusuke Konishi

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=67113519.050a0220.a68d8.000e.GAE@google.com \
    --to=syzbot+d6ca2daf692c7a82f959@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /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