The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linuxfoundation.org>,
	Brian Gerst <brgerst@gmail.com>
Subject: [PATCH 0/3] Reject setting system segments from userspace
Date: Wed, 13 Dec 2023 11:34:40 -0500	[thread overview]
Message-ID: <20231213163443.70490-1-brgerst@gmail.com> (raw)

Michal noted[1] that on systems that support UMIP, the instruction
decoder can be tricked into leaking the address of the TSS or LDT by
using ptrace to set the SS segment to a system segment index.  Prevent
this from happening by rejecting attempts to use a system segment in the
ptrace and sigreturn syscalls.

[1] https://lore.kernel.org/lkml/20231206004654.2986026-1-mhal@rbox.co/

Brian Gerst (3):
  x86: Move TSS and LDT to end of the GDT
  x86/ptrace: Reject system segements
  x86/sigreturn: Reject system segements

 arch/x86/include/asm/segment.h | 44 ++++++++++++++++++++++++----------
 arch/x86/kernel/ptrace.c       | 12 ++--------
 arch/x86/kernel/signal_32.c    |  4 ++++
 arch/x86/kernel/signal_64.c    |  4 ++++
 4 files changed, 42 insertions(+), 22 deletions(-)


base-commit: 3d626e0a7be7ddb635791fee18cb40631bc1d0b3
-- 
2.43.0


             reply	other threads:[~2023-12-13 16:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 16:34 Brian Gerst [this message]
2023-12-13 16:34 ` [PATCH 1/3] x86: Move TSS and LDT to end of the GDT Brian Gerst
2023-12-13 18:51   ` Linus Torvalds
2023-12-13 19:08     ` Linus Torvalds
2023-12-16 18:24       ` Vegard Nossum
2023-12-16 18:40         ` Linus Torvalds
2023-12-17 21:09     ` H. Peter Anvin
2023-12-13 16:34 ` [PATCH 2/3] x86/ptrace: Reject system segements Brian Gerst
2023-12-13 16:34 ` [PATCH 3/3] x86/sigreturn: " Brian Gerst
2023-12-13 18:54   ` Linus Torvalds
2023-12-17 21:07     ` H. Peter Anvin
2023-12-17 21:40       ` Linus Torvalds
2023-12-17 21:45         ` H. Peter Anvin
2023-12-18  8:31           ` Li, Xin3

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=20231213163443.70490-1-brgerst@gmail.com \
    --to=brgerst@gmail.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linuxfoundation.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