Linux-f2fs-devel Archive on lore.kernel.org
 help / color / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: linux-fscrypt@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org,
	Satya Tangirala <satyat@google.com>,
	linux-ext4@vger.kernel.org, Daniel Rosenberg <drosen@google.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 0/5] fscrypt, fs-verity: one-time init fixes
Date: Tue, 21 Jul 2020 15:59:15 -0700
Message-ID: <20200721225920.114347-1-ebiggers@kernel.org> (raw)

This series fixes up some cases in fs/crypto/ and fs/verity/ where
"one-time init" is implemented using READ_ONCE() instead of
smp_load_acquire() but it's not obviously correct.

One case is fixed by using a better approach that removes the need to
initialize anything.  The others are fixed by upgrading READ_ONCE() to
smp_load_acquire().  I've also improved the comments.

This is motivated by the discussions at 
https://lkml.kernel.org/linux-fsdevel/20200713033330.205104-1-ebiggers@kernel.org/T/#u
and
https://lkml.kernel.org/linux-fsdevel/20200717044427.68747-1-ebiggers@kernel.org/T/#u

These fixes are improvements over the status quo, so I'd prefer to apply
them now, without waiting for any potential new generic one-time-init
macros (which based on the latest discussion, won't be flexible enough
to handle most of these cases anyway).

Eric Biggers (5):
  fscrypt: switch fscrypt_do_sha256() to use the SHA-256 library
  fscrypt: use smp_load_acquire() for fscrypt_prepared_key
  fscrypt: use smp_load_acquire() for ->s_master_keys
  fscrypt: use smp_load_acquire() for ->i_crypt_info
  fs-verity: use smp_load_acquire() for ->i_verity_info

 fs/crypto/Kconfig           |  2 +-
 fs/crypto/fname.c           | 41 +++++++++----------------------------
 fs/crypto/fscrypt_private.h | 15 ++++++++------
 fs/crypto/inline_crypt.c    |  6 ++++--
 fs/crypto/keyring.c         | 15 +++++++++++---
 fs/crypto/keysetup.c        | 18 +++++++++++++---
 fs/crypto/policy.c          |  4 ++--
 fs/verity/open.c            | 15 +++++++++++---
 include/linux/fscrypt.h     | 29 +++++++++++++++++++++-----
 include/linux/fsverity.h    |  9 ++++++--
 10 files changed, 96 insertions(+), 58 deletions(-)

-- 
2.27.0



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 22:59 Eric Biggers [this message]
2020-07-21 22:59 ` [f2fs-dev] [PATCH 1/5] fscrypt: switch fscrypt_do_sha256() to use the SHA-256 library Eric Biggers
2020-07-21 22:59 ` [f2fs-dev] [PATCH 2/5] fscrypt: use smp_load_acquire() for fscrypt_prepared_key Eric Biggers
2020-07-21 22:59 ` [f2fs-dev] [PATCH 3/5] fscrypt: use smp_load_acquire() for ->s_master_keys Eric Biggers
2020-07-21 22:59 ` [f2fs-dev] [PATCH 4/5] fscrypt: use smp_load_acquire() for ->i_crypt_info Eric Biggers
2020-07-21 22:59 ` [f2fs-dev] [PATCH 5/5] fs-verity: use smp_load_acquire() for ->i_verity_info Eric Biggers
2020-07-27 16:38 ` [f2fs-dev] [PATCH 0/5] fscrypt, fs-verity: one-time init fixes 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=20200721225920.114347-1-ebiggers@kernel.org \
    --to=ebiggers@kernel.org \
    --cc=drosen@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=satyat@google.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

Linux-f2fs-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-f2fs-devel/0 linux-f2fs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-f2fs-devel linux-f2fs-devel/ https://lore.kernel.org/linux-f2fs-devel \
		linux-f2fs-devel@lists.sourceforge.net
	public-inbox-index linux-f2fs-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/net.sourceforge.lists.linux-f2fs-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git