public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Manwaring, Derek" <derekmn@amazon.com>
To: <david.kaplan@amd.com>, <jackmanb@google.com>
Cc: <bp@alien8.de>, <dave.hansen@linux.intel.com>, <hpa@zytor.com>,
	<jpoimboe@kernel.org>, <linux-kernel@vger.kernel.org>,
	<mingo@redhat.com>, <pawan.kumar.gupta@linux.intel.com>,
	<peterz@infradead.org>, <tglx@linutronix.de>, <x86@kernel.org>,
	<mlipp@amazon.at>, <canellac@amazon.at>
Subject: RE: [PATCH v2 19/35] Documentation/x86: Document the new attack vector controls
Date: Tue, 12 Nov 2024 20:58:29 -0700	[thread overview]
Message-ID: <f3ddabdc-39fa-45fa-97fd-d8508c2229c9@amazon.com> (raw)
In-Reply-To: <LV3PR12MB92658EA6CCF18F90DAAA168394532@LV3PR12MB9265.namprd12.prod.outlook.com>

+Brendan

On 2024-11-06 at 14:49+0000, David Kaplan wrote:
> On 2024-11-06 at 10:39+0000, Borislav Petkov wrote:
> > One of the arguments against those getting merged is, those are not going to be
> > *vector* controls anymore but something else:
> >
> > mitigate_user - that will mitigate everything that has to do with executing user
> > processes
> >
> > mitigate_guest - same but when running guests
> >
> > The third one will be the SMT off: mitigate_cross_thread.
>
> Right, so the way I think of this is that there is a cognitive process
> that administrators must go through:
>
> 1. Determine how the system will be used (e.g., am I running untrusted
>    VMs?)
> 2. Determine the attack vectors relevant for that configuration (e.g., I
>    need guest->host and guest->guest protection)
> 3. Determine which mitigations are required to enable the desired level
>    of security (e.g., enable vulnerability X mitigation but not Y)
>
> Today, the administrator must do all 3 of these, which requires in-depth
> knowledge of all these bugs, and isn't forward compatible.  The proposed
> patch series has the kernel take care of step 3, but still requires the
> administrator to do steps 1 and 2.  The provided documentation helps
> with step 2, but ultimately the admin must decide which attack vectors
> they want to turn on/off.  But the attack vectors are also forward
> compatible in case new bugs show up in the future.
>
> What you've proposed is up-leveling things a bit further and trying to
> have the kernel do both steps 2 and 3 in the above flow.  That is, the
> admin decides for example they have untrusted userspace, and the kernel
> then determines they need user->kernel and user->user protection, and
> then which bug fixes to enable.
>
> I'm not necessarily opposed to that, and welcome feedback on this.  But
> as you said, that is not an attack-vector control anymore, it is more of
> an end-use control.  It is possible to do both...we could also create
> end-use options like the ones you mention, and just map those in a
> pretty trivial way to the attack vector controls.

I think the further simplification makes sense (merge to mitigate_user
or mitigate_guest). I would say definitely don't do both (ending up with
end-use, vector controls, *and* existing parameters). Both just seems
like more confusion rather than simplification overall.

For me the major dissonance in all of this remains cross_thread. Based
on either approach (end-use or vector), SMT should be disabled unless
the admin explicitly asks to keep it (presumably because they are
running with core scheduling correctly configured).

What if mitigate_user_user defaulted to 'defaults' instead of 'on'? I'm
thinking 'defaults' meaning "do the things the kernel normally did
before thinking in these attack-vector terms." That way we could
differentiate between "admin didn't specify anything" and "admin said
they cared about mitigating this vector (or case)." That should make it
reasonable to disable SMT when mitigate_user_user=on is supplied, yeah?

> I'm nervous about only doing the end-use controls and not the attack
> vector controls because of the reasons outlined above.  For example, I'm
> thinking about some proposed technologies such as KVM Address Space
> Isolation which may go a long way to reducing the risk of guest->host
> attacks but may not be fully secure yet (where the kernel would feel
> comfortable disabling a bunch of guest->host protections automatically).
> With attack vector-level controls, it would be easier to turn off
> guest->host protection if the admin is comfortable with this technology,
> but still leaving the (almost certainly needed) guest->guest protections
> in place.

Personally I wouldn't put too much weight on the possibility of
disabling kernel mitigations with these future approaches. For what
we're looking at with direct map removal, I would still keep kernel
mitigations on unless we really needed one off. Brendan, I know you were
looking at this differently though for ASI. What are your thoughts?

