public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ard Biesheuvel <ardb@kernel.org>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-mips@vger.kernel.org,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH] lib/crypto: mips: Drop optimized MD5 code
Date: Sat, 18 Apr 2026 18:43:46 -0700	[thread overview]
Message-ID: <20260419014346.GC18115@quark> (raw)
In-Reply-To: <20260419010835.GB18115@quark>

On Sat, Apr 18, 2026 at 06:08:36PM -0700, Eric Biggers wrote:
> On Sun, Apr 19, 2026 at 03:36:31AM +0300, Aaro Koskinen wrote:
> > Hi,
> > 
> > On Thu, Mar 26, 2026 at 01:48:24PM -0700, Eric Biggers wrote:
> > > MD5 is obsolete.  Continuing to maintain architecture-optimized
> > > implementations of MD5 is unnecessary and risky.  It diverts resources
> > > from the modern algorithms that are actually important.
> > > 
> > > While there was demand for continuing to maintain the PowerPC optimized
> > > MD5 code to accommodate userspace programs that are misusing AF_ALG
> > > (https://lore.kernel.org/linux-crypto/c4191597-341d-4fd7-bc3d-13daf7666c41@csgroup.eu/),
> > > no such demand has been seen for the MIPS Cavium Octeon optimized MD5
> > > code.  Note that this code runs on only one particular line of SoCs.
> > > 
> > > Thus, let's drop it and focus effort on the more modern SHA algorithms,
> > > which already have optimized code for the same SoCs.
> > 
> > I don't mind deleting this (I shut down all my MIPS hardware already
> > in new year 2020 to start a "fresh" decade), but just for the record,
> > this will probably downgrade the performance of TCP_MD5SIG which I recall
> > was the original reason this code got added...
> 
> Sure, for any removal of optimized code it's always possible to
> hypothesize a case where it regresses performance.  The question is
> whether it actually matters and is worth keeping around.  You mentioned
> that you did care about this code, but no longer do.  I think anyone who
> may have cared about this in the past is likely to have had a similar
> experience.
> 
> After all, the only line of SoCs that could run this code switched from
> MIPS to ARM in 2016.  Meanwhile, TCP-MD5 itself is insecure and has been
> superseded by TCP-AO.  (Note that TCP-AO supports HMAC-SHA1 and
> HMAC-SHA256, which are still accelerated on MIPS Cavium Octeon.)
> 
> Yes, there are still people using TCP-MD5 anyway (on some platforms, not
> necessarily this particular one).  But a nudge towards upgrading to
> TCP-AO isn't necessarily a bad thing, either...

I should also emphasize, again, that we don't actually know whether this
code even still worked.  It underwent quite a bit refactoring in the
last year or so to keep it theoretically working as the crypto subsystem
evolved.  Yet it has never been testable in QEMU, and there were never
any reports of anyone re-testing it on the hardware.

If there were someone who had said, "Yes, I need this legacy code, it
passes the MD5 KUnit test, and I'll be re-testing it regularly", that
would have been more encouraging.  But otherwise we may have been just
been keeping broken code around, which is much worse than simply using
the well-tested generic code.

- Eric

      reply	other threads:[~2026-04-19  1:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 20:48 [PATCH] lib/crypto: mips: Drop optimized MD5 code Eric Biggers
2026-03-27 16:16 ` Ard Biesheuvel
2026-03-30 19:36 ` Eric Biggers
2026-04-19  0:36 ` Aaro Koskinen
2026-04-19  1:08   ` Eric Biggers
2026-04-19  1:43     ` 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=20260419014346.GC18115@quark \
    --to=ebiggers@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=ardb@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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