CVS commit: src/usr.sbin/postinstall

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:59:00 UTC 2023

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall(8): Add opensslcerts item to regen /etc/openssl/certs.

Works only with destdir /, since it relies on running openssl(1),
which is not available as a tool or required in the cross-build
environment.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/postinstall/postinstall.in

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



CVS commit: src/usr.sbin/postinstall

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:59:00 UTC 2023

Modified Files:
src/usr.sbin/postinstall: postinstall.in

Log Message:
postinstall(8): Add opensslcerts item to regen /etc/openssl/certs.

Works only with destdir /, since it relies on running openssl(1),
which is not available as a tool or required in the cross-build
environment.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/postinstall/postinstall.in

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

Modified files:

Index: src/usr.sbin/postinstall/postinstall.in
diff -u src/usr.sbin/postinstall/postinstall.in:1.52 src/usr.sbin/postinstall/postinstall.in:1.53
--- src/usr.sbin/postinstall/postinstall.in:1.52	Wed Jun 21 18:46:06 2023
+++ src/usr.sbin/postinstall/postinstall.in	Sat Aug 26 05:59:00 2023
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.52 2023/06/21 18:46:06 mrg Exp $
+# $NetBSD: postinstall.in,v 1.53 2023/08/26 05:59:00 riastradh Exp $
 #
 # Copyright (c) 2002-2022 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1662,6 +1662,37 @@ do_named()
 
 
 #
+#	opensslcerts
+#
+
+additem opensslcerts "build /etc/openssl/certs cache of HTTPS CA certificates"
+do_opensslcerts()
+{
+	[ -n "$1" ] || err 3 "USAGE: do_opensslcerts fix|check"
+
+	case $1 in
+	check)	# XXX Anything to check?
+		return 0
+		;;
+	fix)	# This runs openssl(1), which is not available as a
+		# build-time tool.  So for now, restrict it to running
+		# on the installed system.
+		case $DEST_DIR in
+		''|/)	;;
+		*)	msg "opensslcerts limited to DEST_DIR=/"
+			return 1
+			;;
+		esac
+		certctl rehash
+		return 0
+		;;
+	*)	err 3 "USAGE: do_opensslcerts fix|check"
+		;;
+	esac
+}
+
+
+#
 #	pam
 #
 



CVS commit: src

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:58:49 UTC 2023

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/mpl: Makefile

Log Message:
mozilla-certdata: Connect it up to the build.


To generate a diff of this commit:
cvs rdiff -u -r1.1326 -r1.1327 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.251 -r1.252 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/Makefile

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/mi
diff -u src/distrib/sets/lists/base/mi:1.1326 src/distrib/sets/lists/base/mi:1.1327
--- src/distrib/sets/lists/base/mi:1.1326	Sat Aug 26 05:27:13 2023
+++ src/distrib/sets/lists/base/mi	Sat Aug 26 05:58:48 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1326 2023/08/26 05:27:13 riastradh Exp $
+# $NetBSD: mi,v 1.1327 2023/08/26 05:58:48 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1881,6 +1881,431 @@
 ./usr/share/calendar/calendar.music		base-calendar-share	share
 ./usr/share/calendar/calendar.netbsd		base-calendar-share	share
 ./usr/share/calendar/calendar.usholiday		base-calendar-share	share
+./usr/share/certsbase-mozcerts-share	share
+./usr/share/certs/mozilla			base-mozcerts-share	share
+./usr/share/certs/mozilla/all			base-mozcerts-share	share
+./usr/share/certs/mozilla/all/ACCVRAIZ1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AC_RAIZ_FNMT-RCM.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AC_RAIZ_FNMT-RCM_SERVIDORES_SEGUROS.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/ANF_Secure_Server_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Actalis_Authentication_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AffirmTrust_Commercial.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AffirmTrust_Networking.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AffirmTrust_Premium.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/AffirmTrust_Premium_ECC.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Amazon_Root_CA_1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Amazon_Root_CA_2.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Amazon_Root_CA_3.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Amazon_Root_CA_4.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Atos_TrustedRoot_2011.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Atos_TrustedRoot_Root_CA_ECC_G2_2020.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Atos_TrustedRoot_Root_CA_ECC_TLS_2021.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Atos_TrustedRoot_Root_CA_RSA_G2_2020.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Atos_TrustedRoot_Root_CA_RSA_TLS_2021.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/BJCA_Global_Root_CA1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/BJCA_Global_Root_CA2.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Baltimore_CyberTrust_Root.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Buypass_Class_2_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Buypass_Class_3_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/CA_Disig_Root_R2.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/CFCA_EV_ROOT.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/COMODO_Certification_Authority.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/COMODO_ECC_Certification_Authority.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/COMODO_RSA_Certification_Authority.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certainly_Root_E1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certainly_Root_R1.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certigna.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certigna_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certum_EC-384_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certum_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certum_Trusted_Network_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certum_Trusted_Network_CA_2.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Certum_Trusted_Root_CA.pem	base-mozcerts-share	share
+./usr/share/certs/mozilla/all/Chambers_of_Commerce_Root_-_2008.pem	base-mozcerts-share	share

CVS commit: src

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:58:49 UTC 2023

Modified Files:
src/distrib/sets/lists/base: mi
src/etc/mtree: NetBSD.dist.base
src/external/mpl: Makefile

Log Message:
mozilla-certdata: Connect it up to the build.


To generate a diff of this commit:
cvs rdiff -u -r1.1326 -r1.1327 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.251 -r1.252 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/Makefile

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



CVS commit: src/external/mpl/mozilla-certdata/share

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:58:18 UTC 2023

Added Files:
src/external/mpl/mozilla-certdata/share: code.trust email.trust
server.trust
src/external/mpl/mozilla-certdata/share/certs: ACCVRAIZ1.pem
AC_RAIZ_FNMT-RCM.pem AC_RAIZ_FNMT-RCM_SERVIDORES_SEGUROS.pem
ANF_Secure_Server_Root_CA.pem Actalis_Authentication_Root_CA.pem
AffirmTrust_Commercial.pem AffirmTrust_Networking.pem
AffirmTrust_Premium.pem AffirmTrust_Premium_ECC.pem
Amazon_Root_CA_1.pem Amazon_Root_CA_2.pem Amazon_Root_CA_3.pem
Amazon_Root_CA_4.pem Atos_TrustedRoot_2011.pem
Atos_TrustedRoot_Root_CA_ECC_G2_2020.pem
Atos_TrustedRoot_Root_CA_ECC_TLS_2021.pem
Atos_TrustedRoot_Root_CA_RSA_G2_2020.pem
Atos_TrustedRoot_Root_CA_RSA_TLS_2021.pem
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
BJCA_Global_Root_CA1.pem BJCA_Global_Root_CA2.pem
Baltimore_CyberTrust_Root.pem Buypass_Class_2_Root_CA.pem
Buypass_Class_3_Root_CA.pem CA_Disig_Root_R2.pem CFCA_EV_ROOT.pem
COMODO_Certification_Authority.pem
COMODO_ECC_Certification_Authority.pem
COMODO_RSA_Certification_Authority.pem Certainly_Root_E1.pem
Certainly_Root_R1.pem Certigna.pem Certigna_Root_CA.pem
Certum_EC-384_CA.pem Certum_Root_CA.pem
Certum_Trusted_Network_CA.pem Certum_Trusted_Network_CA_2.pem
Certum_Trusted_Root_CA.pem Chambers_of_Commerce_Root_-_2008.pem
Comodo_AAA_Services_root.pem D-TRUST_BR_Root_CA_1_2020.pem
D-TRUST_EV_Root_CA_1_2020.pem D-TRUST_Root_CA_3_2013.pem
D-TRUST_Root_Class_3_CA_2_2009.pem
D-TRUST_Root_Class_3_CA_2_EV_2009.pem
DIGITALSIGN_GLOBAL_ROOT_ECDSA_CA.pem
DIGITALSIGN_GLOBAL_ROOT_RSA_CA.pem DigiCert_Assured_ID_Root_CA.pem
DigiCert_Assured_ID_Root_G2.pem DigiCert_Assured_ID_Root_G3.pem
DigiCert_Global_Root_CA.pem DigiCert_Global_Root_G2.pem
DigiCert_Global_Root_G3.pem DigiCert_High_Assurance_EV_Root_CA.pem
DigiCert_SMIME_ECC_P384_Root_G5.pem
DigiCert_SMIME_RSA4096_Root_G5.pem
DigiCert_TLS_ECC_P384_Root_G5.pem DigiCert_TLS_RSA4096_Root_G5.pem
DigiCert_Trusted_Root_G4.pem
Entrust.net_Premium_2048_Secure_Server_CA.pem
Entrust_Root_Certification_Authority.pem
Entrust_Root_Certification_Authority_-_EC1.pem
Entrust_Root_Certification_Authority_-_G2.pem
Entrust_Root_Certification_Authority_-_G4.pem
Explicitly_Distrust_DigiNotar_Root_CA.pem
GDCA_TrustAUTH_R5_ROOT.pem GLOBALTRUST_2020.pem GTS_Root_R1.pem
GTS_Root_R2.pem GTS_Root_R3.pem GTS_Root_R4.pem
GlobalSign_ECC_Root_CA_-_R4.pem GlobalSign_ECC_Root_CA_-_R5.pem
GlobalSign_Root_CA.pem GlobalSign_Root_CA_-_R3.pem
GlobalSign_Root_CA_-_R6.pem GlobalSign_Root_E46.pem
GlobalSign_Root_R46.pem GlobalSign_Secure_Mail_Root_E45.pem
GlobalSign_Secure_Mail_Root_R45.pem
Global_Chambersign_Root_-_2008.pem Go_Daddy_Class_2_CA.pem
Go_Daddy_Root_Certificate_Authority_-_G2.pem
HARICA_Client_ECC_Root_CA_2021.pem
HARICA_Client_RSA_Root_CA_2021.pem HARICA_TLS_ECC_Root_CA_2021.pem
HARICA_TLS_RSA_Root_CA_2021.pem
Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem
Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem
HiPKI_Root_CA_-_G1.pem Hongkong_Post_Root_CA_3.pem ISRG_Root_X1.pem
ISRG_Root_X2.pem IdenTrust_Commercial_Root_CA_1.pem
IdenTrust_Public_Sector_Root_CA_1.pem Izenpe.com.pem
LAWtrust_Root_CA2_4096.pem Microsec_e-Szigno_Root_CA_2009.pem
Microsoft_ECC_Root_Certificate_Authority_2017.pem
Microsoft_RSA_Root_Certificate_Authority_2017.pem
NAVER_Global_Root_Certification_Authority.pem
NetLock_Arany_Class_Gold.pem OISTE_WISeKey_Global_Root_GA_CA.pem
OISTE_WISeKey_Global_Root_GB_CA.pem
OISTE_WISeKey_Global_Root_GC_CA.pem QuoVadis_Root_CA_1_G3.pem
QuoVadis_Root_CA_2.pem QuoVadis_Root_CA_2_G3.pem
QuoVadis_Root_CA_3.pem QuoVadis_Root_CA_3_G3.pem
SSL.com_Client_ECC_Root_CA_2022.pem
SSL.com_Client_RSA_Root_CA_2022.pem
SSL.com_EV_Root_Certification_Authority_ECC.pem
SSL.com_EV_Root_Certification_Authority_RSA_R2.pem
SSL.com_Root_Certification_Authority_ECC.pem
SSL.com_Root_Certification_Authority_RSA.pem
SSL.com_TLS_ECC_Root_CA_2022.pem SSL.com_TLS_RSA_Root_CA_2022.pem
SZAFIR_ROOT_CA2.pem 