Derek

  reply	other threads:[~2024-11-13  3:58 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 21:54 [PATCH v2 00/35] x86/bugs: Attack vector controls David Kaplan
2024-11-05 21:54 ` [PATCH v2 01/35] x86/bugs: Add X86_BUG_SPECTRE_V2_USER David Kaplan
2024-11-05 21:54 ` [PATCH v2 02/35] x86/bugs: Relocate mds/taa/mmio/rfds defines David Kaplan
2024-11-05 21:54 ` [PATCH v2 03/35] x86/bugs: Add AUTO mitigations for mds/taa/mmio/rfds David Kaplan
2024-11-14  2:26   ` Pawan Gupta
2024-11-14 14:59     ` Kaplan, David
2024-11-14 17:14       ` Pawan Gupta
2024-11-14 17:17         ` Kaplan, David
2024-11-05 21:54 ` [PATCH v2 04/35] x86/bugs: Restructure mds mitigation David Kaplan
2024-11-14  3:03   ` Pawan Gupta
2024-11-14 15:01     ` Kaplan, David
2024-12-10 15:24       ` Borislav Petkov
2024-11-05 21:54 ` [PATCH v2 05/35] x86/bugs: Restructure taa mitigation David Kaplan
2024-11-14  4:43   ` Pawan Gupta
2024-11-14 15:08     ` Kaplan, David
2024-11-05 21:54 ` [PATCH v2 06/35] x86/bugs: Restructure mmio mitigation David Kaplan
2024-11-14  5:03   ` Pawan Gupta
2024-11-05 21:54 ` [PATCH v2 07/35] x86/bugs: Restructure rfds mitigation David Kaplan
2024-11-14  5:55   ` Pawan Gupta
2024-11-05 21:54 ` [PATCH v2 08/35] x86/bugs: Remove md_clear_*_mitigation() David Kaplan
2024-11-05 21:54 ` [PATCH v2 09/35] x86/bugs: Restructure srbds mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 10/35] x86/bugs: Restructure gds mitigation David Kaplan
2024-11-14  6:21   ` Pawan Gupta
2024-11-05 21:54 ` [PATCH v2 11/35] x86/bugs: Restructure spectre_v1 mitigation David Kaplan
2024-11-14  6:57   ` Pawan Gupta
2024-11-14 15:36     ` Kaplan, David
2024-11-14 15:49       ` Kaplan, David
2024-11-14 16:19         ` Borislav Petkov
2024-11-14 16:45           ` Kaplan, David
2024-11-14 23:33             ` Josh Poimboeuf
2024-12-12 10:41               ` Borislav Petkov
2024-11-14 17:41       ` Pawan Gupta
2024-11-14 17:48         ` Kaplan, David
2024-11-05 21:54 ` [PATCH v2 12/35] x86/bugs: Restructure retbleed mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 13/35] x86/bugs: Restructure spectre_v2_user mitigation David Kaplan
2024-11-06 18:56   ` kernel test robot
2024-11-05 21:54 ` [PATCH v2 14/35] x86/bugs: Restructure bhi mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 15/35] x86/bugs: Restructure spectre_v2 mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 16/35] x86/bugs: Restructure ssb mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 17/35] x86/bugs: Restructure l1tf mitigation David Kaplan
2024-11-05 21:54 ` [PATCH v2 18/35] x86/bugs: Restructure srso mitigation David Kaplan
2025-01-02 14:55   ` Borislav Petkov
2024-11-05 21:54 ` [PATCH v2 19/35] Documentation/x86: Document the new attack vector controls David Kaplan
2024-11-06 10:39   ` Borislav Petkov
2024-11-06 14:49     ` Kaplan, David
2024-11-13  3:58       ` Manwaring, Derek [this message]
2024-11-13 14:15         ` Brendan Jackman
2024-11-13 15:05           ` Kaplan, David
2024-11-13 15:31             ` Brendan Jackman
2024-11-13 16:00               ` Kaplan, David
2024-11-13 16:19                 ` Brendan Jackman
2024-11-14  9:32                   ` Brendan Jackman
2024-11-22 16:15                     ` Manwaring, Derek
2024-11-22 16:36                       ` Brendan Jackman
2024-11-22 17:23                         ` Kaplan, David
2024-11-20  0:14           ` Manwaring, Derek
2024-11-13 14:49         ` Kaplan, David
2024-11-13 14:15   ` Brendan Jackman
2024-11-13 15:42     ` Kaplan, David
2024-11-05 21:54 ` [PATCH v2 20/35] x86/bugs: Define attack vectors David Kaplan
2025-01-03 15:19   ` Borislav Petkov
2025-01-03 15:29     ` Kaplan, David
2025-01-03 15:51       ` Borislav Petkov
2024-11-05 21:54 ` [PATCH v2 21/35] x86/bugs: Determine relevant vulnerabilities based on attack vector controls David Kaplan
2024-11-05 21:54 ` [PATCH v2 22/35] x86/bugs: Add attack vector controls for mds David Kaplan
2024-11-05 21:54 ` [PATCH v2 23/35] x86/bugs: Add attack vector controls for taa David Kaplan
2024-11-05 21:54 ` [PATCH v2 24/35] x86/bugs: Add attack vector controls for mmio David Kaplan
2024-11-05 21:54 ` [PATCH v2 25/35] x86/bugs: Add attack vector controls for rfds David Kaplan
2024-11-05 21:54 ` [PATCH v2 26/35] x86/bugs: Add attack vector controls for srbds David Kaplan
2024-11-05 21:54 ` [PATCH v2 27/35] x86/bugs: Add attack vector controls for gds David Kaplan
2024-11-05 21:54 ` [PATCH v2 28/35] x86/bugs: Add attack vector controls for spectre_v1 David Kaplan
2024-11-05 21:54 ` [PATCH v2 29/35] x86/bugs: Add attack vector controls for retbleed David Kaplan
2024-11-05 21:54 ` [PATCH v2 30/35] x86/bugs: Add attack vector controls for spectre_v2_user David Kaplan
2024-11-05 21:54 ` [PATCH v2 31/35] x86/bugs: Add attack vector controls for bhi David Kaplan
2024-11-05 21:54 ` [PATCH v2 32/35] x86/bugs: Add attack vector controls for spectre_v2 David Kaplan
2024-11-05 21:54 ` [PATCH v2 33/35] x86/bugs: Add attack vector controls for l1tf David Kaplan
2024-11-05 21:54 ` [PATCH v2 34/35] x86/bugs: Add attack vector controls for srso David Kaplan
2024-11-05 21:54 ` [PATCH v2 35/35] x86/pti: Add attack vector controls for pti David Kaplan

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=f3ddabdc-39fa-45fa-97fd-d8508c2229c9@amazon.com \
    --to=derekmn@amazon.com \
    --cc=bp@alien8.de \
    --cc=canellac@amazon.at \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.kaplan@amd.com \
    --cc=hpa@zytor.com \
    --cc=jackmanb@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mlipp@amazon.at \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --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