linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Christian Brauner <brauner@kernel.org>
Cc: ecryptfs@vger.kernel.org, linux-crypto@vger.kernel.org,
	Tyler Hicks <code@tyhicks.com>,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] ecryptfs: Use MD5 library instead of crypto_shash
Date: Tue, 21 Oct 2025 08:09:01 -0700	[thread overview]
Message-ID: <20251021150901.GA1644@quark> (raw)
In-Reply-To: <20251021-uferpromenade-fachpersonal-70469a562891@brauner>

On Tue, Oct 21, 2025 at 02:27:47PM +0200, Christian Brauner wrote:
> On Sat, Oct 11, 2025 at 01:00:10PM -0700, Eric Biggers wrote:
> > eCryptfs uses MD5 for a couple unusual purposes: to "mix" the key into
> > the IVs for file contents encryption (similar to ESSIV), and to prepend
> > some key-dependent bytes to the plaintext when encrypting filenames
> > (which is useless since eCryptfs encrypts the filenames with ECB).
> > 
> > Currently, eCryptfs computes these MD5 hashes using the crypto_shash
> > API.  Update it to instead use the MD5 library API.  This is simpler and
> > faster: the library doesn't require memory allocations, can't fail, and
> > provides direct access to MD5 without overhead such as indirect calls.
> > 
> > To preserve the existing behavior of eCryptfs support being disabled
> > when the kernel is booted with "fips=1", make ecryptfs_get_tree() check
> > fips_enabled itself.  Previously it relied on crypto_alloc_shash("md5")
> > failing.  I don't know for sure that this is actually needed; e.g., it
> > could be argued that eCryptfs's use of MD5 isn't for a security purpose
> > as far as FIPS is concerned.  But this preserves the existing behavior.
> > 
> > Tested by verifying that an existing eCryptfs can still be mounted with
> > a kernel that has this commit, with all the files matching.  Also tested
> > creating a filesystem with this commit and mounting+reading it without.
> > 
> > Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> > ---
> > 
> > I can take this through the libcrypto tree if no one else volunteers.
> > (It looks like eCryptfs doesn't have an active git tree anymore.)
> 
> Thanks, but not need, fixes for orphaned fses (that have valid acks) are
> taken through a VFS tree.

Sounds good, thanks!

- Eric

  reply	other threads:[~2025-10-21 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-11 20:00 [PATCH] ecryptfs: Use MD5 library instead of crypto_shash Eric Biggers
2025-10-14  7:57 ` Ard Biesheuvel
2025-10-21 12:26 ` Christian Brauner
2025-10-21 12:27 ` Christian Brauner
2025-10-21 15:09   ` Eric Biggers [this message]
2025-10-21 12:59 ` Christian Brauner

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=20251021150901.GA1644@quark \
    --to=ebiggers@kernel.org \
    --cc=brauner@kernel.org \
    --cc=code@tyhicks.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-fsdevel@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).