public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: x86@kernel.org, brgerst@gmail.com, jiangshanlai@gmail.com,
	Andrew.Cooper3@citrix.com, linux-kernel@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH 2/2] x86,entry: Use PUSH_AND_CLEAR_REGS for compat
Date: Wed, 20 Apr 2022 09:07:30 +0200	[thread overview]
Message-ID: <20220420070730.GB2731@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220420032123.6c344rjr4poockjr@treble>

On Tue, Apr 19, 2022 at 08:21:23PM -0700, Josh Poimboeuf wrote:
> On Tue, Apr 19, 2022 at 10:41:11PM +0200, Peter Zijlstra wrote:
> > Since the upper regs don't exist for ia32 code, preserving them
> > doesn't hurt and it simplifies the code.
> 
> But an attacker can still control those registers, so clearing them on
> the stack is better, as it reduces user control over the kernel stack.
> 
> 64-bit syscalls *do* have to save those registers to the stack, so
> whether it truly matters if compat mode is made equally insecure, I
> can't say.  But without evidence to the contrary, my feeling is that we
> should err on the side of caution.

Right, so earlier Brian said simpler might be better, and I figured I'd
try to see if I could make that stick, because I too like simpler ;-)

Also, since int80 already has to do this, attackers already have their
attack surface.

  reply	other threads:[~2022-04-20  7:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 20:41 [PATCH 0/2] x86: A few random cleanups Peter Zijlstra
2022-04-19 20:41 ` [PATCH 1/2] x86: Simplify Retpoline thunk Peter Zijlstra
2022-04-20 15:27   ` Josh Poimboeuf
2022-04-20 15:51     ` Peter Zijlstra
2022-04-20 16:01       ` Josh Poimboeuf
2022-04-19 20:41 ` [PATCH 2/2] x86,entry: Use PUSH_AND_CLEAR_REGS for compat Peter Zijlstra
2022-04-20  3:21   ` Josh Poimboeuf
2022-04-20  7:07     ` Peter Zijlstra [this message]
2022-04-20 14:58       ` Josh Poimboeuf
2022-04-20  4:29   ` Lai Jiangshan
2022-04-20 14:26   ` Andy Lutomirski
2022-04-20 14:51     ` Peter Zijlstra

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=20220420070730.GB2731@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=brgerst@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --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