CVS commit: src/external/mpl/mozilla-certdata

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:47:53 UTC 2023

Added Files:
src/external/mpl/mozilla-certdata: Makefile
src/external/mpl/mozilla-certdata/share: Makefile certdata.awk

Log Message:
mozilla-certdata: Makefile infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/mpl/mozilla-certdata/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/mozilla-certdata/share/Makefile \
src/external/mpl/mozilla-certdata/share/certdata.awk

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

Added files:

Index: src/external/mpl/mozilla-certdata/Makefile
diff -u /dev/null src/external/mpl/mozilla-certdata/Makefile:1.1
--- /dev/null	Sat Aug 26 05:47:53 2023
+++ src/external/mpl/mozilla-certdata/Makefile	Sat Aug 26 05:47:53 2023
@@ -0,0 +1,9 @@
+#	$NetBSD: Makefile,v 1.1 2023/08/26 05:47:53 riastradh Exp $
+#
+
+.include 
+
+.if ${MKSHARE} != "no"
+SUBDIR=	share
+.include 
+.endif

Index: src/external/mpl/mozilla-certdata/share/Makefile
diff -u /dev/null src/external/mpl/mozilla-certdata/share/Makefile:1.1
--- /dev/null	Sat Aug 26 05:47:53 2023
+++ src/external/mpl/mozilla-certdata/share/Makefile	Sat Aug 26 05:47:53 2023
@@ -0,0 +1,80 @@
+#	$NetBSD: Makefile,v 1.1 2023/08/26 05:47:53 riastradh Exp $
+#
+
+MOZCERTS=	/usr/share/certs/mozilla
+FILESDIR=	${MOZCERTS}/all
+
+TRUSTDOMAINS=	server email code
+
+# Normally it is a bad idea to use file system globs to list sources in
+# a makefile, but we replace the directory wholesale on regen using the
+# same pattern below.  So in this case, maintaining an explicit list of
+# files would be more error-prone.
+CERTS!=		cd ${.CURDIR:Q} && echo certs/*.pem
+FILES+=		${CERTS}
+
+.for D in ${TRUSTDOMAINS}
+$D_CERTS!=	cat ${.CURDIR:Q}/$D.trust
+.  for C in ${$D_CERTS}
+SYMLINKS+=	${MOZCERTS}/all/$C.pem ${MOZCERTS}/$D/$C.pem
+.  endfor
+.endfor
+
+# The upstream Mozilla certdata.txt lives in the Mozilla nss repository
+# at https://hg.mozilla.org/projects/nss, under
+# lib/ckfw/builtins/certdata.txt.
+#
+# Updates:
+#
+#	1. Go to:
+#	   https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
+#
+#	2. Find the top revision and follow the link to `diff'.
+#
+#	3. For the file lib/ckfw/builtins/certdata.txt, follow the link to
+#	   `file'.
+#
+#	4. Follow the link to `raw'.
+#
+#	5. Record the date of the latest revision and the URL to the
+#	   raw file in the comment below (includes hg revision).
+#
+#	6. Verify that the file matches when downloaded from at least
+#	   three different networks.  (Suggestions: Your home
+#	   residential network, a TNF server, and Tor.)
+#
+#	7. Once you have verified this, commit certdata.txt.
+#
+#	8. Review https://wiki.mozilla.org/CA/Additional_Trust_Changes
+#	   for new special cases and apply to certdata.awk if
+#	   appropriate.
+#
+#	9. After committing certdata.txt and updating certdata.awk, run
+#	   `make regen' and verify that it builds and installs and
+#	   generally looks sensible.
+#
+#	10. Once you have verified that it builds and installs, cvs add
+#	   any new files and cvs rm any deleted files under certs/,
+#	   and commit certs/ and *.trust.
+#
+# Latest revision, from 2023-07-19:
+#
+# https://hg.mozilla.org/projects/nss/raw-file/f479bdba756c78ef9355a48c88744c69fdb4768e/lib/ckfw/builtins/certdata.txt
+#
+regen: .PHONY
+	rm -f certs/*.pem
+	rm -f ${TRUSTDOMAINS:=.trust}
+	mkdir tmp
+	awk -f certdata.awk \
+		-v CERTDIR=certs \
+		-v CODETRUST=code.trust \
+		-v EMAILTRUST=email.trust \
+		-v OPENSSL=openssl \
+		-v SERVERTRUST=server.trust \
+		-v WORKDIR=tmp \
+		<${.CURDIR:Q}/../dist/certdata.txt
+	rm -rf tmp
+
+.include 
+.include 		# XXX
+.include 
Index: src/external/mpl/mozilla-certdata/share/certdata.awk
diff -u /dev/null src/external/mpl/mozilla-certdata/share/certdata.awk:1.1
--- /dev/null	Sat Aug 26 05:47:53 2023
+++ src/external/mpl/mozilla-certdata/share/certdata.awk	Sat Aug 26 05:47:53 2023
@@ -0,0 +1,582 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 2023 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, 

CVS commit: src/external/mpl/mozilla-certdata

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:47:53 UTC 2023

Added Files:
src/external/mpl/mozilla-certdata: Makefile
src/external/mpl/mozilla-certdata/share: Makefile certdata.awk

Log Message:
mozilla-certdata: Makefile infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/mpl/mozilla-certdata/Makefile
cvs rdiff -u -r0 -r1.1 src/external/mpl/mozilla-certdata/share/Makefile \
src/external/mpl/mozilla-certdata/share/certdata.awk

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



CVS commit: src/doc

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:47:05 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
mozilla-certdata: Record in doc/3RDPARTY.


To generate a diff of this commit:
cvs rdiff -u -r1.1948 -r1.1949 src/doc/3RDPARTY

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.1948 src/doc/3RDPARTY:1.1949
--- src/doc/3RDPARTY:1.1948	Fri Aug 25 06:45:54 2023
+++ src/doc/3RDPARTY	Sat Aug 26 05:47:05 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1948 2023/08/25 06:45:54 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1949 2023/08/26 05:47:05 riastradh Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2321,3 +2321,20 @@ Responsible:	fcambus
 License:	BSD (2-clause)
 Location:	share/wscons/fonts
 Notes:
+
+Package:	mozilla-certdata
+Version:	2023-07-19 (f479bdba756c78ef9355a48c88744c69fdb4768e)
+Current Vers:	2023-07-19 (f479bdba756c78ef9355a48c88744c69fdb4768e)
+Maintainer:	Mozilla
+Archive Site:	https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
+Home Page:	https://wiki.mozilla.org/CA
+Date:		2023-08-16
+Mailing List:	
+License:	MPL
+Responsible:	riastradh, security-team
+Location:	external/mpl/mozilla-certdata
+Vendor tag:	MOZILLA-CERTDATA
+Release tag:	mozilla-certdata-MMDD
+Notes:
+See external/mpl/mozilla-certdata/share/Makefile for update
+instructions.



CVS commit: src/doc

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:47:05 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
mozilla-certdata: Record in doc/3RDPARTY.


To generate a diff of this commit:
cvs rdiff -u -r1.1948 -r1.1949 src/doc/3RDPARTY

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



CVS import: src/external/mpl/mozilla-certdata/dist

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:39:17 UTC 2023

Update of /cvsroot/src/external/mpl/mozilla-certdata/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv23828

Log Message:
mozilla-certdata: Import Mozilla certdata.txt.

This is the collection of root CA certificates used by Mozilla for
Firefox and others.

nss hg date: 2023-07-19
nss hg revision: f479bdba756c78ef9355a48c88744c69fdb4768e


Status:

Vendor Tag: MOZILLA-CERTDATA
Release Tags:   mozilla-certdata-20230719

N src/external/mpl/mozilla-certdata/dist/certdata.txt

No conflicts created by this import



CVS import: src/external/mpl/mozilla-certdata/dist

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:39:17 UTC 2023

Update of /cvsroot/src/external/mpl/mozilla-certdata/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv23828

Log Message:
mozilla-certdata: Import Mozilla certdata.txt.

This is the collection of root CA certificates used by Mozilla for
Firefox and others.

nss hg date: 2023-07-19
nss hg revision: f479bdba756c78ef9355a48c88744c69fdb4768e


Status:

Vendor Tag: MOZILLA-CERTDATA
Release Tags:   mozilla-certdata-20230719

N src/external/mpl/mozilla-certdata/dist/certdata.txt

No conflicts created by this import



CVS import: src/external/mpl/mozilla-certdata/dist

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:37:09 UTC 2023

Update of /cvsroot/src/external/mpl/mozilla-certdata/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv11676

Log Message:
mozilla-certdata: Import Mozilla certdata.txt.

This is the collection of root CA certificates used by Mozilla for
Firefox and others.

nss hg date: 2023-07-19
nss hg revision: f479bdba756c78ef9355a48c88744c69fdb4768e


Status:

Vendor Tag: MOZILLA-CERTDATA
Release Tags:   mozilla-certdata-20230719

N 
src/external/mpl/mozilla-certdata/dist/src/external/mpl/mozilla-certdata/dist/certdata.txt

No conflicts created by this import



CVS import: src/external/mpl/mozilla-certdata/dist

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:37:09 UTC 2023

Update of /cvsroot/src/external/mpl/mozilla-certdata/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv11676

Log Message:
mozilla-certdata: Import Mozilla certdata.txt.

This is the collection of root CA certificates used by Mozilla for
Firefox and others.

nss hg date: 2023-07-19
nss hg revision: f479bdba756c78ef9355a48c88744c69fdb4768e


Status:

Vendor Tag: MOZILLA-CERTDATA
Release Tags:   mozilla-certdata-20230719

N 
src/external/mpl/mozilla-certdata/dist/src/external/mpl/mozilla-certdata/dist/certdata.txt

No conflicts created by this import



CVS commit: src

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:27:15 UTC 2023

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/tests: mi
src/etc: Makefile
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
src/usr.sbin: Makefile
Added Files:
src/tests/usr.sbin/certctl: Makefile Makefile.inc t_certctl.sh
src/tests/usr.sbin/certctl/certs1: DigiCert_Global_Root_CA.pem
Explicitly_Distrust_DigiNotar_Root_CA.pem Makefile
src/tests/usr.sbin/certctl/certs2: GTS_Root_R1.pem
GlobalSign_Root_CA_-_R3.pem Makefile
src/tests/usr.sbin/certctl/certs3:
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
Makefile
src/tests/usr.sbin/certctl/certs4: AC_RAIZ_FNMT-RCM.pem
DigiCert_Global_Root_CA.pem Makefile
src/usr.sbin/certctl: Makefile certctl.8 certctl.sh certs.conf

Log Message:
certctl(8): New tool for managing OpenSSL CA certificates.

Same command-line syntax as FreeBSD, clearer semantics about which
parts are config and which parts are cache.


To generate a diff of this commit:
cvs rdiff -u -r1.1325 -r1.1326 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1763 -r1.1764 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.1291 -r1.1292 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.466 -r1.467 src/etc/Makefile
cvs rdiff -u -r1.199 -r1.200 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/Makefile \
src/tests/usr.sbin/certctl/Makefile.inc \
src/tests/usr.sbin/certctl/t_certctl.sh
cvs rdiff -u -r0 -r1.1 \
src/tests/usr.sbin/certctl/certs1/DigiCert_Global_Root_CA.pem \
src/tests/usr.sbin/certctl/certs1/Explicitly_Distrust_DigiNotar_Root_CA.pem 
\
src/tests/usr.sbin/certctl/certs1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/certs2/GTS_Root_R1.pem \
src/tests/usr.sbin/certctl/certs2/GlobalSign_Root_CA_-_R3.pem \
src/tests/usr.sbin/certctl/certs2/Makefile
cvs rdiff -u -r0 -r1.1 \

src/tests/usr.sbin/certctl/certs3/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem
 \

src/tests/usr.sbin/certctl/certs3/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
 \
src/tests/usr.sbin/certctl/certs3/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/certs4/AC_RAIZ_FNMT-RCM.pem \
src/tests/usr.sbin/certctl/certs4/DigiCert_Global_Root_CA.pem \
src/tests/usr.sbin/certctl/certs4/Makefile
cvs rdiff -u -r1.291 -r1.292 src/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/certctl/Makefile \
src/usr.sbin/certctl/certctl.8 src/usr.sbin/certctl/certctl.sh \
src/usr.sbin/certctl/certs.conf

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/mi
diff -u src/distrib/sets/lists/base/mi:1.1325 src/distrib/sets/lists/base/mi:1.1326
--- src/distrib/sets/lists/base/mi:1.1325	Tue Aug  1 06:35:55 2023
+++ src/distrib/sets/lists/base/mi	Sat Aug 26 05:27:13 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1325 2023/08/01 06:35:55 mrg Exp $
+# $NetBSD: mi,v 1.1326 2023/08/26 05:27:13 riastradh Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -114,6 +114,7 @@
 ./etc/openldap	base-ldap-root
 ./etc/openssl	base-crypto-root
 ./etc/openssl/certsbase-crypto-root
+./etc/openssl/certs.conf			base-sysutil-bin
 ./etc/openssl/miscbase-crypto-root
 ./etc/openssl/privatebase-crypto-root
 ./etc/pam.d	base-sys-root
@@ -1457,6 +1458,7 @@
 ./usr/sbin/btpandbase-sysutil-bin
 ./usr/sbin/btuartdbase-obsolete		obsolete
 ./usr/sbin/catmanbase-man-bin
+./usr/sbin/certctlbase-sysutil-bin
 ./usr/sbin/chat	base-ppp-bin
 ./usr/sbin/chownbase-sysutil-bin
 ./usr/sbin/chrootbase-sysutil-bin

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1763 src/distrib/sets/lists/man/mi:1.1764
--- src/distrib/sets/lists/man/mi:1.1763	Fri Aug 11 23:04:29 2023
+++ src/distrib/sets/lists/man/mi	Sat Aug 26 05:27:13 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1763 2023/08/11 23:04:29 christos Exp $
+# $NetBSD: mi,v 1.1764 2023/08/26 05:27:13 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2648,6 +2648,7 @@
 ./usr/share/man/cat8/ccdconfig.0		man-sysutil-catman	.cat
 ./usr/share/man/cat8/cesfic/MAKEDEV.0		man-obsolete		obsolete
 ./usr/share/man/cat8/cesfic/makedev.0		man-obsolete		obsolete
+./usr/share/man/cat8/certctl.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/cgdconfig.0		man-sysutil-catman	.cat
 ./usr/share/man/cat8/chat.0			man-ppp-catman		.cat
 ./usr/share/man/cat8/chown.0			

CVS commit: src

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:27:15 UTC 2023

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/tests: mi
src/etc: Makefile
src/etc/mtree: NetBSD.dist.tests
src/tests/usr.sbin: Makefile
src/usr.sbin: Makefile
Added Files:
src/tests/usr.sbin/certctl: Makefile Makefile.inc t_certctl.sh
src/tests/usr.sbin/certctl/certs1: DigiCert_Global_Root_CA.pem
Explicitly_Distrust_DigiNotar_Root_CA.pem Makefile
src/tests/usr.sbin/certctl/certs2: GTS_Root_R1.pem
GlobalSign_Root_CA_-_R3.pem Makefile
src/tests/usr.sbin/certctl/certs3:
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem
Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
Makefile
src/tests/usr.sbin/certctl/certs4: AC_RAIZ_FNMT-RCM.pem
DigiCert_Global_Root_CA.pem Makefile
src/usr.sbin/certctl: Makefile certctl.8 certctl.sh certs.conf

Log Message:
certctl(8): New tool for managing OpenSSL CA certificates.

Same command-line syntax as FreeBSD, clearer semantics about which
parts are config and which parts are cache.


To generate a diff of this commit:
cvs rdiff -u -r1.1325 -r1.1326 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1763 -r1.1764 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.1291 -r1.1292 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.466 -r1.467 src/etc/Makefile
cvs rdiff -u -r1.199 -r1.200 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/Makefile \
src/tests/usr.sbin/certctl/Makefile.inc \
src/tests/usr.sbin/certctl/t_certctl.sh
cvs rdiff -u -r0 -r1.1 \
src/tests/usr.sbin/certctl/certs1/DigiCert_Global_Root_CA.pem \
src/tests/usr.sbin/certctl/certs1/Explicitly_Distrust_DigiNotar_Root_CA.pem 
\
src/tests/usr.sbin/certctl/certs1/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/certs2/GTS_Root_R1.pem \
src/tests/usr.sbin/certctl/certs2/GlobalSign_Root_CA_-_R3.pem \
src/tests/usr.sbin/certctl/certs2/Makefile
cvs rdiff -u -r0 -r1.1 \

src/tests/usr.sbin/certctl/certs3/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.1.pem
 \

src/tests/usr.sbin/certctl/certs3/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
 \
src/tests/usr.sbin/certctl/certs3/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/certctl/certs4/AC_RAIZ_FNMT-RCM.pem \
src/tests/usr.sbin/certctl/certs4/DigiCert_Global_Root_CA.pem \
src/tests/usr.sbin/certctl/certs4/Makefile
cvs rdiff -u -r1.291 -r1.292 src/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/certctl/Makefile \
src/usr.sbin/certctl/certctl.8 src/usr.sbin/certctl/certctl.sh \
src/usr.sbin/certctl/certs.conf

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



CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:22:50 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h ext2fs_alloc.c ext2fs_bmap.c
ext2fs_bswap.c ext2fs_extents.h ext2fs_extern.h ext2fs_htree.c
ext2fs_inode.c ext2fs_lookup.c ext2fs_rename.c ext2fs_vfsops.c
ext2fs_vnops.c

Log Message:
ext2fs: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.53 -r1.54 src/sys/ufs/ext2fs/ext2fs_alloc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/ufs/ext2fs/ext2fs_bmap.c
cvs rdiff -u -r1.24 -r1.25 src/sys/ufs/ext2fs/ext2fs_bswap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/ext2fs/ext2fs_extents.h
cvs rdiff -u -r1.56 -r1.57 src/sys/ufs/ext2fs/ext2fs_extern.h
cvs rdiff -u -r1.10 -r1.11 src/sys/ufs/ext2fs/ext2fs_htree.c
cvs rdiff -u -r1.90 -r1.91 src/sys/ufs/ext2fs/ext2fs_inode.c
cvs rdiff -u -r1.93 -r1.94 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/ext2fs/ext2fs_rename.c
cvs rdiff -u -r1.222 -r1.223 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.137 -r1.138 src/sys/ufs/ext2fs/ext2fs_vnops.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/ufs/ext2fs/ext2fs.h
diff -u src/sys/ufs/ext2fs/ext2fs.h:1.50 src/sys/ufs/ext2fs/ext2fs.h:1.51
--- src/sys/ufs/ext2fs/ext2fs.h:1.50	Sat Aug 26 05:18:17 2023
+++ src/sys/ufs/ext2fs/ext2fs.h	Sat Aug 26 05:22:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.h,v 1.50 2023/08/26 05:18:17 riastradh Exp $	*/
+/*	$NetBSD: ext2fs.h,v 1.51 2023/08/26 05:22:50 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -177,7 +177,7 @@ struct ext2fs {
 	uint8_t   e2fs_prealloc;	/* # of blocks to preallocate */
 	uint8_t   e2fs_dir_prealloc;	/* # of blocks to preallocate for dir */
 	uint16_t  e2fs_reserved_ngdb;	/* # of reserved gd blocks for resize */
