Live Patching
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Miroslav Benes <mbenes@suse.cz>
Cc: joao@overdrivepizza.com, nstange@suse.de, pmladek@suse.cz,
	jpoimboe@redhat.com, joe.lawrence@redhat.com,
	live-patching@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	alexei.starovoitov@gmail.com
Subject: Re: CET/IBT support and live-patches
Date: Tue, 23 Nov 2021 11:48:51 +0100	[thread overview]
Message-ID: <YZzHE+Cze9AX6HCZ@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.LSU.2.21.2111231035460.15177@pobox.suse.cz>

On Tue, Nov 23, 2021 at 10:58:57AM +0100, Miroslav Benes wrote:
> [ adding more CCs ]
> 
> On Mon, 22 Nov 2021, joao@overdrivepizza.com wrote:
> 
> > Hi Miroslav, Petr and Nicolai,
> > 
> > Long time no talk, I hope you are all still doing great :)
> 
> Everything great here :)
> 
> > So, we have been cooking a few patches for enabling Intel CET/IBT support in
> > the kernel. The way IBT works is -- whenever you have an indirect branch, the
> > control-flow must land in an endbr instruction. The idea is to constrain
> > control-flow in a way to make it harder for attackers to achieve meaningful
> > computation through pointer/memory corruption (as in, an attacker that can
> > corrupt a function pointer by exploiting a memory corruption bug won't be able
> > to execute whatever piece of code, being restricted to jump into endbr
> > instructions). To make the allowed control-flow graph more restrict, we are
> > looking into how to minimize the number of endbrs in the final kernel binary
> > -- meaning that if a function is never called indirectly, it shouldn't have an
> > endbr instruction, thus increasing the security guarantees of the hardware
> > feature.
> > 
> > Some ref about what is going on --
> > https://lore.kernel.org/lkml/20211122170805.149482391@infradead.org/T/
> 
> Yes, I noticed something was happening again. There was a thread on this 
> in February https://lore.kernel.org/all/20210207104022.GA32127@zn.tnic/ 
> and some concerns were raised back then around fentry and int3 patching if 
> I remember correctly. Is this still an issue?

The problem was bpf, and probably still is. I've not come around to
looking at it. Asusming fentry is at +0 is silly (although I would like
to see that restored for other reasons), but bpf will also need to emit
ENDBR at least at the start of every JIT'ed program, because entry into
them is through an indirect branch.

If nobody beats me to it, I'll get around to it eventually.

  reply	other threads:[~2021-11-23 10:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <70828ca9f840960c7a3f66cd8dc141f5@overdrivepizza.com>
2021-11-23  9:58 ` CET/IBT support and live-patches Miroslav Benes
2021-11-23 10:48   ` Peter Zijlstra [this message]
2021-11-23 11:39     ` Miroslav Benes
2021-11-23 14:10       ` Peter Zijlstra
2021-11-23 16:03       ` Steven Rostedt
2021-11-23 20:40         ` Peter Zijlstra
2021-11-24 10:02           ` Miroslav Benes
2021-11-23 20:58   ` Joe Lawrence
2021-11-23 21:16     ` Peter Zijlstra
2021-12-01 18:57       ` Joe Lawrence
2021-12-06  6:12         ` Josh Poimboeuf
2021-11-24 10:16     ` Miroslav Benes

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=YZzHE+Cze9AX6HCZ@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=joao@overdrivepizza.com \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=nstange@suse.de \
    --cc=pmladek@suse.cz \
    --cc=rostedt@goodmis.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