mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Andrey Zakharov <dedemorow@gmail.com>, x86@kernel.org
Cc: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	hpa@zytor.com, Peter Zijlstra <peterz@infradead.org>,
	Kees Cook <kees@kernel.org>, Brian Gerst <brgerst@gmail.com>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/entry/32: Harden return-to-user
Date: Tue, 27 Oct 2026 15:01:35 -0700	[thread overview]
Message-ID: <ac147f25-a2d3-46b9-89c5-44a1c0e4f038@intel.com> (raw)
In-Reply-To: <20261027215251.15275-1-dedemorow@gmail.com>

On 10/27/26 14:52, Andrey Zakharov wrote:
> --- a/arch/x86/entry/entry_32.S
> +++ b/arch/x86/entry/entry_32.S
> @@ -952,6 +952,14 @@ restore_all_switch_stack:
>  
>  	/* Restore user state */
>  	RESTORE_REGS pop=4			# skip orig_eax/error_code
> +
> +	/* Assert that the IRET frame returns to user mode or vm86. */
> +	testb	$USER_SEGMENT_RPL_MASK, 4(%esp)
> +	jnz	.Lreturn_to_user_ok
> +	testl	$X86_EFLAGS_VM, 8(%esp)
> +	jnz	.Lreturn_to_user_ok
> +	ud2
> +.Lreturn_to_user_ok:

I'm curious who cares.

Is anyone who is actually still running a 32-bit kernel concerned about
this kind of hardening?

If no one cares, then I'd rather pass on the complexity, even four
instructions of it.

  reply	other threads:[~2026-10-27 22:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 21:52 Andrey Zakharov
2026-10-27 22:01 ` Dave Hansen [this message]
2026-10-28 19:21   ` s1nkhole
2026-10-28 20:40     ` Borislav Petkov
2026-10-28 20:50     ` Dave Hansen

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=ac147f25-a2d3-46b9-89c5-44a1c0e4f038@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dedemorow@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=tglx@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

all inboxes | Powered by JetHome®