-	
+
 	/* Additional fields */
 	char  e3fs_journal_uuid[16];/* uuid of journal superblock */
 	uint32_t  e3fs_journal_inum;	/* inode number of journal file */
@@ -356,7 +356,7 @@ struct m_ext2fs {
  * - EXT2F_ROCOMPAT_SPARSESUPER
  *superblock backups stored only in cg_has_sb(bno) groups
  * - EXT2F_ROCOMPAT_LARGEFILE
- *use e2di_size_high in struct ext2fs_dinode to store 
+ *use e2di_size_high in struct ext2fs_dinode to store
  *upper 32bit of size for >2GB files
  * - EXT2F_INCOMPAT_FTYPE
  *store file type to e2d_type in struct ext2fs_direct
@@ -424,7 +424,7 @@ struct ext2_gd {
 	uint16_t ext2bgd_ndirs;		/* number of directories */
 
 	/*
-	 * Following only valid when either GDT_CSUM (AKA uninit_bg) 
+	 * Following only valid when either GDT_CSUM (AKA uninit_bg)
 	 * or METADATA_CKSUM feature is on
 	 */
 	uint16_t ext2bgd_flags;		/* ext4 bg flags (INODE_UNINIT, ...)*/
@@ -450,7 +450,7 @@ struct ext2_gd {
 
 #define E2FS_HAS_GD_CSUM(fs) \
 	EXT2F_HAS_ROCOMPAT_FEATURE(fs, EXT2F_ROCOMPAT_GDT_CSUM|EXT2F_ROCOMPAT_METADATA_CKSUM) != 0
-	
+
 /*
  * If the EXT2F_ROCOMPAT_SPARSESUPER flag is set, the cylinder group has a
  * copy of the super and cylinder group descriptors blocks only if it's

Index: src/sys/ufs/ext2fs/ext2fs_alloc.c
diff -u src/sys/ufs/ext2fs/ext2fs_alloc.c:1.53 src/sys/ufs/ext2fs/ext2fs_alloc.c:1.54
--- src/sys/ufs/ext2fs/ext2fs_alloc.c:1.53	Fri Aug 25 16:50:23 2023
+++ src/sys/ufs/ext2fs/ext2fs_alloc.c	Sat Aug 26 05:22:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_alloc.c,v 1.53 2023/08/25 16:50:23 christos Exp $	*/
+/*	$NetBSD: ext2fs_alloc.c,v 1.54 2023/08/26 05:22:50 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.53 2023/08/25 16:50:23 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.54 2023/08/26 05:22:50 riastradh Exp $");
 
 #include 
 #include 
@@ -667,7 +667,7 @@ ext2fs_cg_update(struct m_ext2fs *fs, in
 	if (nifree) {
 		uint32_t ext2bgd_nifree = fs2h16(gd->ext2bgd_nifree) |
 		(fs2h16(gd->ext2bgd_nifree_hi) << 16);
-		ext2bgd_nifree += nifree; 
+		ext2bgd_nifree += nifree;
 		gd->ext2bgd_nifree = h2fs16(ext2bgd_nifree);
 		gd->ext2bgd_nifree_hi = h2fs16(ext2bgd_nifree >> 16);
 		/*
@@ -696,7 +696,6 @@ ext2fs_cg_update(struct m_ext2fs *fs, in
 		ext2bgd_nbfree += nbfree;
 		gd->ext2bgd_nbfree = h2fs16(ext2bgd_nbfree);
 		gd->ext2bgd_nbfree_hi = h2fs16(ext2bgd_nbfree >> 16);
-		
 	}
 
 	if (ndirs) {
@@ -821,7 +820,7 @@ ext2fs_cg_verify_and_initialize(struct v
 (int)fs->e2fs_bsize, 0, 0);
 clrbuf(bp);
 			}
-	
+
 			bdwrite(bp);
 		}
 

Index: src/sys/ufs/ext2fs/ext2fs_bmap.c
diff -u src/sys/ufs/ext2fs/ext2fs_bmap.c:1.30 src/sys/ufs/ext2fs/ext2fs_bmap.c:1.31
--- src/sys/ufs/ext2fs/ext2fs_bmap.c:1.30	Sun Aug 14 11:26:35 2016
+++ src/sys/ufs/ext2fs/ext2fs_bmap.c	Sat Aug 26 05:22:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_bmap.c,v 1.30 2016/08/14 11:26:35 jdolecek Exp $	*/
+/*	$NetBSD: ext2fs_bmap.c,v 1.31 

CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:22:50 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h ext2fs_alloc.c ext2fs_bmap.c
ext2fs_bswap.c ext2fs_extents.h ext2fs_extern.h ext2fs_htree.c
ext2fs_inode.c ext2fs_lookup.c ext2fs_rename.c ext2fs_vfsops.c
ext2fs_vnops.c

Log Message:
ext2fs: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.53 -r1.54 src/sys/ufs/ext2fs/ext2fs_alloc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/ufs/ext2fs/ext2fs_bmap.c
cvs rdiff -u -r1.24 -r1.25 src/sys/ufs/ext2fs/ext2fs_bswap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/ufs/ext2fs/ext2fs_extents.h
cvs rdiff -u -r1.56 -r1.57 src/sys/ufs/ext2fs/ext2fs_extern.h
cvs rdiff -u -r1.10 -r1.11 src/sys/ufs/ext2fs/ext2fs_htree.c
cvs rdiff -u -r1.90 -r1.91 src/sys/ufs/ext2fs/ext2fs_inode.c
cvs rdiff -u -r1.93 -r1.94 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/ext2fs/ext2fs_rename.c
cvs rdiff -u -r1.222 -r1.223 src/sys/ufs/ext2fs/ext2fs_vfsops.c
cvs rdiff -u -r1.137 -r1.138 src/sys/ufs/ext2fs/ext2fs_vnops.c

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



CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:18:17 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h

Log Message:
ext2fs.h: Restore e2fs_cgload/cgsave for libsa and userland use.

Stop-gap until they can be taught to handle the new version that was
moved to ext2fs_vfsops.c, presumably.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/ufs/ext2fs/ext2fs.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/ufs/ext2fs/ext2fs.h
diff -u src/sys/ufs/ext2fs/ext2fs.h:1.49 src/sys/ufs/ext2fs/ext2fs.h:1.50
--- src/sys/ufs/ext2fs/ext2fs.h:1.49	Fri Aug 25 16:50:23 2023
+++ src/sys/ufs/ext2fs/ext2fs.h	Sat Aug 26 05:18:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.h,v 1.49 2023/08/25 16:50:23 christos Exp $	*/
+/*	$NetBSD: ext2fs.h,v 1.50 2023/08/26 05:18:17 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -498,6 +498,12 @@ void e2fs_sb_bswap(struct ext2fs *, stru
 #	define e2fs_sbsave(old, new) e2fs_sb_bswap((old), (new))
 #endif
 
+#ifndef _KERNEL		/* XXX */
+/* Group descriptors are not byte swapped */
+#define e2fs_cgload(old, new, size) memcpy((new), (old), (size))
+#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size))
+#endif
+
 /*
  * Turn file system block numbers into disk block addresses.
  * This maps file system blocks to device size blocks.



CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Aug 26 05:18:17 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h

Log Message:
ext2fs.h: Restore e2fs_cgload/cgsave for libsa and userland use.

Stop-gap until they can be taught to handle the new version that was
moved to ext2fs_vfsops.c, presumably.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/ufs/ext2fs/ext2fs.h

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



Re: CVS commit: src/sys/net

2023-08-25 Thread David H. Gutteridge

Module Name:src
Committed By:   rin
Date:   Wed Aug 23 13:21:17 UTC 2023

Modified Files:
   src/sys/net: bpf.h

Log Message:
bpf: Fix SIZEOF_BPF_HDR (for LP64 userland) on mips64

It cannot fit within 18 bytes, of course ;)

As we had never provided working bpf(4) implementation for LP64
userland on mips, just use natural structure size here.


Thanks for fixing this. This means dhcpcd now works on Octeon hardware
using the n64 userland. Previously, it would fail with "ps_bpf_recvbpf:
Resource temporarily unavailable". (Perhaps you'd noticed this?) This
was reported a while ago[1] by an end user on port-mips@, so we should
presumably pull this up.

Where you say "we had never provided working bpf(4) implementation", I
had been looking into the dhcpcd issue myself, but hadn't thought to
look here. That is, I had run the tests under net/bpf and net/t_ip_reass
(the latter modified to open /dev/bpf directly, not via rump) on my
ERL3, and these all passed, giving me the impression we did indeed have
a working bpf(4) implementation on n64. Since we didn't, it seems we
need more test coverage here.

Thanks,

Dave

1. http://mail-index.netbsd.org/port-mips/2021/07/04/msg001112.html


Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Theodore Preduta
On 2023-08-25 13:30, Taylor R Campbell wrote:
> Since VOP_READDIR requires vp to be locked, I can infer that the
> handle_write caller must already hold vp locked.  But that means that
> we have ifd_lock -> vnode lock in one path, and vnode lock -> ifd_lock
> in another path, which is forbidden (unless there's some reason we can
> prove these paths never happen concurrently).

Hmm... I did not realize this, so I don't think NOTE_WRITE
disambiguation is (or has ever been) safe.

The real pain here is that we inherit a held vp_interlock and vnode lock
in the needs_lock=false case from the kevent callback.  So this may
require a pretty substantial locking revision(?)

Anyways, I'll take a closer look later this weekend.

> I'm also suspicious of logic like this:
> 
> mutex_enter(>f_lock);
> uio.uio_offset = fp->f_offset;
> mutex_exit(>f_lock);
> ...
> mutex_enter(>f_lock);
> fp->f_offset = uio.uio_offset;
> mutex_exit(>f_lock);
> 
> If fp->f_offset can change concurrently while f_lock is released, this
> looks like a problem.  But if it can't, why do we need the lock at
> all?  I suspect this really does need a lock over the whole
> transaction (maybe fp->f_lock, maybe something else), which is not
> released while I/O is happening -- possibly not with mutex(9) but
> something interruptible instead.

I think you're right about needing a lock for the whole transaction.
Since this is called from get_inotify_dir_entries(), perhaps it would be
better for get_inotify_dir_entries() to keep track of the offset and
pass it in instead?

Theo(dore)



Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Date: Fri, 25 Aug 2023 13:38:02 -0400
> From: Theodore Preduta 
> 
> On 2023-08-25 13:13, Taylor R Campbell wrote:
> > This can't be right, and it's a little unsettling that the problem
> > isn't caught by any automatic tests.
> > 
> > As I understand it, the `ie_name' member is supposed to provide
> > storage for the `ie_event.name' array.
> > 
> > So this looks like this change is going to lead either to a buffer
> > overrun -- reading someone else's heap memory, or scribbling all over
> > someone else's heap memory -- or to uninitialized or zero-filled
> > memory being published to userland where there should be a pathname.
> 
> I don't think so.  Notice that in inotify_read() two calls to uiomove()
> are made, one on ie_event and one on ie_name... and in general this code
> never accesses ie_event.name directly.
> 
> The reason I separated the fields in the first place was to make
> allocation/deallocation simpler, not to use ie_name as storage for
> ie_event.name.

Got it!  So that would explain why automatic tests didn't catch
anything.  Thanks!  Maybe we should have a comment about this to
clarify for future readers.

Side note: I realize there's a KASSERT protecting one of the strcpy
calls, and the other one is limited to copying from values of struct
dirent::d_name created by VOP_READDIR which should be limited to
NAME_MAX (plus NUL terminator).  But I'd be a little more comfortable
if we didn't use strcpy at all -- strlcpy is probably the right choice
here.  Might prefer to set buf->ie_event.len to MIN(strlen(name) + 1,
sizeof(buf->ie_name)) too, so that non-DIAGNOSTIC builds will truncate
the data rather than overrun the buffer.


Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Theodore Preduta
On 2023-08-25 13:13, Taylor R Campbell wrote:
>> Module Name:src
>> Committed By:   christos
>> Date:   Wed Aug 23 19:17:59 UTC 2023
>>
>> Modified Files:
>> src/sys/compat/linux/common: linux_inotify.c
>>
>> Log Message:
>> put variable length structure at the end, so that clang does not complain.
>>
>>  struct inotify_entry {
>> TAILQ_ENTRY(inotify_entry)  ie_entries;
>> +   charie_name[NAME_MAX + 1];
>> struct linux_inotify_event  ie_event;
>> -   charie_name[NAME_MAX+1];
>>  };
> 
> This can't be right, and it's a little unsettling that the problem
> isn't caught by any automatic tests.
> 
> As I understand it, the `ie_name' member is supposed to provide
> storage for the `ie_event.name' array.
> 
> So this looks like this change is going to lead either to a buffer
> overrun -- reading someone else's heap memory, or scribbling all over
> someone else's heap memory -- or to uninitialized or zero-filled
> memory being published to userland where there should be a pathname.

I don't think so.  Notice that in inotify_read() two calls to uiomove()
are made, one on ie_event and one on ie_name... and in general this code
never accesses ie_event.name directly.

The reason I separated the fields in the first place was to make
allocation/deallocation simpler, not to use ie_name as storage for
ie_event.name.

Theo(dore)



Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Module Name:src
> Committed By:   christos
> Date:   Thu Aug 24 19:51:24 UTC 2023
> 
> Modified Files:
> src/sys/compat/linux/common: linux_inotify.c
> 
> Log Message:
> fix a locking bug (Theodore Preduta)
> 
> if (needs_lock)
> vn_lock(vp, LK_SHARED | LK_RETRY);
> +   else
> +   /*
> +* XXX We need to temprarily drop v_interlock because
> +* it may be temporarily acquired by biowait().
> +*/
> +   mutex_exit(vp->v_interlock);
> +   KASSERT(!mutex_owned(vp->v_interlock));
> error = VOP_READDIR(vp, , fp->f_cred, , NULL, NULL);
> if (needs_lock)
> VOP_UNLOCK(vp);
> +   else
> +   mutex_enter(vp->v_interlock);

This looks questionable.

1. Why is v_interlock held in the first place?

2. Why is it safe to release v_interlock here, if the caller holds it?

3. What is the lock order for all the locks involved?

I see that inotify_readdir via get_inotify_dir_entries has two call
sites, leading to the following lock orders:

- linux_sys_inotify_add_watch
  -> mutex_enter(>ifd_lock)
  -> get_inotify_dir_entries(..., needs_lock=true)
 -> inotify_readdir(..., needs_lock=true)
-> vn_lock(vp)
-> VOP_READDIR(vp)

- handle_write
  -> mutex_enter(>ifd_lock)
  -> get_inotify_dir_entries(..., needs_lock=false)
 -> inotify_readdir(..., needs_lock=true)
-> mutex_exit(vp->v_interlock)
-> VOP_READDIR(vp)

Since VOP_READDIR requires vp to be locked, I can infer that the
handle_write caller must already hold vp locked.  But that means that
we have ifd_lock -> vnode lock in one path, and vnode lock -> ifd_lock
in another path, which is forbidden (unless there's some reason we can
prove these paths never happen concurrently).

I'm also suspicious of logic like this:

mutex_enter(>f_lock);
uio.uio_offset = fp->f_offset;
mutex_exit(>f_lock);
...
mutex_enter(>f_lock);
fp->f_offset = uio.uio_offset;
mutex_exit(>f_lock);

If fp->f_offset can change concurrently while f_lock is released, this
looks like a problem.  But if it can't, why do we need the lock at
all?  I suspect this really does need a lock over the whole
transaction (maybe fp->f_lock, maybe something else), which is not
released while I/O is happening -- possibly not with mutex(9) but
something interruptible instead.


Re: CVS commit: src/sys/compat/linux/common

2023-08-25 Thread Taylor R Campbell
> Module Name:src
> Committed By:   christos
> Date:   Wed Aug 23 19:17:59 UTC 2023
> 
> Modified Files:
> src/sys/compat/linux/common: linux_inotify.c
> 
> Log Message:
> put variable length structure at the end, so that clang does not complain.
> 
>  struct inotify_entry {
> TAILQ_ENTRY(inotify_entry)  ie_entries;
> +   charie_name[NAME_MAX + 1];
> struct linux_inotify_event  ie_event;
> -   charie_name[NAME_MAX+1];
>  };

This can't be right, and it's a little unsettling that the problem
isn't caught by any automatic tests.

As I understand it, the `ie_name' member is supposed to provide
storage for the `ie_event.name' array.

So this looks like this change is going to lead either to a buffer
overrun -- reading someone else's heap memory, or scribbling all over
someone else's heap memory -- or to uninitialized or zero-filled
memory being published to userland where there should be a pathname.

We need to do this in a different way.  (It's annoying that C doesn't
formally allow the original code, since in principle it is sensible.)
Perhaps we can delete the struct inotify_entry::ie_name member, and
instead of using

struct inotify_event *ie = kmem_zalloc(sizeof(*ie), ...);

do

struct inotify_event *ie = kmem_zalloc(
offsetof(struct inotify_event, ie_event.name[NAME_MAX + 1]),
...);

and similarly for kmem_free.


CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 25 16:50:23 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h ext2fs_alloc.c ext2fs_vfsops.c

Log Message:
Support INCOMPAT_64BIT on ext4 (Vladimir 'phcoder' Serbinenko)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.52 -r1.53 src/sys/ufs/ext2fs/ext2fs_alloc.c
cvs rdiff -u -r1.221 -r1.222 src/sys/ufs/ext2fs/ext2fs_vfsops.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/ufs/ext2fs/ext2fs.h
diff -u src/sys/ufs/ext2fs/ext2fs.h:1.48 src/sys/ufs/ext2fs/ext2fs.h:1.49
--- src/sys/ufs/ext2fs/ext2fs.h:1.48	Sat Aug 20 15:47:44 2016
+++ src/sys/ufs/ext2fs/ext2fs.h	Fri Aug 25 12:50:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.h,v 1.48 2016/08/20 19:47:44 jdolecek Exp $	*/
+/*	$NetBSD: ext2fs.h,v 1.49 2023/08/25 16:50:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -252,6 +252,7 @@ struct m_ext2fs {
 	int32_t	e2fs_ngdb;	/* number of group descriptor blocks */
 	int32_t	e2fs_ipb;	/* number of inodes per block */
 	int32_t	e2fs_itpg;	/* number of inode table blocks per group */
+	uint8_t e2fs_group_desc_shift; /* binary log group desc size */
 	struct	ext2_gd *e2fs_gd; /* group descriptors (data not byteswapped) */
 };
 
@@ -370,7 +371,8 @@ struct m_ext2fs {
 	 | EXT2F_ROCOMPAT_GDT_CSUM)
 #define EXT2F_INCOMPAT_SUPP		(EXT2F_INCOMPAT_FTYPE \
 	 | EXT2F_INCOMPAT_EXTENTS \
-	 | EXT2F_INCOMPAT_FLEX_BG)
+	 | EXT2F_INCOMPAT_FLEX_BG \
+	 | EXT2F_INCOMPAT_64BIT)
 
 /*
  * Feature set definitions
@@ -432,10 +434,14 @@ struct ext2_gd {
 	uint16_t ext2bgd_itable_unused_lo;	/* Low unused inode offset */
 	uint16_t ext2bgd_checksum;		/* Group desc checksum */
 
