All of lore.kernel.org
 help / color / mirror / Atom feed
From: Solar Designer <solar@openwall.com>
To: Mathias Krause <minipli@googlemail.com>
Cc: kernel-hardening@lists.openwall.com, Mike Belopuhov <mikeb@openbsd.org>
Subject: Re: [kernel-hardening] Disable and lock Silicon Debug feature on modern Intel CPUs
Date: Sun, 22 Jan 2017 21:31:58 +0100	[thread overview]
Message-ID: <20170122203158.GB25345@openwall.com> (raw)
In-Reply-To: <CA+rthh-bH-A2Ya1CMfBMZm0fJ4+mnacHn58jaZrURTT9tu0PRA@mail.gmail.com>

On Sun, Jan 22, 2017 at 05:30:11PM +0100, Mathias Krause wrote:
> On 22 January 2017 at 00:41, Solar Designer <solar@openwall.com> wrote:
> > OpenBSD just got this a week ago:
> >
> > https://freshbsd.org/commit/openbsd/f16aad7b540921691f7841ef8ccbb7e7ca22dfd1
> >
> > "Disable and lock Silicon Debug feature on modern Intel CPUs
> >
> > This implements one of the countermeasures against using Direct
> > Connect Interface (DCI) to debug CPUs via USB3 mentioned in the
> > "Tapping into the core" talk at the 33c3: identify and disable
> > the Silicon Debug feature found in Haswell and newer CPUs."
> 
> This patch makes no sense whatsoever as the precondition -- the lock
> bit still being 0 -- cannot be true on any effected system. That's
> because *every* firmware theses days (EFI/UEFI/coreboot/...) installs
> a SMI handler and tries to protect the SMRAM from long know attacks by
> relocating it from its default location to ASEG/TSEG/you-name-it (see,
> e.g., SDM chapter 34.11 SMBASE Relocation). That, however, requires
> generating a SMI as the registers for relocation (SMBASE resp.
> IA32_SMRR_PHYSBASE and IA32_SMRR_PHYSMASK,
> MSR_SMM_FEATURE_CONTROL,...) are only accessible/writable while in
> SMM. So, getting back to the patch, that early "relocation SMI" will,
> as documented, implicitly set the lock bit of the IA32_DEBUG_INTERFACE
> MSR which makes any attempt to disable SDBG later on useless. So, for
> me, this patch is just snake oil.
> 
> The only thing that MSR can be made use of is reporting; to tell the
> user if SBDG was used by testing the "Debug Occurred" bit. That's the
> reason why I just added the CPUID flag in
> http://lists.openwall.net/linux-kernel/2015/07/19/228 and no follow-up
> patch to disable SDBG.

Thanks for explaining this, Mathias.  When I saw your name on the 2015
LKML posting above, I thought there could be a reason behind not doing
anything else about this; I should have worded my posting accordingly.

I am now CC'ing Mike who made the OpenBSD commit, just to make sure he's
aware of this reasoning and so that he can possibly weigh in, if he has
anything to add - e.g., was OpenBSD's change tested on any laptop and
shown to make a difference?  Meanwhile, I withdraw my earlier suggestion
for Linux to do anything else about this issue.

Alexander

  reply	other threads:[~2017-01-22 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-21 23:41 [kernel-hardening] Disable and lock Silicon Debug feature on modern Intel CPUs Solar Designer
2017-01-22 15:10 ` Yves-Alexis Perez
2017-01-22 16:30 ` Mathias Krause
2017-01-22 20:31   ` Solar Designer [this message]
     [not found]     ` <20170122221847.GA97816@yamori.belopuhov.com>
2017-01-23 10:47       ` Mathias Krause

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=20170122203158.GB25345@openwall.com \
    --to=solar@openwall.com \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=mikeb@openbsd.org \
    --cc=minipli@googlemail.com \
    /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.