linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	scott.d.constable@intel.com, daniel.sneddon@linux.intel.com,
	Jakub Kicinski <kuba@kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	Paolo Abeni <pabeni@redhat.com>,
	antonio.gomez.iglesias@linux.intel.com,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, gregkh@linuxfoundation.org,
	netdev@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] Branch Target Injection (BTI) gadget in minstrel
Date: Wed, 26 Oct 2022 09:31:31 +0200	[thread overview]
Message-ID: <Y1jiUzw8QbXUW/+V@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <b4a64b97-32d2-d83d-9146-ebc9a4cc9ff6@intel.com>

On Tue, Oct 25, 2022 at 03:00:35PM -0700, Dave Hansen wrote:
> On 10/25/22 04:07, Peter Zijlstra wrote:
> > I think the focus should be on finding the source sites, not protecting
> > the target sites. Where can an attacker control the register content and
> > have an indirect jump/call.
> 
> How would this work with something like 'struct file_operations' which
> provide a rich set of indirect calls that frequently have fully
> user-controlled values in registers?
> 
> It certainly wouldn't *hurt* to be zeroing out the registers that are
> unused at indirect call sites.  But, the majority of gadgets in this
> case used rdi and rsi, which are the least likely to be able to be
> zapped at call sites.

Right; so FineIBT will limit the targets to the right set of functions,
and those functions must already assume the values are user controlled
and take appropriate measures.

If you really truly care about the old hardware, then one solution would
be to de-virtualize the call using LTO or something (yes, it will need
some compiler work and you might need to annotate the code a bit and
even have a fixed/predetermined set of loadable modules, but meh).

Barring that, you could perhaps put {min,max} range information next to
the function pointer such that you can impose value ranges before doing
the indirect call.

But given this is all theoretical and FineIBT solves a lot of it I can't
find myself to care too much.

      reply	other threads:[~2022-10-26  7:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 22:57 [RFC PATCH 0/2] Branch Target Injection (BTI) gadget in minstrel Pawan Gupta
2022-10-24 22:57 ` [RFC PATCH 1/2] nospec: Add a generic barrier_nospec() Pawan Gupta
2022-10-24 22:57 ` [RFC PATCH 2/2] minstrel_ht: Mitigate BTI gadget minstrel_ht_get_expected_throughput() Pawan Gupta
2022-10-25  7:36   ` Greg KH
2022-10-25 16:55     ` Pawan Gupta
2022-10-25 11:07 ` [RFC PATCH 0/2] Branch Target Injection (BTI) gadget in minstrel Peter Zijlstra
2022-10-25 19:38   ` Pawan Gupta
2022-10-25 19:56     ` Johannes Berg
2022-10-26  0:17       ` Pawan Gupta
2022-10-25 20:31     ` Peter Zijlstra
2022-10-25 22:00   ` Dave Hansen
2022-10-26  7:31     ` Peter Zijlstra [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=Y1jiUzw8QbXUW/+V@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=antonio.gomez.iglesias@linux.intel.com \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=scott.d.constable@intel.com \
    --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;
as well as URLs for NNTP newsgroup(s).