-	/*
-	 * XXX disk32 Further fields only exist if 64BIT feature is on
-	 * and superblock desc_size > 32, not supported for now.
-	 */
+	uint32_t ext2bgd_b_bitmap_hi;	/* blocks bitmap block (high bits) */
+	uint32_t ext2bgd_i_bitmap_hi;	/* inodes bitmap block (high bits) */
+	uint32_t ext2bgd_i_tables_hi;	/* inodes table block (high bits)  */
+	uint16_t ext2bgd_nbfree_hi;	/* number of free blocks (high bits) */
+	uint16_t ext2bgd_nifree_hi;	/* number of free inodes (high bits) */
+	uint16_t ext2bgd_ndirs_hi;	/* number of directories (high bits) */
+	uint16_t reserved_hi;
+	uint32_t reserved2_hi[3];
 };
 
 #define E2FS_BG_INODE_UNINIT	0x0001	/* Inode bitmap not used/initialized */
@@ -492,15 +498,15 @@ void e2fs_sb_bswap(struct ext2fs *, stru
 #	define e2fs_sbsave(old, new) e2fs_sb_bswap((old), (new))
 #endif
 
-/* Group descriptors are not byte swapped */
-#define e2fs_cgload(old, new, size) memcpy((new), (old), (size))
-#define e2fs_cgsave(old, new, size) memcpy((new), (old), (size))
-
 /*
  * Turn file system block numbers into disk block addresses.
  * This maps file system blocks to device size blocks.
  */
 #define EXT2_FSBTODB(fs, b)	((b) << (fs)->e2fs_fsbtodb)
+#define EXT2_FSBTODB64(fs, b, b_hi) \
+(uint64_t)(b_hi)) << 32) | (b)) << (fs)->e2fs_fsbtodb)
+#define EXT2_FSBTODB64OFF(fs, b, b_hi, off) \
+((uint64_t)(b_hi)) << 32) | (b)) + (off)) << (fs)->e2fs_fsbtodb)
 #define EXT2_DBTOFSB(fs, b)	((b) >> (fs)->e2fs_fsbtodb)
 
 /*
@@ -510,9 +516,11 @@ void e2fs_sb_bswap(struct ext2fs *, stru
  *	 inode number to file system block address.
  */
 #define	ino_to_cg(fs, x)	(((x) - 1) / (fs)->e2fs.e2fs_ipg)
