Linux-FSCrypt Archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-security-module@vger.kernel.org, stable@vger.kernel.org,
	syzbot+93e495f6a4f748827c88@syzkaller.appspotmail.com
Subject: Re: [PATCH 1/3] fscrypt: destroy keyring after security_sb_delete()
Date: Tue, 14 Mar 2023 10:28:29 +0100	[thread overview]
Message-ID: <20230314092829.l2sx7vck2amiq74a@wittgenstein> (raw)
In-Reply-To: <20230313221231.272498-2-ebiggers@kernel.org>

On Mon, Mar 13, 2023 at 03:12:29PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> fscrypt_destroy_keyring() must be called after all potentially-encrypted
> inodes were evicted; otherwise it cannot safely destroy the keyring.
> Since inodes that are in-use by the Landlock LSM don't get evicted until
> security_sb_delete(), this means that fscrypt_destroy_keyring() must be
> called *after* security_sb_delete().
> 
> This fixes a WARN_ON followed by a NULL dereference, only possible if
> Landlock was being used on encrypted files.
> 
> Fixes: d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key")
> Cc: stable@vger.kernel.org
> Reported-by: syzbot+93e495f6a4f748827c88@syzkaller.appspotmail.com
> Link: https://lore.kernel.org/r/00000000000044651705f6ca1e30@google.com
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---

Looks good,
Reviewed-by: Christian Brauner <brauner@kernel.org>

  reply	other threads:[~2023-03-14  9:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 22:12 [PATCH 0/3] Fix crash with fscrypt + Landlock Eric Biggers
2023-03-13 22:12 ` [PATCH 1/3] fscrypt: destroy keyring after security_sb_delete() Eric Biggers
2023-03-14  9:28   ` Christian Brauner [this message]
2023-03-13 22:12 ` [PATCH 2/3] fscrypt: improve fscrypt_destroy_keyring() documentation Eric Biggers
2023-03-13 22:12 ` [PATCH 3/3] fscrypt: check for NULL keyring in fscrypt_put_master_key_activeref() 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=20230314092829.l2sx7vck2amiq74a@wittgenstein \
    --to=brauner@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+93e495f6a4f748827c88@syzkaller.appspotmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).