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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to