-#define	ino_to_fsba(fs, x)		\
-	(fs2h32((fs)->e2fs_gd[ino_to_cg((fs), (x))].ext2bgd_i_tables) +	\
-	(((x) - 1) % (fs)->e2fs.e2fs_ipg) / (fs)->e2fs_ipb)
+#define _e2fs_gd(fs, x) (fs)->e2fs_gd[ino_to_cg((fs), (x))]
+#define	ino_to_fsba(fs, x) \
+(fs2h32(_e2fs_gd(fs, x).ext2bgd_i_tables) + \
+ (((uint64_t)fs2h32(_e2fs_gd(fs, x).ext2bgd_i_tables_hi)) << 32) + \
+ (((x) - 1) % (fs)->e2fs.e2fs_ipg) / (fs)->e2fs_ipb)
 #define	ino_to_fsbo(fs, x)	(((x) - 1) % (fs)->e2fs_ipb)
 
 /*

Index: src/sys/ufs/ext2fs/ext2fs_alloc.c
diff -u src/sys/ufs/ext2fs/ext2fs_alloc.c:1.52 src/sys/ufs/ext2fs/ext2fs_alloc.c:1.53
--- src/sys/ufs/ext2fs/ext2fs_alloc.c:1.52	Sun May 28 12:38:55 2017
+++ src/sys/ufs/ext2fs/ext2fs_alloc.c	Fri Aug 25 12:50:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_alloc.c,v 1.52 2017/05/28 16:38:55 hannken Exp $	*/
+/*	$NetBSD: ext2fs_alloc.c,v 1.53 2023/08/25 16:50:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.52 2017/05/28 16:38:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_alloc.c,v 1.53 2023/08/25 16:50:23 christos Exp $");
 
 #include 
 #include 
@@ -90,9 +90,11 @@ static u_long	ext2fs_hashalloc(struct in
 		daddr_t (*)(struct inode *, int, daddr_t, int));
 static daddr_t	ext2fs_nodealloccg(struct inode *, int, daddr_t, int);
 static daddr_t	ext2fs_mapsearch(struct m_ext2fs *, char *, daddr_t);
-static __inline void	ext2fs_cg_update(struct m_ext2fs *, 

CVS commit: src/sys/ufs/ext2fs

2023-08-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 25 16:50:23 UTC 2023

Modified Files:
src/sys/ufs/ext2fs: ext2fs.h ext2fs_alloc.c ext2fs_vfsops.c

Log Message:
Support INCOMPAT_64BIT on ext4 (Vladimir 'phcoder' Serbinenko)


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/ufs/ext2fs/ext2fs.h
cvs rdiff -u -r1.52 -r1.53 src/sys/ufs/ext2fs/ext2fs_alloc.c
cvs rdiff -u -r1.221 -r1.222 src/sys/ufs/ext2fs/ext2fs_vfsops.c

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



CVS commit: src/sys/dev/pci

2023-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 25 09:38:51 UTC 2023

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Fix #ifdef WM_DEBUG code in wm_gmii_i82544_{read,write}reg_locked.


To generate a diff of this commit:
cvs rdiff -u -r1.783 -r1.784 src/sys/dev/pci/if_wm.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/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.783 src/sys/dev/pci/if_wm.c:1.784
--- src/sys/dev/pci/if_wm.c:1.783	Fri Aug 25 08:14:14 2023
+++ src/sys/dev/pci/if_wm.c	Fri Aug 25 09:38:50 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.783 2023/08/25 08:14:14 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.784 2023/08/25 09:38:50 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.783 2023/08/25 08:14:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.784 2023/08/25 09:38:50 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -12184,23 +12184,25 @@ wm_gmii_i82544_readreg_locked(device_t d
 	struct wm_softc *sc = device_private(dev);
 	int rv;
 
-	if (reg > BME1000_MAX_MULTI_PAGE_REG) {
-		switch (sc->sc_phytype) {
-		case WMPHY_IGP:
-		case WMPHY_IGP_2:
-		case WMPHY_IGP_3:
+	switch (sc->sc_phytype) {
+	case WMPHY_IGP:
+	case WMPHY_IGP_2:
+	case WMPHY_IGP_3:
+		if (reg > BME1000_MAX_MULTI_PAGE_REG) {
 			rv = wm_gmii_mdic_writereg(dev, phy,
 			IGPHY_PAGE_SELECT, reg);
 			if (rv != 0)
 return rv;
-			break;
-		default:
+		}
+		break;
+	default:
 #ifdef WM_DEBUG
-			device_printf(dev, "%s: PHYTYPE = 0x%x, addr = %02x\n",
+		if ((reg >> MII_ADDRBITS) != 0)
+			device_printf(dev,
+			"%s: PHYTYPE = 0x%x, addr = 0x%02x\n",
 			__func__, sc->sc_phytype, reg);
 #endif
-			break;
-		}
+		break;
 	}
 
 	return wm_gmii_mdic_readreg(dev, phy, reg & MII_ADDRMASK, val);
@@ -12235,23 +12237,25 @@ wm_gmii_i82544_writereg_locked(device_t 
 	struct wm_softc *sc = device_private(dev);
 	int rv;
 
-	if (reg > BME1000_MAX_MULTI_PAGE_REG) {
-		switch (sc->sc_phytype) {
-		case WMPHY_IGP:
-		case WMPHY_IGP_2:
-		case WMPHY_IGP_3:
+	switch (sc->sc_phytype) {
+	case WMPHY_IGP:
+	case WMPHY_IGP_2:
+	case WMPHY_IGP_3:
+		if (reg > BME1000_MAX_MULTI_PAGE_REG) {
 			rv = wm_gmii_mdic_writereg(dev, phy,
 			IGPHY_PAGE_SELECT, reg);
 			if (rv != 0)
 return rv;
-			break;
-		default:
+		}
+		break;
+	default:
 #ifdef WM_DEBUG
-			device_printf(dev, "%s: PHYTYPE == 0x%x, addr = %02x",
+		if ((reg >> MII_ADDRBITS) != 0)
+			device_printf(dev,
+			"%s: PHYTYPE == 0x%x, addr = 0x%02x",
 			__func__, sc->sc_phytype, reg);
 #endif
-			break;
-		}
+		break;
 	}
 
 	return wm_gmii_mdic_writereg(dev, phy, reg & MII_ADDRMASK, val);



CVS commit: src/sys/dev/pci

2023-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 25 09:38:51 UTC 2023

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Fix #ifdef WM_DEBUG code in wm_gmii_i82544_{read,write}reg_locked.


To generate a diff of this commit:
cvs rdiff -u -r1.783 -r1.784 src/sys/dev/pci/if_wm.c

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



CVS commit: src/sys/dev/pci

2023-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 25 08:14:14 UTC 2023

Modified Files:
src/sys/dev/pci: if_wm.c if_wmvar.h

Log Message:
Delay sending LINK_STATE_UP to prevent dropping packets on I35[04] and I21[01].

 Some (not all) systems use I35[04] or I21[01] don't send packet soon
after linkup. The MAC send a packet to the PHY and any error is not
observed. This behavior causes a problem that gratuitous ARP and/or
IPv6 DAD packet are silently dropped. To avoid this problem, don't
call mii_pollstat() here which will send LINK_STATE_UP notification
to the upper layer. Instead, mii_pollstat() will be called in
wm_gmii_mediastatus() or mii_tick() will be called in wm_tick().

Note that the similar workaround is in Linux's igb driver though it's
only for I21[01].

OK'd by hikaru@ and knakahara@.


To generate a diff of this commit:
cvs rdiff -u -r1.782 -r1.783 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_wmvar.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/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.782 src/sys/dev/pci/if_wm.c:1.783
--- src/sys/dev/pci/if_wm.c:1.782	Fri Jun 23 05:36:28 2023
+++ src/sys/dev/pci/if_wm.c	Fri Aug 25 08:14:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.782 2023/06/23 05:36:28 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.783 2023/08/25 08:14:14 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.782 2023/06/23 05:36:28 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.783 2023/08/25 08:14:14 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_wm.h"
@@ -537,7 +537,7 @@ struct wm_softc {
 #define	WM_MEDIATYPE_COPPER		0x02
 #define	WM_MEDIATYPE_SERDES		0x03 /* Internal SERDES */
 	int sc_funcid;			/* unit number of the chip (0 to 3) */
