All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: speck@linutronix.de
Subject: [MODERATED] Re: [PATCH v6 10/43] MDSv6
Date: Mon, 25 Feb 2019 17:11:41 +0100	[thread overview]
Message-ID: <20190225161141.GA22318@kroah.com> (raw)
In-Reply-To: <fd985a6564dd500cf316665c5de823cb13843a1d.1551019522.git.ak@linux.intel.com>

On Sun, Feb 24, 2019 at 07:07:16AM -0800, speck for Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> Subject:  mds: Add documentation for clear cpu usage
> 
> Including the theory, and some guide lines for subsystem/driver
> maintainers.

Ah, I finally found this patch in the pile...

> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  Documentation/clearcpu.txt | 261 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 261 insertions(+)
>  create mode 100644 Documentation/clearcpu.txt
> 
> diff --git a/Documentation/clearcpu.txt b/Documentation/clearcpu.txt
> new file mode 100644
> index 000000000000..a45e5d82868a
> --- /dev/null
> +++ b/Documentation/clearcpu.txt
> @@ -0,0 +1,261 @@
> +
> +Security model for Microarchitectural Data Sampling
> +===================================================
> +
> +Some CPUs can leave read or written data in internal buffers,
> +which then later might be sampled through side effects.
> +For more details see CVE-2018-12126 CVE-2018-12130 CVE-2018-12127
> +
> +This can be avoided by explicitly clearing the CPU state.
> +
> +We attempt to avoid leaking data between different processes,
> +and also some sensitive data, like cryptographic data, to
> +user space.
> +
> +We support three modes:
> +
> +(1) mitigation off (mds=off)
> +(2) clear only when needed (default)
> +(3) clear on every kernel exit, or guest entry (mds=full)
> +
> +(1) and (3) are trivial, the rest of the document discusses (2)
> +
> +In general option (3) is the most conservative choice. It does
> +not make ST assumptions about leaking data.
> +
> +Basic requirements and assumptions
> +----------------------------------
> +
> +Kernel addresses and kernel temporary data are not sensitive.
> +
> +User data is sensitive, but only for other processes.
> +
> +User data is anything in the user address space, or data buffers
> +directly copied from/to the user (e.g. read/write). It does not
> +include metadata, or flag settings. For example packet headers
> +or file names are not sensitive in this model.
> +
> +Block IO data (but not meta data) is sensitive.
> +
> +Most data structures in the kernel are not sensitive.
> +
> +Kernel data is sensitive when it involves cryptographic keys.
> +
> +We consider data from input devices (such as key presses)
> +sensitive. We also consider sound data or terminal
> +data sensitive.

What do you mean by "terminal data"?

And by including stuff like "input devices", I think you need a much
better definition of what you are now calling "user data".

You have two types of data now, "sensitive" and "not sensitive".  Don't
confuse things by trying to say "user", as the data coming from
"outside" of the system (i.e. random events) might somehow be classified
as "sensitive" in your world view here (i.e. usb random number
generators).

> +We assume that only data actually accessed by the kernel by explicit
> +instructions can be leaked.

What do you mean by "explicit"?  A memcpy?  Setting up a DMA channel and
processing the data afterward in userspace?  Gazing wistfully as it
flows through the unipro fabric to and from a camera?

> Note that this may not be always
> +true, in theory prefetching or speculation may touch more. The assumption
> +is that if any such happens it will be very low bandwidth and hard
> +to control due to the existing Spectre and other mitigations,
> +such as memory randomization.  If a user is concerned about this they
> +need to use mds=full.

Let me shorten this paragraph for you:
	We really have no idea what data might be touched by the
	processor or read by anyone else.  If you happen to care if some
	other process on the physical system can read your data, use
	mds=full.

Is that a better summary?

thanks,

greg k-h

  reply	other threads:[~2019-02-25 16:11 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-24 15:07 [MODERATED] [PATCH v6 00/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 01/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 02/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 03/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 04/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 05/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 06/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 07/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 08/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 09/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 10/43] MDSv6 Andi Kleen
2019-02-25 16:11   ` Greg KH [this message]
2019-02-25 16:42     ` [MODERATED] " Andi Kleen
2019-02-25 16:30   ` Greg KH
2019-02-25 16:41     ` [MODERATED] Encrypted Message Jon Masters
2019-02-25 16:58     ` [MODERATED] Re: [PATCH v6 10/43] MDSv6 Andi Kleen
2019-02-25 17:18   ` Dave Hansen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 11/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 12/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 13/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 14/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 15/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 16/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 17/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 18/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 19/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 20/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 21/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 22/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 23/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 24/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 25/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 26/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 27/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 28/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 29/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 30/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 31/43] MDSv6 Andi Kleen
2019-02-25 15:19   ` [MODERATED] " Greg KH
2019-02-25 15:34     ` Andi Kleen
2019-02-25 15:49       ` Greg KH
2019-02-25 15:52         ` [MODERATED] Encrypted Message Jon Masters
2019-02-25 16:00           ` [MODERATED] " Greg KH
2019-02-25 16:19             ` [MODERATED] " Jon Masters
2019-02-25 16:19         ` [MODERATED] Re: [PATCH v6 31/43] MDSv6 Andi Kleen
2019-02-25 16:24         ` mark gross
2019-02-25 16:24         ` Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 32/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 33/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 34/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 35/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [FROZEN] [PATCH v6 36/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 37/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 38/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 39/43] MDSv6 Andi Kleen
2019-02-25 15:26   ` [MODERATED] " Greg KH
2019-02-25 16:28     ` Andi Kleen
2019-02-25 16:47       ` Greg KH
2019-02-25 17:05         ` Andi Kleen
2019-02-25 17:49           ` Greg KH
2019-02-25 18:10             ` Andi Kleen
2019-02-25 20:11               ` Greg KH
2019-02-25 21:00                 ` Greg KH
2019-02-25 21:19                 ` Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 40/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 41/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 42/43] MDSv6 Andi Kleen
2019-02-24 15:07 ` [MODERATED] [PATCH v6 43/43] MDSv6 Andi Kleen

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=20190225161141.GA22318@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=speck@linutronix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.