public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Nam Cao <namcao@linutronix.de>
Cc: "Björn Töpel" <bjorn@kernel.org>,
	linux-fsdevel@vger.kernel.org,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Christian Brauner" <brauner@kernel.org>,
	"Jan Kara" <jack@suse.cz>,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	"Andreas Dilger" <adilger.kernel@dilger.ca>,
	linux-ext4@vger.kernel.org, "Conor Dooley" <conor@kernel.org>
Subject: Re: riscv32 EXT4 splat, 6.8 regression?
Date: Sat, 13 Apr 2024 20:24:11 -0400	[thread overview]
Message-ID: <20240414002411.GG187181@mit.edu> (raw)
In-Reply-To: <20240413164318.7260c5ef@namcao>

On Sat, Apr 13, 2024 at 04:43:18PM +0200, Nam Cao wrote:
> 
> I have zero knowledge about file system, but I think it's an integer
> overflow problem. The calculation of "dlimit" overflow and dlimit wraps
> around, this leads to wrong comparison later on.
> 
> I guess that explains why your bisect and Conor's bisect results are
> strange: the bug has been here for quite some time, but it only appears
> when "dlimit" happens to overflow.

So the problem with that theory is that for that to be the case
buf_size would have to be invalid, and it's unclear how could have
happened.  We can try to test that theory by putting something like
this at the beginning of ext4_search_dir():

	if (buf_size < 0 || buf_size > dir->i_sb->s_blocksize) {
		/* should never happen */
		EXT4_ERROR_INODE(dir, "insane buf_size %d", buf_size);
		WARN_ON(1)
		return -EFSCORRUPTED;
	}

Just to confirm, this file system is not one that has been fuzzed or
is being dynamically modified while mounted, right?  Even if that were
the case, looking at the stack trace, I don't see how this could have
happened.  (I could imagine some scenario involving inline directoreis
and fuzzed or dynamically modified file systems might be a potential
problem=, or at least one that involve much more careful; code review,
since that code is not as battle tested as other parts of ext4; but
the stack trace reported at the beginning of this thread doesn't seem
to indicate that inline directories were involved.)

   	    	 		    - Ted

  reply	other threads:[~2024-04-14  0:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 14:57 riscv32 EXT4 splat, 6.8 regression? Björn Töpel
2024-04-12 15:43 ` Theodore Ts'o
2024-04-12 16:59   ` Björn Töpel
2024-04-13  4:35     ` Theodore Ts'o
2024-04-13 10:01       ` Conor Dooley
2024-04-13 14:43 ` Nam Cao
2024-04-14  0:24   ` Theodore Ts'o [this message]
2024-04-14  1:46   ` Andreas Dilger
2024-04-14  2:04     ` Theodore Ts'o
2024-04-14  2:18       ` Al Viro
2024-04-14  2:15     ` Al Viro
2024-04-14  4:16       ` Andreas Dilger
2024-04-14 14:08         ` Björn Töpel
2024-04-15 13:04           ` Christian Brauner
2024-04-15 16:04             ` Björn Töpel
2024-04-16  6:44               ` Nam Cao
2024-04-16  8:25                 ` Christian Brauner
2024-04-16 11:02                   ` Björn Töpel
2024-04-16 14:24                     ` Mike Rapoport
2024-04-16 15:17                       ` Nam Cao
2024-04-16 15:30                         ` Nam Cao
2024-04-16 15:56                           ` Björn Töpel
2024-04-16 16:19                             ` Nam Cao
2024-04-16 16:31                               ` Mike Rapoport
2024-04-16 17:00                                 ` Matthew Wilcox
2024-04-16 18:34                                   ` Mike Rapoport
2024-04-16 22:36                                     ` Nam Cao
2024-04-17 15:31                                       ` Theodore Ts'o
2024-04-17 18:06                                         ` Nam Cao
2024-04-17 19:34                                       ` Mike Rapoport
2024-04-17 22:09                                       ` Andreas Dilger
2024-04-18  9:17                                         ` Nam Cao
2024-04-16 18:05                               ` Björn Töpel
2024-04-16 18:09                                 ` Nam Cao
2024-04-16 16:19                         ` Mike Rapoport
2024-04-16 16:31                           ` Matthew Wilcox
2024-04-16 18:18                             ` Mike Rapoport

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=20240414002411.GG187181@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=bjorn@kernel.org \
    --cc=brauner@kernel.org \
    --cc=conor@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=namcao@linutronix.de \
    --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