-	int sc_flags;			/* flags; see below */
+	u_int sc_flags;			/* flags; see below */
 	u_short sc_if_flags;		/* last if_flags */
 	int sc_ec_capenable;		/* last ec_capenable */
 	int sc_flowflags;		/* 802.3x flow control flags */
@@ -709,6 +709,7 @@ struct wm_softc {
 	int sc_tbi_linkup;		/* TBI link status */
 	int sc_tbi_serdes_anegticks;	/* autonegotiation ticks */
 	int sc_tbi_serdes_ticks;	/* tbi ticks */
+	struct timeval sc_linkup_delay_time; /* delay LINK_STATE_UP */
 
 	int sc_mchash_type;		/* multicast filter offset */
 
@@ -3084,6 +3085,23 @@ alloc_retry:
 	|| (sc->sc_type == WM_T_I210) || (sc->sc_type == WM_T_I211))
 		sc->sc_flags |= WM_F_CRC_STRIP;
 
+	/*
+	 * Workaround for some chips to delay sending LINK_STATE_UP.
+	 * Some systems can't send packet soon after linkup. See also
+	 * wm_linkintr_gmii(), wm_tick() and wm_gmii_mediastatus().
+	 */
+	switch (sc->sc_type) {
+	case WM_T_I350:
+	case WM_T_I354:
+	case WM_T_I210:
+	case WM_T_I211:
+		if (sc->sc_mediatype == WM_MEDIATYPE_COPPER)
+			sc->sc_flags |= WM_F_DELAY_LINKUP;
+		break;
+	default:
+		break;
+	}
+
 	/* Set device properties (macflags) */
 	prop_dictionary_set_uint32(dict, "macflags", sc->sc_flags);
 
