From: Eric Biggers <ebiggers@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org,
syzbot+ba9dac45bc76c490b7c3@syzkaller.appspotmail.com,
linux-fscrypt@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] ext4: don't allow journal inode to have encrypt flag
Date: Wed, 7 Dec 2022 19:41:36 -0800 [thread overview]
Message-ID: <Y5Fc8KCMfJ7Yka/x@sol.localdomain> (raw)
In-Reply-To: <167036049593.156498.14603526492088665546.b4-ty@mit.edu>
On Tue, Dec 06, 2022 at 04:01:48PM -0500, Theodore Ts'o wrote:
> On Tue, 1 Nov 2022 22:33:12 -0700, Eric Biggers wrote:
> > From: Eric Biggers <ebiggers@google.com>
> >
> > Mounting a filesystem whose journal inode has the encrypt flag causes a
> > NULL dereference in fscrypt_limit_io_blocks() when the 'inlinecrypt'
> > mount option is used.
> >
> > The problem is that when jbd2_journal_init_inode() calls bmap(), it
> > eventually finds its way into ext4_iomap_begin(), which calls
> > fscrypt_limit_io_blocks(). fscrypt_limit_io_blocks() requires that if
> > the inode is encrypted, then its encryption key must already be set up.
> > That's not the case here, since the journal inode is never "opened" like
> > a normal file would be. Hence the crash.
> >
> > [...]
>
> Applied, thanks!
>
> [1/1] ext4: don't allow journal inode to have encrypt flag
> commit: 29cef51d8522c4d8953856afaffcaf1b754e4f6c
>
> Best regards,
> --
> Theodore Ts'o <tytso@mit.edu>
Thanks Ted. Note that I also sent an e2fsprogs patch to make e2fsck fix this
situation: https://lore.kernel.org/r/20221102220551.3940-1-ebiggers@kernel.org
- Eric
prev parent reply other threads:[~2022-12-08 3:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 5:33 [PATCH] ext4: don't allow journal inode to have encrypt flag Eric Biggers
2022-11-29 0:23 ` Eric Biggers
2022-12-06 21:01 ` Theodore Ts'o
2022-12-08 3:41 ` Eric Biggers [this message]
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=Y5Fc8KCMfJ7Yka/x@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fscrypt@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=syzbot+ba9dac45bc76c490b7c3@syzkaller.appspotmail.com \
--cc=tytso@mit.edu \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).