Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2018 19:27:54 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338460 - head/sys/amd64/amd64
Message-ID:  <201809041927.w84JRsWZ077816@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep  4 19:27:53 2018
New Revision: 338460
URL: https://svnweb.freebsd.org/changeset/base/338460

Log:
  amd64: Properly re-merge r334537 into SMAP-ified copyin(9) and copyout(9).
  
  Also this fixes the eflags.ac leak from copyin_smap() when the copied
  data length is multiple of eight bytes.
  
  Sponsored by:	The FreeBSD Foundation
  Approved by:	re (gjb)

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==============================================================================
--- head/sys/amd64/amd64/support.S	Tue Sep  4 19:26:54 2018	(r338459)
+++ head/sys/amd64/amd64/support.S	Tue Sep  4 19:27:53 2018	(r338460)
@@ -312,9 +312,10 @@ ENTRY(copyout_smap)
 	movsq
 	movb	%dl,%cl
 	andb	$7,%cl
+	je	1f
 	rep
 	movsb
-	clac
+1:	clac
 
 done_copyout:
 	xorl	%eax,%eax
@@ -361,6 +362,7 @@ ENTRY(copyin_nosmap)
 	movsq
 	movb	%al,%cl
 	andb	$7,%cl				/* copy remaining bytes */
+	je	done_copyin
 	rep
 	movsb
 
@@ -393,10 +395,10 @@ ENTRY(copyin_smap)
 	movsq
 	movb	%al,%cl
 	andb	$7,%cl				/* copy remaining bytes */
-	je	done_copyin
+	je	1f
 	rep
 	movsb
-	clac
+1:	clac
 
 done_copyin:
 	xorl	%eax,%eax



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