@@ -3901,9 +3919,29 @@ wm_tick(void *arg)
 
 	wm_update_stats(sc);
 
-	if (sc->sc_flags & WM_F_HAS_MII)
-		mii_tick(>sc_mii);
-	else if ((sc->sc_type >= WM_T_82575) && (sc->sc_type <= WM_T_I211)
+	if (sc->sc_flags & WM_F_HAS_MII) {
+		bool dotick = true;
+
+		/*
+		 * Workaround for some chips to delay sending LINK_STATE_UP.
+		 * See also wm_linkintr_gmii() and wm_gmii_mediastatus().
+		 */
+		if ((sc->sc_flags & WM_F_DELAY_LINKUP) != 0) {
+			struct timeval now;
+
+			getmicrotime();
+			if (timercmp(, >sc_linkup_delay_time, <))
+dotick = false;
+			else if (sc->sc_linkup_delay_time.tv_sec != 0) {
+/* Simplify by checking tv_sec only. */
+
+sc->sc_linkup_delay_time.tv_sec = 0;
+sc->sc_linkup_delay_time.tv_usec = 0;
+			}
+		}
+		if (dotick)
+			mii_tick(>sc_mii);
+	} else if ((sc->sc_type >= WM_T_82575) && (sc->sc_type <= WM_T_I211)
 	&& (sc->sc_mediatype == WM_MEDIATYPE_SERDES))
 		wm_serdes_tick(sc);
 	else
@@ -10278,6 +10316,7 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
 	device_t dev = sc->sc_dev;
 	uint32_t status, reg;
 	bool link;
+	bool dopoll = true;
 	int rv;
 
 	KASSERT(mutex_owned(sc->sc_core_lock));
@@ -10324,7 +10363,46 @@ wm_linkintr_gmii(struct wm_softc *sc, ui
 
 	DPRINTF(sc, WM_DEBUG_LINK, ("%s: LINK: LSC -> mii_pollstat\n",
 		device_xname(dev)));
-	mii_pollstat(>sc_mii);
+	if ((sc->sc_flags & WM_F_DELAY_LINKUP) != 0) {
+		if (link) {
+			/*
+			 * To workaround the problem, it's required to wait
+			 * several hundred miliseconds. The time depend
+			 * on the environment. Wait 1 second for the safety.
+			 */
+			dopoll = false;
+			getmicrotime(>sc_linkup_delay_time);
+			sc->sc_linkup_delay_time.tv_sec += 1;
+		} else if (sc->sc_linkup_delay_time.tv_sec != 0) {
+			/*
+			 * Simplify by checking tv_sec only. It's enough.
+			 *
+			 * Currently, it's 

CVS commit: src/sys/dev/pci

2023-08-25 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 25 08:14:14 UTC 2023

Modified Files:
src/sys/dev/pci: if_wm.c if_wmvar.h

Log Message:
Delay sending LINK_STATE_UP to prevent dropping packets on I35[04] and I21[01].

 Some (not all) systems use I35[04] or I21[01] don't send packet soon
after linkup. The MAC send a packet to the PHY and any error is not
observed. This behavior causes a problem that gratuitous ARP and/or
IPv6 DAD packet are silently dropped. To avoid this problem, don't
call mii_pollstat() here which will send LINK_STATE_UP notification
to the upper layer. Instead, mii_pollstat() will be called in
wm_gmii_mediastatus() or mii_tick() will be called in wm_tick().

Note that the similar workaround is in Linux's igb driver though it's
only for I21[01].

OK'd by hikaru@ and knakahara@.


To generate a diff of this commit:
cvs rdiff -u -r1.782 -r1.783 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pci/if_wmvar.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

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 25 08:05:19 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: genfb_machdep.c
src/sys/arch/xen/include/amd64: vmparam.h
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
xen: Provide definitions or ifdefs to make drm build in XEN3_DOM0.

No idea if it works, but it builds now.

PR port-xen/49330


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/amd64/vmparam.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/x86/xen_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

2023-08-25 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Aug 25 08:05:19 UTC 2023

Modified Files:
src/sys/arch/x86/acpi: acpi_wakeup.c
src/sys/arch/x86/pci: pci_machdep.c
src/sys/arch/x86/x86: genfb_machdep.c
src/sys/arch/xen/include/amd64: vmparam.h
src/sys/arch/xen/x86: xen_pmap.c

Log Message:
xen: Provide definitions or ifdefs to make drm build in XEN3_DOM0.

No idea if it works, but it builds now.

PR port-xen/49330


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/x86/acpi/acpi_wakeup.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/pci/pci_machdep.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/x86/x86/genfb_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/xen/include/amd64/vmparam.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/x86/xen_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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.54 src/sys/arch/x86/acpi/acpi_wakeup.c:1.55
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.54	Tue Jun  1 21:29:24 2021
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.54 2021/06/01 21:29:24 riastradh Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.54 2021/06/01 21:29:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.55 2023/08/25 08:05:18 riastradh Exp $");
 
 #include 
 #include 
@@ -103,6 +103,10 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.
 
 #include "acpi_wakecode.h"
 
+#ifdef XENPV
+#error acpi_wakeup.c (acpi_md_vesa_modenum) users must be adapted for Xen
+#endif
+
 /* Address is also hard-coded in acpi_wakecode.S */
 static paddr_t acpi_wakeup_paddr = 3 * PAGE_SIZE;
 static vaddr_t acpi_wakeup_vaddr;

Index: src/sys/arch/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.94 src/sys/arch/x86/pci/pci_machdep.c:1.95
--- src/sys/arch/x86/pci/pci_machdep.c:1.94	Mon Aug  7 06:23:39 2023
+++ src/sys/arch/x86/pci/pci_machdep.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.94 2023/08/07 06:23:39 msaitoh Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.94 2023/08/07 06:23:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.95 2023/08/25 08:05:18 riastradh Exp $");
 
 #include 
 #include 
@@ -310,7 +310,7 @@ static struct pci_conf_lock cl0 = {
 
 static struct pci_conf_lock * const cl = 
 
-#if NGENFB > 0 && NACPICA > 0 && defined(VGA_POST)
+#if NGENFB > 0 && NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 extern int acpi_md_vbios_reset;
 extern int acpi_md_vesa_modenum;
 #endif
@@ -1060,13 +1060,13 @@ static bool
 x86_genfb_setmode(struct genfb_softc *sc, int newmode)
 {
 #if NGENFB > 0
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	static int curmode = WSDISPLAYIO_MODE_EMUL;
 # endif
 
 	switch (newmode) {
 	case WSDISPLAYIO_MODE_EMUL:
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 		if (curmode != newmode) {
 			if (vga_posth != NULL && acpi_md_vesa_modenum != 0) {
 vga_post_set_vbe(vga_posth,
@@ -1077,7 +1077,7 @@ x86_genfb_setmode(struct genfb_softc *sc
 		break;
 	}
 
-# if NACPICA > 0 && defined(VGA_POST)
+# if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	curmode = newmode;
 # endif
 #endif
@@ -1096,7 +1096,7 @@ x86_genfb_resume(device_t dev, const pmf
 #if NGENFB > 0
 	struct pci_genfb_softc *psc = device_private(dev);
 
-#if NACPICA > 0 && defined(VGA_POST)
+#if NACPICA > 0 && defined(VGA_POST) && !defined(XENPV)
 	if (vga_posth != NULL && acpi_md_vbios_reset == 2) {
 		vga_post_call(vga_posth);
 		if (acpi_md_vesa_modenum != 0)

Index: src/sys/arch/x86/x86/genfb_machdep.c
diff -u src/sys/arch/x86/x86/genfb_machdep.c:1.19 src/sys/arch/x86/x86/genfb_machdep.c:1.20
--- src/sys/arch/x86/x86/genfb_machdep.c:1.19	Tue Sep 13 09:45:36 2022
+++ src/sys/arch/x86/x86/genfb_machdep.c	Fri Aug 25 08:05:18 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_machdep.c,v 1.19 2022/09/13 09:45:36 riastradh Exp $ */
+/* $NetBSD: genfb_machdep.c,v 1.20 2023/08/25 08:05:18 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2009 Jared D. McNeill 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.19 2022/09/13 09:45:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_machdep.c,v 1.20 2023/08/25 08:05:18 riastradh Exp $");
 
 #include 
 #include 
@@ -61,8 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: genfb_machde
 struct vcons_screen x86_genfb_console_screen;
 bool 

CVS commit: src/doc

2023-08-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 25 06:45:55 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
sqlite-3.43 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1947 -r1.1948 src/doc/3RDPARTY

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.1947 src/doc/3RDPARTY:1.1948
--- src/doc/3RDPARTY:1.1947	Thu Aug 24 06:35:57 2023
+++ src/doc/3RDPARTY	Fri Aug 25 06:45:54 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1947 2023/08/24 06:35:57 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1948 2023/08/25 06:45:54 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1325,10 +1325,10 @@ original.
 
 Package:	sqlite
 Version:	3.26.0
-Current Vers:	3.39.3
+Current Vers:	3.43.0
 Maintainer:	Richard Hipp 
 Home Page:	http://www.sqlite.org
-Date: 		2022-09-05
+Date: 		2023-08-24
 Responsible:	joerg
 License:	Public domain
 Location:	external/public-domain/sqlite/dist



CVS commit: src/doc

2023-08-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Aug 25 06:45:55 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
sqlite-3.43 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1947 -r1.1948 src/doc/3RDPARTY

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