Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Eric Biggers <ebiggers@kernel.org>, Dave Hansen <dave.hansen@intel.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Demi Marie Obenour <demiobenour@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-crypto@vger.kernel.org,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: Turning on DOITM at last
Date: Mon, 20 Jul 2026 18:01:24 +0100	[thread overview]
Message-ID: <14962fdf-66e9-4b64-a37e-0e697c875cc0@citrix.com> (raw)
In-Reply-To: <20260720162934.GA21086@google.com>

On 20/07/2026 5:29 pm, Eric Biggers wrote:
> [+Cc linux-crypto@vger.kernel.org]
>
> On Mon, Jul 20, 2026 at 04:55:19AM -0700, Dave Hansen wrote:
>> On 7/18/26 10:01, Demi Marie Obenour wrote:
>>> Is it time to go ahead and turn on DOITM?
>> No, I don't think so.
>>
>>> - If it doesn't do anything, it's a harmless no-op.
>> I kinda disagree with this.
>>
>> There are CPUs that enumerate support for DOITM but on which it doesn't
>> do anything. On those CPUs, every cycle spent twiddling it is a waste.
>>
>>> - If it does something, then that something needed to be done to
>>>   protect code that handles secrets, such as crypto code.
>> I really disagree with this.
>>
>> Lots of code "handles secrets".  memcpy() "handles secrets".
>>
>>> - The overhead of switching it on and off is too high, so it's best
>>>   to just leave it on all the time.
>> The overhead *is* too high. It's an MSR bit that requires a user/kernel
>> round trip.
>>
>>> - Even people who don't care about speculative execution
>>>   vulnerabilities, because they only run trusted code on a particular
>>>   server, still likely need secure cryptography.
>> I'm not sure where speculative execution vulnerabilities came in to play
>> here.
>>
>>> Xen already turned it on in the past.
>> While I very much respect the Xen folks and their security posture, Xen
>> is a very different project than Linux.
> The right thing to do for now is to just turn on DOITM at boot time
> (https://lore.kernel.org/r/20230125012801.362496-1-ebiggers@kernel.org/)
> to fix the backwards compatibility break.  With just one write per CPU
> at boot time, the overhead of writing the MSR won't really matter.

This is what Xen does, for the same reasons as you've given.

We don't even virtualise the controls for guests.

> For the insecure mode to be the default, there will need to be an
> efficient way for userspace to enable the traditional secure mode, *and
> then* several years for userspace to be updated.
>
> Unfortunately, since the hardware enabled the insecure mode by default,
> Linux inherited that backwards compatibility break without any explicit
> patch submission, and the burden is being put on people wanting to
> restore the traditional behavior.  It should be the other way around:
> the traditional behavior needs to be the default for now, and then we
> can discuss what needs to happen for it to be safe to enable the new
> insecure mode by default.

+1.

It's not just in Linux, it's all OSes and all userspace doing any form
of sensitive operations.

Insecure by default may have been a deliberate choice on Intel's behalf,
but it really is unacceptable for the wider software ecosystem.

~Andrew

      reply	other threads:[~2026-07-20 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5e739bc7-4252-4f64-90ab-c68fc5cc746c@gmail.com>
     [not found] ` <b2986cfd-6e2c-47c8-8a42-863582ebf1fa@intel.com>
2026-07-20 16:29   ` Turning on DOITM at last Eric Biggers
2026-07-20 17:01     ` Andrew Cooper [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=14962fdf-66e9-4b64-a37e-0e697c875cc0@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=demiobenour@gmail.com \
    --cc=ebiggers@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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