Module Name:    src
Committed By:   martin
Date:           Sun May  5 08:49:19 UTC 2019

Modified Files:
        src/sys/arch/amd64/amd64 [netbsd-7-0]: copy.S
        src/sys/arch/i386/i386 [netbsd-7-0]: copy.S

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1693):

        sys/arch/amd64/amd64/copy.S: revision 1.33
        sys/arch/i386/i386/copy.S: revision 1.31

Hum. Fix a potentially catastrophic bug: kcopy() sets DF=1 if the areas
overlap, but doesn't clear it if the copy faults. If this happens, we
return to the caller with DF=1, and each future memory copy will be
backwards.

I wonder if there really are places where kcopy() is called with
overlapping areas.


To generate a diff of this commit:
cvs rdiff -u -r1.18.38.1 -r1.18.38.2 src/sys/arch/amd64/amd64/copy.S
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/arch/i386/i386/copy.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/copy.S
diff -u src/sys/arch/amd64/amd64/copy.S:1.18.38.1 src/sys/arch/amd64/amd64/copy.S:1.18.38.2
--- src/sys/arch/amd64/amd64/copy.S:1.18.38.1	Sat Dec 24 04:07:00 2016
+++ src/sys/arch/amd64/amd64/copy.S	Sun May  5 08:49:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.18.38.1 2016/12/24 04:07:00 snj Exp $	*/
+/*	$NetBSD: copy.S,v 1.18.38.2 2019/05/05 08:49:18 martin Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -233,6 +233,7 @@ NENTRY(copy_efault)
  */
 
 NENTRY(kcopy_fault)
+	cld
 	ret
 
 NENTRY(copy_fault)

Index: src/sys/arch/i386/i386/copy.S
diff -u src/sys/arch/i386/i386/copy.S:1.23 src/sys/arch/i386/i386/copy.S:1.23.8.1
--- src/sys/arch/i386/i386/copy.S:1.23	Fri Jan 10 16:47:07 2014
+++ src/sys/arch/i386/i386/copy.S	Sun May  5 08:49:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: copy.S,v 1.23 2014/01/10 16:47:07 pedro Exp $	*/
+/*	$NetBSD: copy.S,v 1.23.8.1 2019/05/05 08:49:18 martin Exp $	*/
 /*	NetBSD: locore.S,v 1.34 2005/04/01 11:59:31 yamt Exp $	*/
 
 /*-
@@ -65,7 +65,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.23 2014/01/10 16:47:07 pedro Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.23.8.1 2019/05/05 08:49:18 martin Exp $");
 
 #include "assym.h"
 
@@ -308,6 +308,7 @@ NENTRY(copy_efault)
  */
 /* LINTSTUB: Ignore */
 NENTRY(kcopy_fault)
+	cld
 	popl	%edi
 	popl	%esi
 	ret

Reply via email to