CVS commit: src/sys/net

2022-10-05 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Oct  6 06:59:25 UTC 2022

Modified Files:
src/sys/net: if_ipsec.c

Log Message:
Fix overflow case detected by clang.  Pointed out by wsh@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_ipsec.c

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

Modified files:

Index: src/sys/net/if_ipsec.c
diff -u src/sys/net/if_ipsec.c:1.32 src/sys/net/if_ipsec.c:1.33
--- src/sys/net/if_ipsec.c:1.32	Fri Sep 30 07:36:36 2022
+++ src/sys/net/if_ipsec.c	Thu Oct  6 06:59:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipsec.c,v 1.32 2022/09/30 07:36:36 knakahara Exp $  */
+/*	$NetBSD: if_ipsec.c,v 1.33 2022/10/06 06:59:24 knakahara Exp $  */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.32 2022/09/30 07:36:36 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipsec.c,v 1.33 2022/10/06 06:59:24 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1798,12 +1798,12 @@ if_ipsec_get_reqids(struct ipsec_variant
 
 	mutex_enter(&ipsec_softcs.lock);
 	if (ipsec_softcs.use_fixed_reqid) {
-		u_int16_t reqid_base;
+		uint32_t reqid_base;
 
 		reqid_base = ipsec_softcs.reqid_base + ifp->if_index * 2;
 		if (reqid_base + 1 > ipsec_softcs.reqid_last) {
 			log(LOG_ERR,
-			"%s: invalid fixed reqid(%"PRIu16"), "
+			"%s: invalid fixed reqid(%"PRIu32"), "
 			"current range %"PRIu16" <= reqid <= %"PRIu16"\n",
 			ifp->if_xname, reqid_base + 1,
 			ipsec_softcs.reqid_base, ipsec_softcs.reqid_last);



CVS commit: src/sys/net

2022-10-05 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Oct  6 06:59:25 UTC 2022

Modified Files:
src/sys/net: if_ipsec.c

Log Message:
Fix overflow case detected by clang.  Pointed out by wsh@IIJ, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/net/if_ipsec.c

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



CVS commit: src/sys/arch/x86/include

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 06:51:37 UTC 2022

Modified Files:
src/sys/arch/x86/include: i82093reg.h

Log Message:
IOAPIC_ID_MASK is 8 bits these days. Fixes PR kern/54276.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/i82093reg.h

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



CVS commit: src/sys/arch/x86/include

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 06:51:37 UTC 2022

Modified Files:
src/sys/arch/x86/include: i82093reg.h

Log Message:
IOAPIC_ID_MASK is 8 bits these days. Fixes PR kern/54276.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/include/i82093reg.h

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/x86/include/i82093reg.h
diff -u src/sys/arch/x86/include/i82093reg.h:1.6 src/sys/arch/x86/include/i82093reg.h:1.7
--- src/sys/arch/x86/include/i82093reg.h:1.6	Wed Jun 19 06:32:46 2019
+++ src/sys/arch/x86/include/i82093reg.h	Thu Oct  6 06:51:36 2022
@@ -1,4 +1,4 @@
-/* 	$NetBSD: i82093reg.h,v 1.6 2019/06/19 06:32:46 msaitoh Exp $ */
+/* 	$NetBSD: i82093reg.h,v 1.7 2022/10/06 06:51:36 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 #define IOAPIC_ID		0x00
 
 #define 	IOAPIC_ID_SHIFT		24
-#define		IOAPIC_ID_MASK		0x0f00
+#define		IOAPIC_ID_MASK		0xff00
 
 /* Version, and maximum interrupt pin number. */
   



CVS commit: src/sys/arch/x86/x86

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 06:42:46 UTC 2022

Modified Files:
src/sys/arch/x86/x86: ioapic.c

Log Message:
Print detail about misconfigured APIC ID.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x86/x86/ioapic.c

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/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.65 src/sys/arch/x86/x86/ioapic.c:1.66
--- src/sys/arch/x86/x86/ioapic.c:1.65	Thu Oct  7 12:52:27 2021
+++ src/sys/arch/x86/x86/ioapic.c	Thu Oct  6 06:42:46 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ioapic.c,v 1.65 2021/10/07 12:52:27 msaitoh Exp $	*/
+/*	$NetBSD: ioapic.c,v 1.66 2022/10/06 06:42:46 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.65 2021/10/07 12:52:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.66 2022/10/06 06:42:46 msaitoh Exp $");
 
 #include "opt_ddb.h"
 
@@ -374,8 +374,9 @@ ioapic_attach(device_t parent, device_t 
 	 * mapping later ...
 	 */
 	if (apic_id != sc->sc_pic.pic_apicid) {
-		aprint_debug_dev(sc->sc_dev, "misconfigured as apic %d\n",
- apic_id);
+		aprint_debug_dev(sc->sc_dev,
+		"apid is misconfigured (%d != %d)\n",
+		apic_id, sc->sc_pic.pic_apicid);
 
 		ioapic_write(sc, IOAPIC_ID,
 		(ioapic_read(sc, IOAPIC_ID) & ~IOAPIC_ID_MASK)
@@ -386,7 +387,8 @@ ioapic_attach(device_t parent, device_t 
 
 		if (apic_id != sc->sc_pic.pic_apicid)
 			aprint_error_dev(sc->sc_dev,
-			"can't remap to apid %d\n", sc->sc_pic.pic_apicid);
+			"can't remap apid from %d to %d\n",
+			apic_id, sc->sc_pic.pic_apicid);
 		else
 			aprint_debug_dev(sc->sc_dev, "remapped to apic %d\n",
 			sc->sc_pic.pic_apicid);



CVS commit: src/sys/arch/x86/x86

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 06:42:46 UTC 2022

Modified Files:
src/sys/arch/x86/x86: ioapic.c

Log Message:
Print detail about misconfigured APIC ID.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x86/x86/ioapic.c

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



CVS commit: src/tests/lib/libc/inet

2022-10-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Oct  6 06:05:31 UTC 2022

Modified Files:
src/tests/lib/libc/inet: t_inet_network.c

Log Message:
add tests for PR/57046.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/inet/t_inet_network.c

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

Modified files:

Index: src/tests/lib/libc/inet/t_inet_network.c
diff -u src/tests/lib/libc/inet/t_inet_network.c:1.4 src/tests/lib/libc/inet/t_inet_network.c:1.5
--- src/tests/lib/libc/inet/t_inet_network.c:1.4	Thu Apr  9 16:47:56 2015
+++ src/tests/lib/libc/inet/t_inet_network.c	Thu Oct  6 06:05:31 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_inet_network.c,v 1.4 2015/04/09 16:47:56 ginsbach Exp $ */
+/* $NetBSD: t_inet_network.c,v 1.5 2022/10/06 06:05:31 ryo Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_inet_network.c,v 1.4 2015/04/09 16:47:56 ginsbach Exp $");
+__RCSID("$NetBSD: t_inet_network.c,v 1.5 2022/10/06 06:05:31 ryo Exp $");
 
 #include 
 
@@ -92,6 +92,9 @@ ATF_TC_BODY(inet_network_err, tc)
 		0x);
 	H_REQUIRE("255.255.255.255", 0x);
 	H_REQUIRE("x", 0x);
+	H_REQUIRE("x1", 0x);
+	H_REQUIRE("xab", 0x);
+	H_REQUIRE("x100", 0x);
 	H_REQUIRE("078", 0x);
 	H_REQUIRE("127.0xfff", 0x);
 }



CVS commit: src/tests/lib/libc/inet

2022-10-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Oct  6 06:05:31 UTC 2022

Modified Files:
src/tests/lib/libc/inet: t_inet_network.c

Log Message:
add tests for PR/57046.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/inet/t_inet_network.c

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



CVS commit: src/lib/libc/inet

2022-10-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Oct  6 06:03:06 UTC 2022

Modified Files:
src/lib/libc/inet: inet_network.c

Log Message:
fix fixPR/57046. inet_network(3) returns INADDR_NONE when network names such as 
/x[0-9a-f][0-9a-f]/.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/inet/inet_network.c

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



CVS commit: src/lib/libc/inet

2022-10-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Oct  6 06:03:06 UTC 2022

Modified Files:
src/lib/libc/inet: inet_network.c

Log Message:
fix fixPR/57046. inet_network(3) returns INADDR_NONE when network names such as 
/x[0-9a-f][0-9a-f]/.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/inet/inet_network.c

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

Modified files:

Index: src/lib/libc/inet/inet_network.c
diff -u src/lib/libc/inet/inet_network.c:1.4 src/lib/libc/inet/inet_network.c:1.5
--- src/lib/libc/inet/inet_network.c:1.4	Sun Jan 20 04:56:08 2008
+++ src/lib/libc/inet/inet_network.c	Thu Oct  6 06:03:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: inet_network.c,v 1.4 2008/01/20 04:56:08 christos Exp $	*/
+/*	$NetBSD: inet_network.c,v 1.5 2022/10/06 06:03:06 ryo Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)inet_network.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: inet_network.c,v 1.4 2008/01/20 04:56:08 christos Exp $");
+__RCSID("$NetBSD: inet_network.c,v 1.5 2022/10/06 06:03:06 ryo Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -71,10 +71,11 @@ inet_network(const char *cp)
 
 again:
 	val = 0; base = 10; digit = 0;
-	if (*cp == '0')
+	if (*cp == '0') {
 		digit = 1, base = 8, cp++;
-	if (*cp == 'x' || *cp == 'X')
-		digit = 0, base = 16, cp++;
+		if (*cp == 'x' || *cp == 'X')
+			digit = 0, base = 16, cp++;
+	}
 	while ((c = *cp) != 0) {
 		if (isdigit(c)) {
 			if (base == 8 && (c == '8' || c == '9'))



CVS commit: src/sys

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 00:22:16 UTC 2022

Modified Files:
src/sys/arch/x86/include: specialreg.h
src/sys/dev/nvmm/x86: nvmm_x86.c

Log Message:
Update some AMD CPUID bits:

- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/nvmm/x86/nvmm_x86.c

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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.191 src/sys/arch/x86/include/specialreg.h:1.192
--- src/sys/arch/x86/include/specialreg.h:1.191	Wed Jun 15 16:25:33 2022
+++ src/sys/arch/x86/include/specialreg.h	Thu Oct  6 00:22:16 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.191 2022/06/15 16:25:33 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.192 2022/10/06 00:22:16 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -483,7 +483,7 @@
 /* %ecx = 0, %edx */
 #define CPUID_SEF_AVX512_4VNNIW	__BIT(2)  /* AVX512 4-reg Neural Network ins */
 #define CPUID_SEF_AVX512_4FMAPS	__BIT(3)  /* AVX512 4-reg Mult Accum Single precision */
-#define CPUID_SEF_FSREP_MOV	__BIT(4)  /* Fast Short REP MOVE */
+#define CPUID_SEF_FSRM		__BIT(4)  /* Fast Short Rep Move */
 #define CPUID_SEF_AVX512_VP2INTERSECT __BIT(8) /* AVX512 VP2INTERSECT */
 #define CPUID_SEF_SRBDS_CTRL	__BIT(9)  /* IA32_MCU_OPT_CTRL */
 #define CPUID_SEF_MD_CLEAR	__BIT(10) /* VERW clears CPU buffers */
@@ -503,7 +503,7 @@
 
 #define CPUID_SEF_FLAGS2	"\20"	  \
 "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \
-	"\5" "FSREP_MOV"		  \
+	"\5" "FSRM"			  \
 	"\11VP2INTERSECT" "\12SRBDS_CTRL" "\13MD_CLEAR"			  \
 			"\16TSX_FORCE_ABORT" "\17SERIALIZE" "\20HYBRID"	  \
 	"\21" "TSXLDTRK"		"\23" "PCONFIG"	"\24" "ARCH_LBR"  \
@@ -527,7 +527,7 @@
 	"\31" "LAM"
 
 /* %ecx = 1, %ebx */
-#define CPUID_SEF_PPIN		__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
+#define CPUID_SEF_INTEL_PPIN	__BIT(0)  /* IA32_PPIN & IA32_PPIN_CTL MSRs */
 
 #define CPUID_SEF1_FLAGS_B	"\20"\
 "\1" "PPIN"
@@ -618,10 +618,10 @@
  */
 
 /* %ecx = 1, %eax */
-#define CPUID_PES1_XSAVEOPT	0x0001	/* xsaveopt instruction */
-#define CPUID_PES1_XSAVEC	0x0002	/* xsavec & compacted XRSTOR */
-#define CPUID_PES1_XGETBV	0x0004	/* xgetbv with ECX = 1 */
-#define CPUID_PES1_XSAVES	0x0008	/* xsaves/xrstors, IA32_XSS */
+#define CPUID_PES1_XSAVEOPT	__BIT(0)	/* xsaveopt instruction */
+#define CPUID_PES1_XSAVEC	__BIT(1)	/* xsavec & compacted XRSTOR */
+#define CPUID_PES1_XGETBV	__BIT(2)	/* xgetbv with ECX = 1 */
+#define CPUID_PES1_XSAVES	__BIT(3)	/* xsaves/xrstors, IA32_XSS */
 
 #define CPUID_PES1_FLAGS	"\20"	\
 	"\1" "XSAVEOPT"	"\2" "XSAVEC"	"\3" "XGETBV"	"\4" "XSAVES"
@@ -801,6 +801,7 @@
 #define CPUID_CAPEX_IRPERF	   __BIT(1)  /* InstRetCntMsr */
 #define CPUID_CAPEX_XSAVEERPTR	   __BIT(2)  /* RstrFpErrPtrs by XRSTOR */
 #define CPUID_CAPEX_RDPRU	   __BIT(4)  /* RDPRU instruction */
+#define CPUID_CAPEX_MBE		   __BIT(6)  /* Memory Bandwidth Enforcement */
 #define CPUID_CAPEX_MCOMMIT	   __BIT(8)  /* MCOMMIT instruction */
 #define CPUID_CAPEX_WBNOINVD	   __BIT(9)  /* WBNOINVD instruction */
 #define CPUID_CAPEX_IBPB	   __BIT(12) /* Speculation Control IBPB */
@@ -812,26 +813,28 @@
 #define CPUID_CAPEX_PREFER_IBRS	   __BIT(18) /* IBRS preferred */
 #define CPUID_CAPEX_IBRS_SAMEMODE  __BIT(19) /* IBRS same speculation limits */
 #define CPUID_CAPEX_EFER_LSMSLE_UN __BIT(20) /* EFER.LMSLE is unsupported */
+#define CPUID_CAPEX_AMD_PPIN	   __BIT(23) /* Protected Processor Inventory Number */
 #define CPUID_CAPEX_SSBD	   __BIT(24) /* Speculation Control SSBD */
 #define CPUID_CAPEX_VIRT_SSBD	   __BIT(25) /* Virt Spec Control SSBD */
 #define CPUID_CAPEX_SSB_NO	   __BIT(26) /* SSBD not required */
+#define CPUID_CAPEX_CPPC	   __BIT(27) /* Collaborative Processor Perf. Control */
 #define CPUID_CAPEX_PSFD	   __BIT(28) /* Predictive Store Forward Dis */
 
 #define CPUID_CAPEX_FLAGS	"\20"	   \
 	"\1CLZERO"	"\2IRPERF"	"\3XSAVEERPTR"			   \
-	"\5RDPRU"			"\7B6"   \
+	"\5RDPRU"			"\7MBE"   \
 	"\11MCOMMIT"	"\12WBNOINVD"	"\13B10"			   \
 	"\15IBPB"	"\16INT_WBINVD"	"\17IBRS"	"\20STIBP"	   \
 	"\21IBRS_ALWAYSON" "\22STIBP_ALWAYSON" "\23PREFER_IBRS"		   \
 			"\24IBRS_SAMEMODE" \
-	"\25EFER_LSMSLE_UN"		   \
-	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"			   \
+	"\25EFER_LSMSLE_UN""\30PPIN"	   \
+	"\31SSBD"	"\32VIRT_SSBD"	"\33SSB_NO"	"\34CPPC"	   \
 	"\35PSFD"
 
 /* %ecx */
-#define CPUID_CAPEX_PerfTscSize	__BITS(17,16)
-#define CPUID_CAPEX_ApicIdSize	__BITS(15,12)
-#define CPUID_CAPEX_NC		__BITS

CVS commit: src/sys

2022-10-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct  6 00:22:16 UTC 2022

Modified Files:
src/sys/arch/x86/include: specialreg.h
src/sys/dev/nvmm/x86: nvmm_x86.c

Log Message:
Update some AMD CPUID bits:

- Rename FSREP_MOV to FSRM.
- Add Memory Bandwidth Enforcement (MBE)
- Add AMD's PPIN. Rename CPUID_SEF_PPIN to CPUID_SEF_INTEL_PPIN.
- Add Collaborative Processor Performance Control (CPPC).
- Add HOST_MCE_OVERRIDE.
- Add some unknown bits as Bxx.
- Add comments.
- Use __BIT().


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/nvmm/x86/nvmm_x86.c

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



CVS commit: src/doc

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:51:37 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1884 -r1.1885 src/doc/3RDPARTY
cvs rdiff -u -r1.2914 -r1.2915 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1884 src/doc/3RDPARTY:1.1885
--- src/doc/3RDPARTY:1.1884	Wed Oct  5 18:21:19 2022
+++ src/doc/3RDPARTY	Wed Oct  5 18:51:37 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1884 2022/10/05 22:21:19 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1885 2022/10/05 22:51:37 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1071,7 +1071,7 @@ Notes:
 Patch applied after OpenSSH import.
 
 Package:	OpenSSH
-Version:	9.0
+Version:	9.1
 Current Vers:	9.1 / portable 9.1p1
 Maintainer:	OpenSSH
 Archive Site:	http://www.openssh.com/ftp.html

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2914 src/doc/CHANGES:1.2915
--- src/doc/CHANGES:1.2914	Wed Oct  5 18:21:19 2022
+++ src/doc/CHANGES	Wed Oct  5 18:51:37 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2914 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2915 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -694,3 +694,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	file(1): Upgraded to 5.43. [christos 20220924]
 	tzdata: updated to 2022d (using the 2022dgtz fork) [kre 20220928]
 	dhcp: Patch to version 4.4.3-P1. [christos 20221005]
+	OpenSSH: Import 9.1. [christos 20221005]



CVS commit: src/doc

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:51:37 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSH


To generate a diff of this commit:
cvs rdiff -u -r1.1884 -r1.1885 src/doc/3RDPARTY
cvs rdiff -u -r1.2914 -r1.2915 src/doc/CHANGES

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



CVS commit: src/distrib/sets/lists

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:40:12 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump libssh for OpenSSH-9.1


To generate a diff of this commit:
cvs rdiff -u -r1.940 -r1.941 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.297 -r1.298 src/distrib/sets/lists/debug/shl.mi

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

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.940 src/distrib/sets/lists/base/shl.mi:1.941
--- src/distrib/sets/lists/base/shl.mi:1.940	Sat Sep 24 16:36:49 2022
+++ src/distrib/sets/lists/base/shl.mi	Wed Oct  5 18:40:12 2022
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.940 2022/09/24 20:36:49 christos Exp $
+# $NetBSD: shl.mi,v 1.941 2022/10/05 22:40:12 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -888,8 +888,8 @@
 ./usr/lib/libsqlite3.so.1.4			base-sys-shlib		compatfile
 ./usr/lib/libss.sobase-obsolete		obsolete
 ./usr/lib/libssh.sobase-secsh-shlib	compatfile
-./usr/lib/libssh.so.43base-secsh-shlib	compatfile
-./usr/lib/libssh.so.43.0			base-secsh-shlib	compatfile
+./usr/lib/libssh.so.44base-secsh-shlib	compatfile
+./usr/lib/libssh.so.44.0			base-secsh-shlib	compatfile
 ./usr/lib/libssl.sobase-crypto-shlib	compatfile
 ./usr/lib/libssl.so.12base-crypto-shlib	compatfile,openssl=10
 ./usr/lib/libssl.so.12.0			base-crypto-shlib	compatfile,openssl=10

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.297 src/distrib/sets/lists/debug/shl.mi:1.298
--- src/distrib/sets/lists/debug/shl.mi:1.297	Sat Sep 24 16:36:49 2022
+++ src/distrib/sets/lists/debug/shl.mi	Wed Oct  5 18:40:12 2022
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.297 2022/09/24 20:36:49 christos Exp $
+# $NetBSD: shl.mi,v 1.298 2022/10/05 22:40:12 christos Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,dynamicroot,zfs
@@ -310,7 +310,7 @@
 ./usr/libdata/debug/usr/lib/libskey.so.2.0.debug		comp-sys-debug	debug,compatfile,skey
 ./usr/libdata/debug/usr/lib/libsl.so.6.0.debug			comp-krb5-debug	debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libsqlite3.so.1.4.debug		comp-sys-debug	debug,compatfile
-./usr/libdata/debug/usr/lib/libssh.so.43.0.debug		comp-secsh-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libssh.so.44.0.debug		comp-secsh-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libssl.so.12.0.debug		comp-crypto-debug	debug,compatfile,openssl=10
 ./usr/libdata/debug/usr/lib/libssl.so.14.0.debug		comp-crypto-debug	debug,compatfile,openssl=11
 ./usr/libdata/debug/usr/lib/libstdc++.so.9.0.debug		comp-sys-debug	debug,compatfile,gcc=9,cxx,libstdcxx



CVS commit: src/distrib/sets/lists

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:40:12 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump libssh for OpenSSH-9.1


To generate a diff of this commit:
cvs rdiff -u -r1.940 -r1.941 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.297 -r1.298 src/distrib/sets/lists/debug/shl.mi

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



CVS commit: src/crypto/external/bsd/openssh

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:39:37 UTC 2022

Modified Files:
src/crypto/external/bsd/openssh/bin/sftp: Makefile
src/crypto/external/bsd/openssh/bin/ssh: Makefile
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/dist: PROTOCOL PROTOCOL.agent addr.c
auth.c auth.h auth2-hostbased.c auth2-passwd.c auth2-pubkey.c
auth2-pubkeyfile.c authfd.c authfile.c channels.c channels.h
clientloop.c compat.c compat.h krl.c misc.c misc.h moduli.c
monitor.c monitor_wrap.c monitor_wrap.h mux.c packet.c readconf.c
readconf.h readpass.c scp.1 scp.c servconf.c servconf.h
serverloop.c sftp-client.c sftp-client.h sftp-common.c
sftp-common.h sftp-server.c sftp-usergroup.c sftp.1 sftp.c
sk-usbhid.c ssh-add.c ssh-agent.c ssh-ed25519.c ssh-keygen.1
ssh-keygen.c ssh-keyscan.1 ssh-keyscan.c ssh-keysign.c
ssh-pkcs11-helper.8 ssh-sk-helper.c ssh-sk.c ssh-xmss.c ssh.1 ssh.c
ssh_config.5 sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf.c
sshbuf.h sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config.5
sshkey.c sshkey.h sshsig.c version.h xmss_hash.c
src/crypto/external/bsd/openssh/dist/moduli-gen: moduli.2048
moduli.3072 moduli.4096 moduli.6144 moduli.7680 moduli.8192
src/crypto/external/bsd/openssh/lib: shlib_version

Log Message:
merge conflicts between 9.0 and 9.1


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/bin/sftp/Makefile
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssh/bin/ssh/Makefile
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/PROTOCOL
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssh/dist/PROTOCOL.agent \
src/crypto/external/bsd/openssh/dist/sftp-common.c \
src/crypto/external/bsd/openssh/dist/sshbuf.c
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssh/dist/addr.c
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/dist/auth.c \
src/crypto/external/bsd/openssh/dist/serverloop.c \
src/crypto/external/bsd/openssh/dist/sshconnect.c
cvs rdiff -u -r1.22 -r1.23 src/crypto/external/bsd/openssh/dist/auth.h \
src/crypto/external/bsd/openssh/dist/channels.h \
src/crypto/external/bsd/openssh/dist/monitor_wrap.h
cvs rdiff -u -r1.21 -r1.22 \
src/crypto/external/bsd/openssh/dist/auth2-hostbased.c
cvs rdiff -u -r1.15 -r1.16 \
src/crypto/external/bsd/openssh/dist/auth2-passwd.c \
src/crypto/external/bsd/openssh/dist/compat.h \
src/crypto/external/bsd/openssh/dist/moduli.c
cvs rdiff -u -r1.31 -r1.32 \
src/crypto/external/bsd/openssh/dist/auth2-pubkey.c \
src/crypto/external/bsd/openssh/dist/misc.c \
src/crypto/external/bsd/openssh/dist/mux.c \
src/crypto/external/bsd/openssh/dist/sftp-client.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c \
src/crypto/external/bsd/openssh/dist/sftp-usergroup.c
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/authfd.c \
src/crypto/external/bsd/openssh/dist/compat.c
cvs rdiff -u -r1.26 -r1.27 src/crypto/external/bsd/openssh/dist/authfile.c \
src/crypto/external/bsd/openssh/dist/sftp.1 \
src/crypto/external/bsd/openssh/dist/ssh-add.c
cvs rdiff -u -r1.37 -r1.38 src/crypto/external/bsd/openssh/dist/channels.c
cvs rdiff -u -r1.35 -r1.36 src/crypto/external/bsd/openssh/dist/clientloop.c \
src/crypto/external/bsd/openssh/dist/scp.c \
src/crypto/external/bsd/openssh/dist/sftp.c
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/dist/krl.c
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/dist/misc.h \
src/crypto/external/bsd/openssh/dist/ssh-keysign.c
cvs rdiff -u -r1.40 -r1.41 src/crypto/external/bsd/openssh/dist/monitor.c \
src/crypto/external/bsd/openssh/dist/servconf.c \
src/crypto/external/bsd/openssh/dist/version.h
cvs rdiff -u -r1.30 -r1.31 \
src/crypto/external/bsd/openssh/dist/monitor_wrap.c \
src/crypto/external/bsd/openssh/dist/ssh-keygen.1
cvs rdiff -u -r1.46 -r1.47 src/crypto/external/bsd/openssh/dist/packet.c \
src/crypto/external/bsd/openssh/dist/sshd.c
cvs rdiff -u -r1.39 -r1.40 src/crypto/external/bsd/openssh/dist/readconf.c
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssh/dist/readconf.h \
src/crypto/external/bsd/openssh/dist/ssh-keyscan.c
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssh/dist/readpass.c \
src/crypto/external/bsd/openssh/dist/sshbuf.h
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssh/dist/scp.1 \
src/crypto/external/bsd/openssh/dist/servconf.h \
src/crypto/external/bsd/openssh/dist/sftp-server.c \
src/crypto/external/bsd/openssh/dist/sshd.8
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/

CVS commit: src/crypto/external/bsd/openssh

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:39:37 UTC 2022

Modified Files:
src/crypto/external/bsd/openssh/bin/sftp: Makefile
src/crypto/external/bsd/openssh/bin/ssh: Makefile
src/crypto/external/bsd/openssh/bin/sshd: Makefile
src/crypto/external/bsd/openssh/dist: PROTOCOL PROTOCOL.agent addr.c
auth.c auth.h auth2-hostbased.c auth2-passwd.c auth2-pubkey.c
auth2-pubkeyfile.c authfd.c authfile.c channels.c channels.h
clientloop.c compat.c compat.h krl.c misc.c misc.h moduli.c
monitor.c monitor_wrap.c monitor_wrap.h mux.c packet.c readconf.c
readconf.h readpass.c scp.1 scp.c servconf.c servconf.h
serverloop.c sftp-client.c sftp-client.h sftp-common.c
sftp-common.h sftp-server.c sftp-usergroup.c sftp.1 sftp.c
sk-usbhid.c ssh-add.c ssh-agent.c ssh-ed25519.c ssh-keygen.1
ssh-keygen.c ssh-keyscan.1 ssh-keyscan.c ssh-keysign.c
ssh-pkcs11-helper.8 ssh-sk-helper.c ssh-sk.c ssh-xmss.c ssh.1 ssh.c
ssh_config.5 sshbuf-getput-basic.c sshbuf-getput-crypto.c sshbuf.c
sshbuf.h sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config.5
sshkey.c sshkey.h sshsig.c version.h xmss_hash.c
src/crypto/external/bsd/openssh/dist/moduli-gen: moduli.2048
moduli.3072 moduli.4096 moduli.6144 moduli.7680 moduli.8192
src/crypto/external/bsd/openssh/lib: shlib_version

Log Message:
merge conflicts between 9.0 and 9.1


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssh/bin/sftp/Makefile
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssh/bin/ssh/Makefile
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/bin/sshd/Makefile
cvs rdiff -u -r1.19 -r1.20 src/crypto/external/bsd/openssh/dist/PROTOCOL
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssh/dist/PROTOCOL.agent \
src/crypto/external/bsd/openssh/dist/sftp-common.c \
src/crypto/external/bsd/openssh/dist/sshbuf.c
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssh/dist/addr.c
cvs rdiff -u -r1.32 -r1.33 src/crypto/external/bsd/openssh/dist/auth.c \
src/crypto/external/bsd/openssh/dist/serverloop.c \
src/crypto/external/bsd/openssh/dist/sshconnect.c
cvs rdiff -u -r1.22 -r1.23 src/crypto/external/bsd/openssh/dist/auth.h \
src/crypto/external/bsd/openssh/dist/channels.h \
src/crypto/external/bsd/openssh/dist/monitor_wrap.h
cvs rdiff -u -r1.21 -r1.22 \
src/crypto/external/bsd/openssh/dist/auth2-hostbased.c
cvs rdiff -u -r1.15 -r1.16 \
src/crypto/external/bsd/openssh/dist/auth2-passwd.c \
src/crypto/external/bsd/openssh/dist/compat.h \
src/crypto/external/bsd/openssh/dist/moduli.c
cvs rdiff -u -r1.31 -r1.32 \
src/crypto/external/bsd/openssh/dist/auth2-pubkey.c \
src/crypto/external/bsd/openssh/dist/misc.c \
src/crypto/external/bsd/openssh/dist/mux.c \
src/crypto/external/bsd/openssh/dist/sftp-client.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssh/dist/auth2-pubkeyfile.c \
src/crypto/external/bsd/openssh/dist/sftp-usergroup.c
cvs rdiff -u -r1.24 -r1.25 src/crypto/external/bsd/openssh/dist/authfd.c \
src/crypto/external/bsd/openssh/dist/compat.c
cvs rdiff -u -r1.26 -r1.27 src/crypto/external/bsd/openssh/dist/authfile.c \
src/crypto/external/bsd/openssh/dist/sftp.1 \
src/crypto/external/bsd/openssh/dist/ssh-add.c
cvs rdiff -u -r1.37 -r1.38 src/crypto/external/bsd/openssh/dist/channels.c
cvs rdiff -u -r1.35 -r1.36 src/crypto/external/bsd/openssh/dist/clientloop.c \
src/crypto/external/bsd/openssh/dist/scp.c \
src/crypto/external/bsd/openssh/dist/sftp.c
cvs rdiff -u -r1.20 -r1.21 src/crypto/external/bsd/openssh/dist/krl.c
cvs rdiff -u -r1.23 -r1.24 src/crypto/external/bsd/openssh/dist/misc.h \
src/crypto/external/bsd/openssh/dist/ssh-keysign.c
cvs rdiff -u -r1.40 -r1.41 src/crypto/external/bsd/openssh/dist/monitor.c \
src/crypto/external/bsd/openssh/dist/servconf.c \
src/crypto/external/bsd/openssh/dist/version.h
cvs rdiff -u -r1.30 -r1.31 \
src/crypto/external/bsd/openssh/dist/monitor_wrap.c \
src/crypto/external/bsd/openssh/dist/ssh-keygen.1
cvs rdiff -u -r1.46 -r1.47 src/crypto/external/bsd/openssh/dist/packet.c \
src/crypto/external/bsd/openssh/dist/sshd.c
cvs rdiff -u -r1.39 -r1.40 src/crypto/external/bsd/openssh/dist/readconf.c
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssh/dist/readconf.h \
src/crypto/external/bsd/openssh/dist/ssh-keyscan.c
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssh/dist/readpass.c \
src/crypto/external/bsd/openssh/dist/sshbuf.h
cvs rdiff -u -r1.27 -r1.28 src/crypto/external/bsd/openssh/dist/scp.1 \
src/crypto/external/bsd/openssh/dist/servconf.h \
src/crypto/external/bsd/openssh/dist/sftp-server.c \
src/crypto/external/bsd/openssh/dist/sshd.8
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/

CVS import: src/crypto/external/bsd/openssh/dist

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:35:37 UTC 2022

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv7511

Log Message:
Import OpenSSH-9.1 (previously we were on OpenSSH-9.0)

This release is focused on bug fixing.

Security


This release contains fixes for three minor memory safety problems.
None are believed to be exploitable, but we report most memory safety
problems as potential security vulnerabilities out of caution.

 * ssh-keyscan(1): fix a one-byte overflow in SSH- banner processing.
   Reported by Qualys

 * ssh-keygen(1): double free() in error path of file hashing step in
   signing/verify code; GHPR333

 * ssh-keysign(8): double-free in error path introduced in openssh-8.9

Potentially-incompatible changes


 * The portable OpenSSH project now signs commits and release tags
   using git's recent SSH signature support. The list of developer
   signing keys is included in the repository as .git_allowed_signers
   and is cross-signed using the PGP key that is still used to sign
   release artifacts:
   https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

 * ssh(1), sshd(8): SetEnv directives in ssh_config and sshd_config
   are now first-match-wins to match other directives. Previously
   if an environment variable was multiply specified the last set
   value would have been used. bz3438

 * ssh-keygen(8): ssh-keygen -A (generate all default host key types)
   will no longer generate DSA keys, as these are insecure and have
   not been used by default for some years.


New features


 * ssh(1), sshd(8): add a RequiredRSASize directive to set a minimum
   RSA key length. Keys below this length will be ignored for user
   authentication and for host authentication in sshd(8). 

   ssh(1) will terminate a connection if the server offers an RSA key
   that falls below this limit, as the SSH protocol does not include
   the ability to retry a failed key exchange.

 * sftp-server(8): add a "users-groups-by...@openssh.com" extension
   request that allows the client to obtain user/group names that
   correspond to a set of uids/gids.

 * sftp(1): use "users-groups-by...@openssh.com" sftp-server
   extension (when available) to fill in user/group names for
   directory listings.

 * sftp-server(8): support the "home-directory" extension request
   defined in draft-ietf-secsh-filexfer-extensions-00. This overlaps
   a bit with the existing "expand-p...@openssh.com", but some other
   clients support it.

 * ssh-keygen(1), sshd(8): allow certificate validity intervals,
   sshsig verification times and authorized_keys expiry-time options
   to accept dates in the UTC time zone in addition to the default
   of interpreting them in the system time zone. MMDD and
   YYMMDDHHMM[SS] dates/times will be interpreted as UTC if suffixed
   with a 'Z' character.

   Also allow certificate validity intervals to be specified in raw
   seconds-since-epoch as hex value, e.g. -V 0x1234:0x4567890. This
   is intended for use by regress tests and other tools that call
   ssh-keygen as part of a CA workflow. bz3468

 * sftp(1): allow arguments to the sftp -D option, e.g. sftp -D
   "/usr/libexec/sftp-server -el debug3"

 * ssh-keygen(1): allow the existing -U (use agent) flag to work
   with "-Y sign" operations, where it will be interpreted to require
   that the private keys is hosted in an agent; bz3429

Bugfixes


 * ssh-keygen(1): implement the "verify-required" certificate option.
   This was already documented when support for user-verified FIDO
   keys was added, but the ssh-keygen(1) code was missing.

 * ssh-agent(1): hook up the restrict_websafe command-line flag;
   previously the flag was accepted but never actually used.

 * sftp(1): improve filename tab completions: never try to complete
   names to non-existent commands, and better match the completion
   type (local or remote filename) against the argument position
   being completed.

 * ssh-keygen(1), ssh(1), ssh-agent(1): several fixes to FIDO key
   handling, especially relating to keys that request
   user-verification. These should reduce the number of unnecessary
   PIN prompts for keys that support intrinsic user verification.
   GHPR302, GHPR329

 * ssh-keygen(1): when enrolling a FIDO resident key, check if a
   credential with matching application and user ID strings already
   exists and, if so, prompt the user for confirmation before
   overwriting the credential. GHPR329

 * sshd(8): improve logging of errors when opening authorized_keys
   files. bz2042

 * ssh(1): avoid multiplexing operations that could cause SIGPIPE from
   causing the client to exit early. bz3454

 * ssh_config(5), sshd_config(5): clarify that the RekeyLimit
   directive applies to both transmitted and received data. GHPR328

 * ssh-keygen(1): avoid double fclose() in error path.

 * sshd(8): log an error if pip

CVS import: src/crypto/external/bsd/openssh/dist

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:35:37 UTC 2022

Update of /cvsroot/src/crypto/external/bsd/openssh/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv7511

Log Message:
Import OpenSSH-9.1 (previously we were on OpenSSH-9.0)

This release is focused on bug fixing.

Security


This release contains fixes for three minor memory safety problems.
None are believed to be exploitable, but we report most memory safety
problems as potential security vulnerabilities out of caution.

 * ssh-keyscan(1): fix a one-byte overflow in SSH- banner processing.
   Reported by Qualys

 * ssh-keygen(1): double free() in error path of file hashing step in
   signing/verify code; GHPR333

 * ssh-keysign(8): double-free in error path introduced in openssh-8.9

Potentially-incompatible changes


 * The portable OpenSSH project now signs commits and release tags
   using git's recent SSH signature support. The list of developer
   signing keys is included in the repository as .git_allowed_signers
   and is cross-signed using the PGP key that is still used to sign
   release artifacts:
   https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/RELEASE_KEY.asc

 * ssh(1), sshd(8): SetEnv directives in ssh_config and sshd_config
   are now first-match-wins to match other directives. Previously
   if an environment variable was multiply specified the last set
   value would have been used. bz3438

 * ssh-keygen(8): ssh-keygen -A (generate all default host key types)
   will no longer generate DSA keys, as these are insecure and have
   not been used by default for some years.


New features


 * ssh(1), sshd(8): add a RequiredRSASize directive to set a minimum
   RSA key length. Keys below this length will be ignored for user
   authentication and for host authentication in sshd(8). 

   ssh(1) will terminate a connection if the server offers an RSA key
   that falls below this limit, as the SSH protocol does not include
   the ability to retry a failed key exchange.

 * sftp-server(8): add a "users-groups-by...@openssh.com" extension
   request that allows the client to obtain user/group names that
   correspond to a set of uids/gids.

 * sftp(1): use "users-groups-by...@openssh.com" sftp-server
   extension (when available) to fill in user/group names for
   directory listings.

 * sftp-server(8): support the "home-directory" extension request
   defined in draft-ietf-secsh-filexfer-extensions-00. This overlaps
   a bit with the existing "expand-p...@openssh.com", but some other
   clients support it.

 * ssh-keygen(1), sshd(8): allow certificate validity intervals,
   sshsig verification times and authorized_keys expiry-time options
   to accept dates in the UTC time zone in addition to the default
   of interpreting them in the system time zone. MMDD and
   YYMMDDHHMM[SS] dates/times will be interpreted as UTC if suffixed
   with a 'Z' character.

   Also allow certificate validity intervals to be specified in raw
   seconds-since-epoch as hex value, e.g. -V 0x1234:0x4567890. This
   is intended for use by regress tests and other tools that call
   ssh-keygen as part of a CA workflow. bz3468

 * sftp(1): allow arguments to the sftp -D option, e.g. sftp -D
   "/usr/libexec/sftp-server -el debug3"

 * ssh-keygen(1): allow the existing -U (use agent) flag to work
   with "-Y sign" operations, where it will be interpreted to require
   that the private keys is hosted in an agent; bz3429

Bugfixes


 * ssh-keygen(1): implement the "verify-required" certificate option.
   This was already documented when support for user-verified FIDO
   keys was added, but the ssh-keygen(1) code was missing.

 * ssh-agent(1): hook up the restrict_websafe command-line flag;
   previously the flag was accepted but never actually used.

 * sftp(1): improve filename tab completions: never try to complete
   names to non-existent commands, and better match the completion
   type (local or remote filename) against the argument position
   being completed.

 * ssh-keygen(1), ssh(1), ssh-agent(1): several fixes to FIDO key
   handling, especially relating to keys that request
   user-verification. These should reduce the number of unnecessary
   PIN prompts for keys that support intrinsic user verification.
   GHPR302, GHPR329

 * ssh-keygen(1): when enrolling a FIDO resident key, check if a
   credential with matching application and user ID strings already
   exists and, if so, prompt the user for confirmation before
   overwriting the credential. GHPR329

 * sshd(8): improve logging of errors when opening authorized_keys
   files. bz2042

 * ssh(1): avoid multiplexing operations that could cause SIGPIPE from
   causing the client to exit early. bz3454

 * ssh_config(5), sshd_config(5): clarify that the RekeyLimit
   directive applies to both transmitted and received data. GHPR328

 * ssh-keygen(1): avoid double fclose() in error path.

 * sshd(8): log an error if pip

CVS commit: src/doc

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:21:19 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention dhcp patch


To generate a diff of this commit:
cvs rdiff -u -r1.1883 -r1.1884 src/doc/3RDPARTY
cvs rdiff -u -r1.2913 -r1.2914 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1883 src/doc/3RDPARTY:1.1884
--- src/doc/3RDPARTY:1.1883	Tue Oct  4 08:18:58 2022
+++ src/doc/3RDPARTY	Wed Oct  5 18:21:19 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1883 2022/10/04 12:18:58 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1884 2022/10/05 22:21:19 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -335,12 +335,12 @@ distribution into the netbsd format.  Th
 src/lib/libc/db/db2netbsd.
 
 Package:	dhcp
-Version:	4.4.3
-Current Vers:	4.4.3
+Version:	4.4.3-P1
+Current Vers:	4.4.3-P1
 Maintainer:	mellon
 Archive Site:	ftp://ftp.isc.org/isc/dhcp/
 Home Page:	http://www.isc.org/software/dhcp/
-Date:		2022-04-02
+Date:		2022-10-05
 Mailing List:	dhcp-ser...@isc.org
 Mailing List:	dhcp-cli...@isc.org
 Mailing List:	dhcp-annou...@isc.org

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2913 src/doc/CHANGES:1.2914
--- src/doc/CHANGES:1.2913	Wed Sep 28 07:09:13 2022
+++ src/doc/CHANGES	Wed Oct  5 18:21:19 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2913 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2914 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -693,3 +693,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	unbound(8): Import 1.16.3. [christos 20220924]
 	file(1): Upgraded to 5.43. [christos 20220924]
 	tzdata: updated to 2022d (using the 2022dgtz fork) [kre 20220928]
+	dhcp: Patch to version 4.4.3-P1. [christos 20221005]



CVS commit: src/doc

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:21:19 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
mention dhcp patch


To generate a diff of this commit:
cvs rdiff -u -r1.1883 -r1.1884 src/doc/3RDPARTY
cvs rdiff -u -r1.2913 -r1.2914 src/doc/CHANGES

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



CVS commit: src/external/mpl/dhcp/dist

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:20:15 UTC 2022

Modified Files:
src/external/mpl/dhcp/dist: RELNOTES
src/external/mpl/dhcp/dist/common: options.c
src/external/mpl/dhcp/dist/common/tests: option_unittest.c

Log Message:
Apply security fixes:
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2928.4-4-3.diff
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2929.4-4-3.diff


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/mpl/dhcp/dist/RELNOTES
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/dhcp/dist/common/options.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/mpl/dhcp/dist/common/tests/option_unittest.c

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



CVS commit: src/external/mpl/dhcp/dist

2022-10-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Oct  5 22:20:15 UTC 2022

Modified Files:
src/external/mpl/dhcp/dist: RELNOTES
src/external/mpl/dhcp/dist/common: options.c
src/external/mpl/dhcp/dist/common/tests: option_unittest.c

Log Message:
Apply security fixes:
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2928.4-4-3.diff
https://downloads.isc.org/isc/dhcp/4.4.3-P1/patches/CVE-2022-2929.4-4-3.diff


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/mpl/dhcp/dist/RELNOTES
cvs rdiff -u -r1.6 -r1.7 src/external/mpl/dhcp/dist/common/options.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/mpl/dhcp/dist/common/tests/option_unittest.c

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

Modified files:

Index: src/external/mpl/dhcp/dist/RELNOTES
diff -u src/external/mpl/dhcp/dist/RELNOTES:1.1.1.4 src/external/mpl/dhcp/dist/RELNOTES:1.2
--- src/external/mpl/dhcp/dist/RELNOTES:1.1.1.4	Sat Apr  2 21:08:35 2022
+++ src/external/mpl/dhcp/dist/RELNOTES	Wed Oct  5 18:20:15 2022
@@ -1,10 +1,8 @@
 Internet Systems Consortium DHCP Distribution
-Version 4.4.3
-9 March 2022
+  Version 4.4.3-P1
+? ? 2022
 Release Notes
 
-NEW FEATURES
-
 Please note that that ISC DHCP is licensed under the Mozilla Public
 License, MPL 2.0. Please see https://www.mozilla.org/en-US/MPL/2.0/ to read
 the MPL 2.0 license terms.
@@ -28,6 +26,20 @@ ISC DHCP is open source software maintai
 Consortium.  This product includes cryptographic software written
 by Eric Young (e...@cryptsoft.com).
 
+		Changes since 4.4.3 (Bug Fixes)
+
+! Corrected a reference count leak that occurs when the server builds
+  responses to leasequery packets. Thanks to VictorV of Cyber Kunlun
+  Lab for reporting the issue.
+  [Gitblab #253]
+  CVE: CVS-2022-2928
+
+! Corrected a memory leak that occurs when unpacking a packet that has an
+  FQDN option (81) that contains a label whose lenght is greater than 63.
+  Thanks to VictorV of Cyber Kunlun Lab for reporting the issue.
+  [Gitblab #254]
+  CVE: CVS-2022-2929
+
 		Changes since 4.4.2-P1 (New Features)
 
 - Two new OMAPI function calls were added, `dhcpctl_timed_connect()`

Index: src/external/mpl/dhcp/dist/common/options.c
diff -u src/external/mpl/dhcp/dist/common/options.c:1.6 src/external/mpl/dhcp/dist/common/options.c:1.7
--- src/external/mpl/dhcp/dist/common/options.c:1.6	Sat Apr  2 21:10:58 2022
+++ src/external/mpl/dhcp/dist/common/options.c	Wed Oct  5 18:20:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.6 2022/04/03 01:10:58 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.7 2022/10/05 22:20:15 christos Exp $	*/
 
 /* options.c
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: options.c,v 1.6 2022/04/03 01:10:58 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.7 2022/10/05 22:20:15 christos Exp $");
 
 #define DHCP_OPTION_DATA
 #include "dhcpd.h"
@@ -465,16 +465,16 @@ int fqdn_universe_decode (struct option_
 		while (s < &bp -> data[0] + length + 2) {
 			len = *s;
 			if (len > 63) {
-log_info ("fancy bits in fqdn option");
-return 0;
+log_info ("label length exceeds 63 in fqdn option");
+goto bad;
 			}
 			if (len == 0) {
 terminated = 1;
 break;
 			}
 			if (s + len > &bp -> data [0] + length + 3) {
-log_info ("fqdn tag longer than buffer");
-return 0;
+log_info ("fqdn label longer than buffer");
+goto bad;
 			}
 
 			if (first_len == 0) {
@@ -4463,6 +4463,8 @@ add_option(struct option_state *options,
 	if (!option_cache_allocate(&oc, MDL)) {
 		log_error("No memory for option cache adding %s (option %d).",
 			  option->name, option_num);
+		/* Get rid of reference created during hash lookup. */
+		option_dereference(&option, MDL);
 		return 0;
 	}
 
@@ -4474,6 +4476,8 @@ add_option(struct option_state *options,
 			 MDL)) {
 		log_error("No memory for constant data adding %s (option %d).",
 			  option->name, option_num);
+		/* Get rid of reference created during hash lookup. */
+		option_dereference(&option, MDL);
 		option_cache_dereference(&oc, MDL);
 		return 0;
 	}
@@ -4482,6 +4486,9 @@ add_option(struct option_state *options,
 	save_option(&dhcp_universe, options, oc);
 	option_cache_dereference(&oc, MDL);
 
+	/* Get rid of reference created during hash lookup. */
+	option_dereference(&option, MDL);
+
 	return 1;
 }
 

Index: src/external/mpl/dhcp/dist/common/tests/option_unittest.c
diff -u src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.4 src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.5
--- src/external/mpl/dhcp/dist/common/tests/option_unittest.c:1.4	Sat Apr  2 21:10:58 2022
+++ src/external/mpl/dhcp/dist/common/tests/option_unittest.c	Wed Oct  5 18:20:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: opti

CVS commit: src/include

2022-10-05 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct  5 12:09:07 UTC 2022

Modified Files:
src/include: stdlib.h

Log Message:
Remove hacky gcc2-specific alloca definition.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/include/stdlib.h

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

Modified files:

Index: src/include/stdlib.h
diff -u src/include/stdlib.h:1.123 src/include/stdlib.h:1.124
--- src/include/stdlib.h:1.123	Sat Jul  3 14:07:13 2021
+++ src/include/stdlib.h	Wed Oct  5 12:09:07 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdlib.h,v 1.123 2021/07/03 14:07:13 christos Exp $	*/
+/*	$NetBSD: stdlib.h,v 1.124 2022/10/05 12:09:07 nia Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -269,10 +269,7 @@ int	 getsubopt(char **, char * const *, 
  * Implementation-defined extensions
  */
 #if defined(_NETBSD_SOURCE)
-#if defined(alloca) && (alloca == __builtin_alloca) && \
-	defined(__GNUC__) && (__GNUC__ < 2)
-void	*alloca(int); /* built-in for gcc */
-#elif defined(__PCC__) && !defined(__GNUC__)
+#if defined(__PCC__) && !defined(__GNUC__)
 #define alloca(size) __builtin_alloca(size)
 #else
 void	*alloca(size_t);



CVS commit: src/include

2022-10-05 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct  5 12:09:07 UTC 2022

Modified Files:
src/include: stdlib.h

Log Message:
Remove hacky gcc2-specific alloca definition.


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/include/stdlib.h

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



CVS commit: src/lib/libc

2022-10-05 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct  5 10:28:19 UTC 2022

Modified Files:
src/lib/libc/arch/aarch64/softfloat: qp.c
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
libc: switch aarch64 to use softfloat functions from compiler_rt

The old definitions in qp.c being all grouped together in one file
causes problems when static linking with libgcc (i.e. cc --static-libgcc)
due to functions like __trunctfdf2 conflicting with libgcc, as seen in
PR 57021

We can also add some missing functions like __fixdfti for converting
a double to an int128_t, the lack of which is currently preventing webkit
from linking on aarch64, as seen in PR 57022

Unclear to me if libc is the right place for these functions, but
we can avoid breaking compatibility right now and maintain the status
quo while avoiding some obvious immediate problems.
nm output for libc shows no functions being removed by this change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/softfloat/qp.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/compiler_rt/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/aarch64/softfloat/qp.c
diff -u src/lib/libc/arch/aarch64/softfloat/qp.c:1.3 src/lib/libc/arch/aarch64/softfloat/qp.c:1.4
--- src/lib/libc/arch/aarch64/softfloat/qp.c:1.3	Mon Aug 27 16:46:13 2018
+++ src/lib/libc/arch/aarch64/softfloat/qp.c	Wed Oct  5 10:28:19 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: qp.c,v 1.3 2018/08/27 16:46:13 ryo Exp $ */
+/* $NetBSD: qp.c,v 1.4 2022/10/05 10:28:19 nia Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -38,39 +38,12 @@
  * invoke them directly since long double arguments are passed in FP/SIMD
  * as well as being returned in them while float128 arguments are passed
  * in normal registers.
+ *
+ * XXX: we're using compiler_rt for this now. Only one function remains
+ * that is missing from compiler_rt.
  */
 
-long double __addtf3(long double, long double);
-long double __divtf3(long double, long double);
-long double __modtf3(long double, long double);
-long double __multf3(long double, long double);
 long double __negtf2(long double);
-long double __subtf3(long double, long double);
-
-double __trunctfdf2(long double);
-float __trunctfsf2(long double);
-
-long double __extendsftf2(float);
-long double __extenddftf2(double);
-
-long double __floatsitf(int32_t);
-long double __floatditf(int64_t);
-
-long double __floatunsitf(uint32_t);
-long double __floatunditf(uint64_t);
-
-int32_t __fixtfsi(long double);
-int64_t __fixtfdi(long double);
-
-uint32_t __fixuntfsi(long double);
-uint64_t __fixuntfdi(long double);
-
-#if 0
-long double __floattitf(int128_t);
-long double __floatuntitf(uint128_t);
-int128_t __fixtfti(long double);
-uint128_t __fixuntfti(long double);
-#endif
 
 union sf_ieee_flt_u {
 	float fltu_f;
@@ -88,42 +61,6 @@ union sf_ieee_ldbl_u {
 };
 
 long double
-__addtf3(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-	const union sf_ieee_ldbl_u c = {
-	.ldblu_f128 = float128_add(a.ldblu_f128, b.ldblu_f128)
-	};
-
-	return c.ldblu_ld;
-}
-
-long double
-__divtf3(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-	const union sf_ieee_ldbl_u c = {
-	.ldblu_f128 = float128_div(a.ldblu_f128, b.ldblu_f128)
-	};
-
-	return c.ldblu_ld;
-}
-
-long double
-__multf3(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-	const union sf_ieee_ldbl_u c = {
-	.ldblu_f128 = float128_mul(a.ldblu_f128, b.ldblu_f128)
-	};
-
-	return c.ldblu_ld;
-}
-
-long double
 __negtf2(long double ld_a)
 {
 	const union sf_ieee_ldbl_u zero = { .ldblu_ld = 0.0 };
@@ -134,168 +71,3 @@ __negtf2(long double ld_a)
 
 	return b.ldblu_ld;
 }
-
-long double
-__subtf3(long double ld_a, long double ld_b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-	const union sf_ieee_ldbl_u c = {
-	.ldblu_f128 = float128_sub(a.ldblu_f128, b.ldblu_f128)
-	};
-
-	return c.ldblu_ld;
-}
-
-#if 0
-int
-__cmptf3(float128 *a, float128 *b)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_ldbl_u b = { .ldblu_ld = ld_b };
-
-	if (float128_eq(*a, *b))
-		return 0;
-
-	if (float128_le(*a, *b))
-		return 1;
-
-	return 2;
-}
-
-
-/*
- * XXX 
- */
-int
-_Qp_cmpe(float128 *a, float128 *b)
-{
-	return _Qp_cmp(a, b);
-}
-#endif
-
-float
-__trunctfsf2(long double ld_a)
-{
-	const union sf_ieee_ldbl_u a = { .ldblu_ld = ld_a };
-	const union sf_ieee_flt_u c = {
-		.fltu_f32 = float128_to_float32(a.ldblu_f128),
-	};
-
-	return c.fltu_f;
-}
-
-double
-__trunctfdf2(long double 

CVS commit: src/lib/libc

2022-10-05 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Wed Oct  5 10:28:19 UTC 2022

Modified Files:
src/lib/libc/arch/aarch64/softfloat: qp.c
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
libc: switch aarch64 to use softfloat functions from compiler_rt

The old definitions in qp.c being all grouped together in one file
causes problems when static linking with libgcc (i.e. cc --static-libgcc)
due to functions like __trunctfdf2 conflicting with libgcc, as seen in
PR 57021

We can also add some missing functions like __fixdfti for converting
a double to an int128_t, the lack of which is currently preventing webkit
from linking on aarch64, as seen in PR 57022

Unclear to me if libc is the right place for these functions, but
we can avoid breaking compatibility right now and maintain the status
quo while avoiding some obvious immediate problems.
nm output for libc shows no functions being removed by this change.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/aarch64/softfloat/qp.c
cvs rdiff -u -r1.40 -r1.41 src/lib/libc/compiler_rt/Makefile.inc

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 09:03:06 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
ppc4xx_tlb_enter: One more style sync. No binary changes.

Use hi and lo instead of th and tl for TLBHI and TLBLO, respectively,
as done for other functions in pmap.c.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 09:03:06 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
ppc4xx_tlb_enter: One more style sync. No binary changes.

Use hi and lo instead of th and tl for TLBHI and TLBLO, respectively,
as done for other functions in pmap.c.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/powerpc/ibm4xx/pmap.c

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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.108 src/sys/arch/powerpc/ibm4xx/pmap.c:1.109
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.108	Wed Oct  5 08:47:52 2022
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Wed Oct  5 09:03:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.108 2022/10/05 08:47:52 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.109 2022/10/05 09:03:06 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.108 2022/10/05 08:47:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2022/10/05 09:03:06 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1347,7 +1347,7 @@ ppc4xx_tlb_find_victim(void)
 void
 ppc4xx_tlb_enter(int ctx, vaddr_t va, u_int pte)
 {
-	u_long th, tl, i;
+	u_long hi, lo, i;
 	paddr_t pa;
 	int msr, pid, sz;
 
@@ -1355,9 +1355,9 @@ ppc4xx_tlb_enter(int ctx, vaddr_t va, u_
 
 	sz = (pte & TTE_SZ_MASK) >> TTE_SZ_SHIFT;
 	pa = (pte & TTE_RPN_MASK(sz));
-	th = (va & TLB_EPN_MASK) | (sz << TLB_SIZE_SHFT) | TLB_VALID;
-	tl = (pte & ~TLB_RPN_MASK) | pa;
-	tl |= ppc4xx_tlbflags(va, pa);
+	hi = (va & TLB_EPN_MASK) | (sz << TLB_SIZE_SHFT) | TLB_VALID;
+	lo = (pte & ~TLB_RPN_MASK) | pa;
+	lo |= ppc4xx_tlbflags(va, pa);
 
 	i = ppc4xx_tlb_find_victim();
 
@@ -1377,14 +1377,14 @@ ppc4xx_tlb_enter(int ctx, vaddr_t va, u_
 		MFPID(%[pid])			/* Save old PID */
 		MTPID(%[ctx])			/* Load translation ctx */
 		"isync;"
-		"tlbwe	%[tl],%[i],1;"		/* Set TLB */
-		"tlbwe	%[th],%[i],0;"
+		"tlbwe	%[lo],%[i],1;"		/* Set TLB */
+		"tlbwe	%[hi],%[i],0;"
 		"isync;"
 		MTPID(%[pid])			/* Restore PID */
 		"mtmsr	%[msr];"		/* and MSR */
 		"isync;"
 		: [msr] "=&r" (msr), [pid] "=&r" (pid)
-		: [ctx] "r" (ctx), [i] "r" (i), [tl] "r" (tl), [th] "r" (th));
+		: [ctx] "r" (ctx), [i] "r" (i), [lo] "r" (lo), [hi] "r" (hi));
 }
 
 void



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 08:47:52 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Use %[foo], %[bar], ... instead of %0, %1, ... for asm codes.
Unify variable names if possible. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/powerpc/ibm4xx/pmap.c

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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.107 src/sys/arch/powerpc/ibm4xx/pmap.c:1.108
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.107	Wed Oct  5 08:18:00 2022
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Wed Oct  5 08:47:52 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.107 2022/10/05 08:18:00 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.108 2022/10/05 08:47:52 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.107 2022/10/05 08:18:00 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.108 2022/10/05 08:47:52 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1160,7 +1160,7 @@ pmap_procwr(struct proc *p, vaddr_t va, 
 	struct pmap *pm = p->p_vmspace->vm_map.pmap;
 
 	if (__predict_true(p == curproc)) {
-		int msr, ctx, opid;
+		int msr, ctx, pid;
 
 		/*
 		 * Take it easy! TLB miss handler takes care of us.
@@ -1178,27 +1178,28 @@ pmap_procwr(struct proc *p, vaddr_t va, 
 		}
 
 		__asm volatile (
-			"mfmsr	%0;"
-			"li	%1,0x20;"	/* Turn off IMMU */
-			"andc	%1,%0,%1;"
-			"ori	%1,%1,0x10;"	/* Turn on DMMU for sure */
-			"mtmsr	%1;"
+			"mfmsr	%[msr];"
+			"li	%[pid],0x20;"		/* Turn off IMMU */
+			"andc	%[pid],%[msr],%[pid];"
+			"ori	%[pid],%[pid],0x10;" /* Turn on DMMU for sure */
+			"mtmsr	%[pid];"
 			"isync;"
-			MFPID(%1)
-			MTPID(%2)
+			MFPID(%[pid])
+			MTPID(%[ctx])
 			"isync;"
 		"1:"
-			"dcbst	0,%3;"
-			"icbi	0,%3;"
-			"add	%3,%3,%5;"
-			"sub.	%4,%4,%5;"
+			"dcbst	0,%[va];"
+			"icbi	0,%[va];"
+			"add	%[va],%[va],%[size];"
+			"sub.	%[len],%[len],%[size];"
 			"bge	1b;"
 			"sync;"
-			MTPID(%1)
-			"mtmsr	%0;"
+			MTPID(%[pid])
+			"mtmsr	%[msr];"
 			"isync;"
-			: "=&r" (msr), "=&r" (opid)
-			: "r" (ctx), "r" (va), "r" (len), "r" (CACHELINESIZE));
+			: [msr] "=&r" (msr), [pid] "=&r" (pid)
+			: [ctx] "r" (ctx), [va] "r" (va), [len] "r" (len),
+			  [size] "r" (CACHELINESIZE));
 	} else {
 		paddr_t pa;
 		vaddr_t tva, eva;
@@ -1236,18 +1237,18 @@ tlb_invalidate_entry(int i)
 	KASSERT(mfspr(SPR_PID) == KERNEL_PID);
 
 	__asm volatile (
-		"mfmsr	%0;"
-		"li	%1,0;"
-		"mtmsr	%1;"
-		MFPID(%1)
-		"tlbre	%2,%3,0;"
-		"andc	%2,%2,%4;"
-		"tlbwe	%2,%3,0;"
-		MTPID(%1)
-		"mtmsr	%0;"
+		"mfmsr	%[msr];"
+		"li	%[pid],0;"
+		"mtmsr	%[pid];"
+		MFPID(%[pid])
+		"tlbre	%[hi],%[i],0;"
+		"andc	%[hi],%[hi],%[valid];"
+		"tlbwe	%[hi],%[i],0;"
+		MTPID(%[pid])
+		"mtmsr	%[msr];"
 		"isync;"
-		: "=&r" (msr), "=&r" (pid), "=&r" (hi)
-		: "r" (i), "r" (TLB_VALID));
+		: [msr] "=&r" (msr), [pid] "=&r" (pid), [hi] "=&r" (hi)
+		: [i] "r" (i), [valid] "r" (TLB_VALID));
 #else
 	/*
 	 * Just clear entire TLBHI register.
@@ -1273,24 +1274,24 @@ ppc4xx_tlb_flush(vaddr_t va, int pid)
 		return;
 
 	__asm volatile (
-		MFPID(%1)		/* Save PID */
-		"mfmsr	%2;"		/* Save MSR */
-		"li	%0,0;"		/* Now clear MSR */
-		"mtmsr	%0;"
+		MFPID(%[found])		/* Save PID */
+		"mfmsr	%[msr];"	/* Save MSR */
+		"li	%[i],0;"	/* Now clear MSR */
+		"mtmsr	%[i];"
 		"isync;"
-		MTPID(%4)		/* Set PID */
+		MTPID(%[pid])		/* Set PID */
 		"isync;"
-		"tlbsx.	%0,0,%3;"	/* Search TLB */
+		"tlbsx.	%[i],0,%[va];"	/* Search TLB */
 		"isync;"
-		MTPID(%1)		/* Restore PID */
-		"mtmsr	%2;"		/* Restore MSR */
+		MTPID(%[found])		/* Restore PID */
+		"mtmsr	%[msr];"	/* Restore MSR */
 		"isync;"
-		"li	%1,1;"
+		"li	%[found],1;"
 		"beq	1f;"
-		"li	%1,0;"
+		"li	%[found],0;"
 	"1:"
-		: "=&r" (i), "=&r" (found), "=&r" (msr)
-		: "r" (va), "r" (pid));
+		: [i] "=&r" (i), [found] "=&r" (found), [msr] "=&r" (msr)
+		: [va] "r" (va), [pid] "r" (pid));
 
 	if (found && !TLB_LOCKED(i)) {
 		/* Now flush translation */
@@ -1346,7 +1347,7 @@ ppc4xx_tlb_find_victim(void)
 void
 ppc4xx_tlb_enter(int ctx, vaddr_t va, u_int pte)
 {
-	u_long th, tl, idx;
+	u_long th, tl, i;
 	paddr_t pa;
 	int msr, pid, sz;
 
@@ -1358,32 +1359,32 @@ ppc4xx_tlb_enter(int ctx, vaddr_t va, u_
 	tl = (pte & ~TLB_RPN_MASK) | pa;
 	tl |= ppc4xx_tlbflags(va, pa);
 
-	idx = ppc4xx_tlb_find_victim();
+	i = ppc4xx_tlb_find_victim();
 
-	KASSERTMSG(idx >= tlb_nreserved && idx < NTLB,
-	"invalid entry %ld", idx);
+	KASSERTMSG(i >= tlb_nreserved && i < NTLB,
+	"invalid entry %ld", i);
 
-	tlb_info[idx].ti_va = (va & TLB_EPN_MASK);
-	tlb_info[idx].ti_ctx = ctx;
-	tlb_info[idx].ti_flags = TLBF_USED | TLBF_REF;
+	tlb_info[i].ti_va = (va & TLB_EPN_MASK);
+	tlb_info[i].ti_ctx = ctx;
+	tlb_info[i].ti_flags = TLBF_USED | TLBF_REF;
 
 	__asm volatile (
-	

CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 08:47:52 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
Use %[foo], %[bar], ... instead of %0, %1, ... for asm codes.
Unify variable names if possible. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 08:18:00 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: clock.c copyinstr.c copyoutstr.c cpu.c
ibm4xx_machdep.c pmap.c trap.c

Log Message:
Minor style fixes to asm codes. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/ibm4xx/clock.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/ibm4xx/copyinstr.c \
src/sys/arch/powerpc/ibm4xx/copyoutstr.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/ibm4xx/cpu.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/ibm4xx/trap.c

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/powerpc/ibm4xx/clock.c
diff -u src/sys/arch/powerpc/ibm4xx/clock.c:1.32 src/sys/arch/powerpc/ibm4xx/clock.c:1.33
--- src/sys/arch/powerpc/ibm4xx/clock.c:1.32	Fri Mar  5 06:06:34 2021
+++ src/sys/arch/powerpc/ibm4xx/clock.c	Wed Oct  5 08:18:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.32 2021/03/05 06:06:34 rin Exp $	*/
+/*	$NetBSD: clock.c,v 1.33 2022/10/05 08:18:00 rin Exp $	*/
 /*  $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $  */
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.32 2021/03/05 06:06:34 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.33 2022/10/05 08:18:00 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
@@ -218,9 +218,9 @@ get_ppc4xx_timecount(struct timecounter 
 	u_long tb;
 	int msr;
 
-	__asm volatile ("mfmsr %0; wrteei 0" : "=r"(msr) :);
+	__asm volatile ("mfmsr %0; wrteei 0" : "=r" (msr));
 	tb = mftbl();
-	__asm volatile ("mtmsr %0" :: "r"(msr));
+	__asm volatile ("mtmsr %0" :: "r" (msr));
 
 	return tb;
 }
@@ -240,23 +240,26 @@ delay(unsigned int n)
 	tbh = tb >> 32;
 	tbl = tb;
 	__asm volatile (
+	"1:"
 #ifdef PPC_IBM403
-	"1:	mftbhi %0	\n"
+		"mftbhi	%0;"
 #else
-	"1:	mftbu %0	\n"
+		"mftbu	%0;"
 #endif
-	"	cmplw %0,%1	\n"
-	"	blt 1b		\n"
-	"	bgt 2f		\n"
+		"cmplw	%0,%1;"
+		"blt	1b;"
+		"bgt	2f;"
 #ifdef PPC_IBM403
-	"	mftblo %0	\n"
+		"mftblo	%0;"
 #else
-	"	mftb %0		\n"
+		"mftb	%0;"
 #endif
-	"	cmplw %0,%2	\n"
-	"	blt 1b		\n"
-	"2: 		\n"
-	: "=&r"(scratch) : "r"(tbh), "r"(tbl) : "cr0");
+		"cmplw	%0,%2;"
+		"blt	1b;"
+	"2:"
+	: "=&r" (scratch)
+	: "r" (tbh), "r" (tbl)
+	: "cr0");
 }
 
 /*

Index: src/sys/arch/powerpc/ibm4xx/copyinstr.c
diff -u src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.23 src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.24
--- src/sys/arch/powerpc/ibm4xx/copyinstr.c:1.23	Wed Oct  5 02:56:14 2022
+++ src/sys/arch/powerpc/ibm4xx/copyinstr.c	Wed Oct  5 08:18:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $	*/
+/*	$NetBSD: copyinstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyinstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $");
 
 #include 
 #include 
@@ -71,7 +71,7 @@ copyinstr(const void *uaddr, void *kaddr
 	}
 
 	resid = len;
-	__asm volatile(
+	__asm volatile (
 		"mtctr	%[resid];"		/* Set up counter */
 		"mfmsr	%[msr];"		/* Save MSR */
 		"li	%[tmp],0x20;"		/* Disable IMMU */
Index: src/sys/arch/powerpc/ibm4xx/copyoutstr.c
diff -u src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.23 src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.24
--- src/sys/arch/powerpc/ibm4xx/copyoutstr.c:1.23	Wed Oct  5 02:56:14 2022
+++ src/sys/arch/powerpc/ibm4xx/copyoutstr.c	Wed Oct  5 08:18:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $	*/
+/*	$NetBSD: copyoutstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.23 2022/10/05 02:56:14 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copyoutstr.c,v 1.24 2022/10/05 08:18:00 rin Exp $");
 
 #include 
 #include 
@@ -71,7 +71,7 @@ copyoutstr(const void *kaddr, void *uadd
 	}
 
 	resid = len;
-	__asm volatile(
+	__asm volatile (
 		"mtctr	%[resid];"		/* Set up counter */
 		"mfmsr	%[msr];"		/* Save MSR */
 		"li	%[tmp],0x20;"		/* Disable IMMU */

Index: src/sys/arch/powerpc/ibm4xx/cpu.c
diff -u src/sys/arch/powerpc/ibm4xx/cpu.c:1.38 src/sys/arch/powerpc/ibm4xx/cpu.c:1.39
--- src/sys/arch/powerpc/ibm4xx/cpu.c:1.38	Tue Mar 30 13:41:46 2021
+++ src/sys/arch/powerpc/ibm4xx/cpu.c	Wed Oct  5 08:18:00 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.38 2021/03/30 13:41:46 simonb Exp $	*/
+/*	$NetBSD: cpu.c,v 1.39 2022/10/05 08:18:00 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.38 2021/03/30

CVS commit: src/sys/arch/powerpc/ibm4xx

2022-10-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct  5 08:18:00 UTC 2022

Modified Files:
src/sys/arch/powerpc/ibm4xx: clock.c copyinstr.c copyoutstr.c cpu.c
ibm4xx_machdep.c pmap.c trap.c

Log Message:
Minor style fixes to asm codes. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/ibm4xx/clock.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/ibm4xx/copyinstr.c \
src/sys/arch/powerpc/ibm4xx/copyoutstr.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/ibm4xx/cpu.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/powerpc/ibm4xx/pmap.c
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/powerpc/ibm4xx/trap.c

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