From: "Theodore Ts'o" <tytso@mit.edu>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-fscrypt@vger.kernel.org, Yunlei He <heyunlei@hihonor.com>,
bintian.wang@hihonor.com, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] ext4: fix error handling in ext4_end_enable_verity()
Date: Thu, 11 Mar 2021 10:36:23 -0500 [thread overview]
Message-ID: <YEo4958DZYm/21b+@mit.edu> (raw)
In-Reply-To: <20210302200420.137977-2-ebiggers@kernel.org>
On Tue, Mar 02, 2021 at 12:04:19PM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> ext4 didn't properly clean up if verity failed to be enabled on a file:
>
> - It left verity metadata (pages past EOF) in the page cache, which
> would be exposed to userspace if the file was later extended.
>
> - It didn't truncate the verity metadata at all (either from cache or
> from disk) if an error occurred while setting the verity bit.
>
> Fix these bugs by adding a call to truncate_inode_pages() and ensuring
> that we truncate the verity metadata (both from cache and from disk) in
> all error paths. Also rework the code to cleanly separate the success
> path from the error paths, which makes it much easier to understand.
>
> Reported-by: Yunlei He <heyunlei@hihonor.com>
> Fixes: c93d8f885809 ("ext4: add basic fs-verity support")
> Cc: <stable@vger.kernel.org> # v5.4+
> Signed-off-by: Eric Biggers <ebiggers@google.com>
Thanks, LGTM.
I've applied this to the ext4 with minor adjustment; I eliminated the
double blank line here:
> + ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
> + return 0;
> +
> +
> +stop_and_cleanup:
> + ext4_journal_stop(handle);
...
- Ted
next prev parent reply other threads:[~2021-03-11 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210302200420.137977-1-ebiggers@kernel.org>
2021-03-02 20:04 ` [PATCH 1/2] ext4: fix error handling in ext4_end_enable_verity() Eric Biggers
2021-03-11 15:36 ` Theodore Ts'o [this message]
2021-03-02 20:04 ` [PATCH 2/2] f2fs: fix error handling in f2fs_end_enable_verity() Eric Biggers
2021-03-05 1:37 ` [f2fs-dev] " Chao Yu
2021-03-05 4:52 ` Eric Biggers
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=YEo4958DZYm/21b+@mit.edu \
--to=tytso@mit.edu \
--cc=bintian.wang@hihonor.com \
--cc=ebiggers@kernel.org \
--cc=heyunlei@hihonor.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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 NNTP newsgroup(s).