Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2019 18:05:05 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r343788 - releng/12.0/sys/amd64/amd64
Message-ID:  <201902051805.x15I55P2046776@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Tue Feb  5 18:05:05 2019
New Revision: 343788
URL: https://svnweb.freebsd.org/changeset/base/343788

Log:
  MFS12 r343781: amd64: clear callee-preserved registers on syscall exit
  
  Submitted by:	kib
  Approved by:	so
  Security:	CVE-2019-5595
  Security:	FreeBSD-SA-19:01.syscall

Modified:
  releng/12.0/sys/amd64/amd64/exception.S
Directory Properties:
  releng/12.0/   (props changed)

Modified: releng/12.0/sys/amd64/amd64/exception.S
==============================================================================
--- releng/12.0/sys/amd64/amd64/exception.S	Tue Feb  5 17:59:50 2019	(r343787)
+++ releng/12.0/sys/amd64/amd64/exception.S	Tue Feb  5 18:05:05 2019	(r343788)
@@ -521,12 +521,14 @@ fast_syscall_common:
 	movq	TF_RFLAGS(%rsp),%r11	/* original %rflags */
 	movq	TF_RIP(%rsp),%rcx	/* original %rip */
 	movq	TF_RSP(%rsp),%rsp	/* user stack pointer */
+	xorl	%r8d,%r8d		/* zero the rest of GPRs */
+	xorl	%r10d,%r10d
 	cmpq	$~0,PCPU(UCR3)
 	je	2f
 	movq	PCPU(UCR3),%r9
 	movq	%r9,%cr3
-	xorl	%r9d,%r9d
-2:	swapgs
+2:	xorl	%r9d,%r9d
+	swapgs
 	sysretq
 
 3:	/* AST scheduled. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902051805.x15I55P2046776>