CVS commit: src/sys/fs/hfs

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 05:51:34 UTC 2023

Modified Files:
src/sys/fs/hfs: libhfs.c

Log Message:
avoid uninitialised variable usage in early error paths.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/fs/hfs/libhfs.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/fs/hfs/libhfs.c
diff -u src/sys/fs/hfs/libhfs.c:1.18 src/sys/fs/hfs/libhfs.c:1.19
--- src/sys/fs/hfs/libhfs.c:1.18	Mon Jun 19 08:40:30 2023
+++ src/sys/fs/hfs/libhfs.c	Fri Aug 11 05:51:34 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: libhfs.c,v 1.18 2023/06/19 08:40:30 msaitoh Exp $	*/
+/*	$NetBSD: libhfs.c,v 1.19 2023/08/11 05:51:34 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2007 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: libhfs.c,v 1.18 2023/06/19 08:40:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: libhfs.c,v 1.19 2023/08/11 05:51:34 mrg Exp $");
 
 #include "libhfs.h"
 
@@ -545,7 +545,7 @@ hfslib_find_catalog_record_with_key(
 	hfs_catalog_keyed_record_t* out_rec,
 	hfs_callback_args* cbargs)
 {
-	hfs_node_descriptor_t			nd;
+	hfs_node_descriptor_t			nd = { .num_recs = 0 };
 	hfs_extent_descriptor_t*		extents;
 	hfs_catalog_keyed_record_t		lastrec;
 	hfs_catalog_key_t*	curkey;
@@ -585,7 +585,6 @@ hfslib_find_catalog_record_with_key(
 	if (numextents == 0)
 		HFS_LIBERR("could not locate fork extents");
 
-	nd.num_recs = 0;
 	curnode = in_vol->chr.root_node;
 
 #ifdef DLO_DEBUG
@@ -687,7 +686,7 @@ hfslib_find_extent_record_with_key(hfs_v
 	hfs_extent_record_t* out_rec,
 	hfs_callback_args* cbargs)
 {
-	hfs_node_descriptor_t		nd;
+	hfs_node_descriptor_t		nd = { .num_recs = 0 };
 	hfs_extent_descriptor_t*	extents;
 	hfs_extent_record_t		lastrec;
 	hfs_extent_key_t	curkey;
@@ -922,7 +921,7 @@ hfslib_get_directory_contents(
 	uint32_t* out_numchildren,
 	hfs_callback_args* cbargs)
 {
-	hfs_node_descriptor_t			nd;
+	hfs_node_descriptor_t			nd = { .num_recs = 0 };
 	hfs_extent_descriptor_t*		extents;
 	hfs_catalog_keyed_record_t		currec;
 	hfs_catalog_key_t	curkey;



CVS commit: src/sys/fs/hfs

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 05:51:34 UTC 2023

Modified Files:
src/sys/fs/hfs: libhfs.c

Log Message:
avoid uninitialised variable usage in early error paths.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/fs/hfs/libhfs.c

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



CVS commit: src/external/gpl3/gcc

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 05:34:36 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
the sh3 build issue is related to a forced -O0 in strtod.c and PR#55668.

initial tests show it doesn't fail with gcc 10 or 12 (but building with
gcc9 to test there now to be sure.)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/README.gcc12

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

Modified files:

Index: src/external/gpl3/gcc/README.gcc12
diff -u src/external/gpl3/gcc/README.gcc12:1.10 src/external/gpl3/gcc/README.gcc12:1.11
--- src/external/gpl3/gcc/README.gcc12:1.10	Tue Aug  8 06:42:16 2023
+++ src/external/gpl3/gcc/README.gcc12	Fri Aug 11 05:34:36 2023
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc12,v 1.10 2023/08/08 06:42:16 mrg Exp $
+$NetBSD: README.gcc12,v 1.11 2023/08/11 05:34:36 mrg Exp $
 
 
 new stuff:
@@ -81,12 +81,8 @@ architecture	tools	kernels	libgcc	native
  sys/arch/powerpc/oea/pmap.c:2186:2: error: #error PPC_OEA64 not supported
 [8]: destdir.evbsh3/usr/include/ssp/string.h: In function '_int_strtod_l':
  destdir.evbsh3/usr/include/ssp/string.h:82:1: error: inlining failed in call to 'always_inline' '__memcpy_ichk': target specific option mismatch
- 82 | __ssp_bos_icheck3_restrict(memcpy, void *, const void *)
-| ^~
- src/lib/libc/gdtoa/gdtoaimp.h:534:20: note: called from here
- 534 | #define Bcopy(x,y) memcpy(>sign,>sign,y->wds*sizeof(ULong) + 2*sizeof(int))
- src/lib/libc/gdtoa/strtod.c:582:17: note: in expansion of macro 'Bcopy'
- 582 | Bcopy(bd, bd0);
+ this is caused by strtod.c using optimise("O0") conflicting with the always_inline attribute.
+ originally -O0 to fix PR#55668, but may be fixed in gcc10+.
 [10]: libc.so fails to link with weird relocation errors:
   vax--netbsdelf/bin/ld: warning: dynamic relocation to `?' in readonly section `.eh_frame'
 [11]: sanitizers don't build yet.



CVS commit: src/external/gpl3/gcc

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 11 05:34:36 UTC 2023

Modified Files:
src/external/gpl3/gcc: README.gcc12

Log Message:
the sh3 build issue is related to a forced -O0 in strtod.c and PR#55668.

initial tests show it doesn't fail with gcc 10 or 12 (but building with
gcc9 to test there now to be sure.)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gcc/README.gcc12

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



CVS commit: src/usr.bin/make/unit-tests

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 05:01:12 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.mk

Log Message:
tests/make: fix grammar in a test comment


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/unit-tests/cond-func-empty.mk

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



CVS commit: src/usr.bin/make/unit-tests

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 05:01:12 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.mk

Log Message:
tests/make: fix grammar in a test comment


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/unit-tests/cond-func-empty.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/cond-func-empty.mk
diff -u src/usr.bin/make/unit-tests/cond-func-empty.mk:1.21 src/usr.bin/make/unit-tests/cond-func-empty.mk:1.22
--- src/usr.bin/make/unit-tests/cond-func-empty.mk:1.21	Wed Jun 28 06:15:42 2023
+++ src/usr.bin/make/unit-tests/cond-func-empty.mk	Fri Aug 11 05:01:12 2023
@@ -1,4 +1,4 @@
-# $NetBSD: cond-func-empty.mk,v 1.21 2023/06/28 06:15:42 rillig Exp $
+# $NetBSD: cond-func-empty.mk,v 1.22 2023/08/11 05:01:12 rillig Exp $
 #
 # Tests for the empty() function in .if conditions, which tests a variable
 # expression for emptiness.
@@ -150,7 +150,7 @@ ${:U }=	space
 .  error
 .endif
 
-# There may be spaces at the outside the parentheses.
+# There may be spaces outside the parentheses.
 # Spaces inside the parentheses are interpreted as part of the variable name.
 .if ! empty ( WORD )
 .  error



CVS commit: src/usr.bin/make

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 04:56:31 UTC 2023

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: directive-include-guard.exp
directive-include-guard.mk

Log Message:
make: clean up multiple-inclusion guards

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/usr.bin/make/cond.c
cvs rdiff -u -r1.10 -r1.11 \
src/usr.bin/make/unit-tests/directive-include-guard.exp
cvs rdiff -u -r1.11 -r1.12 \
src/usr.bin/make/unit-tests/directive-include-guard.mk

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.353 src/usr.bin/make/cond.c:1.354
--- src/usr.bin/make/cond.c:1.353	Fri Jun 23 05:21:10 2023
+++ src/usr.bin/make/cond.c	Fri Aug 11 04:56:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -92,7 +92,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.353 2023/06/23 05:21:10 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.354 2023/08/11 04:56:31 rillig Exp $");
 
 /*
  * Conditional expressions conform to this grammar:
@@ -224,17 +224,13 @@ ParseWord(const char **pp, bool doEval)
 		if ((ch == '&' || ch == '|') && paren_depth == 0)
 			break;
 		if (ch == '$') {
-			/*
-			 * Parse the variable expression and install it as
-			 * part of the argument if it's valid. We tell
-			 * Var_Parse to complain on an undefined variable,
-			 * (XXX: but Var_Parse ignores that request)
-			 * so we don't need to do it. Nor do we return an
-			 * error, though perhaps we should.
-			 */
 			VarEvalMode emode = doEval
 			? VARE_UNDEFERR
 			: VARE_PARSE_ONLY;
+			/*
+			 * TODO: make Var_Parse complain about undefined
+			 * variables.
+			 */
 			FStr nestedVal = Var_Parse(, SCOPE_CMDLINE, emode);
 			/* TODO: handle errors */
 			Buf_AddStr(, nestedVal.str);
@@ -1267,7 +1263,6 @@ Cond_ExtractGuard(const char *line)
 {
 	const char *p, *varname;
 	Substring dir;
-	enum GuardKind kind;
 	Guard *guard;
 
 	p = line + 1;		/* skip the '.' */
@@ -1288,10 +1283,9 @@ Cond_ExtractGuard(const char *line)
 			const char *arg_p = p;
 			free(ParseWord(, false));
 			if (strcmp(p, ")") == 0) {
-char *target = ParseWord(_p, true);
 guard = bmake_malloc(sizeof(*guard));
 guard->kind = GK_TARGET;
-guard->name = target;
+guard->name = ParseWord(_p, true);
 return guard;
 			}
 		}
@@ -1302,9 +1296,8 @@ Cond_ExtractGuard(const char *line)
 	return NULL;
 
 found_variable:
-	kind = GK_VARIABLE;
 	guard = bmake_malloc(sizeof(*guard));
-	guard->kind = kind;
+	guard->kind = GK_VARIABLE;
 	guard->name = bmake_strsedup(varname, p);
 	return guard;
 }

Index: src/usr.bin/make/unit-tests/directive-include-guard.exp
diff -u src/usr.bin/make/unit-tests/directive-include-guard.exp:1.10 src/usr.bin/make/unit-tests/directive-include-guard.exp:1.11
--- src/usr.bin/make/unit-tests/directive-include-guard.exp:1.10	Wed Jun 21 21:21:52 2023
+++ src/usr.bin/make/unit-tests/directive-include-guard.exp	Fri Aug 11 04:56:31 2023
@@ -51,14 +51,14 @@ Parse_PushInput: file variable-undef-ins
 Parse_PushInput: file variable-undef-inside.tmp, line 1
 Parse_PushInput: file variable-not-defined.tmp, line 1
 Parse_PushInput: file variable-not-defined.tmp, line 1
-Parse_PushInput: file if-elif.tmp, line 1
-Parse_PushInput: file if-elif.tmp, line 1
-Parse_PushInput: file if-elif-reuse.tmp, line 1
-Parse_PushInput: file if-elif-reuse.tmp, line 1
-Parse_PushInput: file if-else.tmp, line 1
-Parse_PushInput: file if-else.tmp, line 1
-Parse_PushInput: file if-else-reuse.tmp, line 1
-Parse_PushInput: file if-else-reuse.tmp, line 1
+Parse_PushInput: file elif.tmp, line 1
+Parse_PushInput: file elif.tmp, line 1
+Parse_PushInput: file elif-reuse.tmp, line 1
+Parse_PushInput: file elif-reuse.tmp, line 1
+Parse_PushInput: file else.tmp, line 1
+Parse_PushInput: file else.tmp, line 1
+Parse_PushInput: file else-reuse.tmp, line 1
+Parse_PushInput: file else-reuse.tmp, line 1
 Parse_PushInput: file inner-if-elif-else.tmp, line 1
 Skipping 'inner-if-elif-else.tmp' because 'INNER_IF_ELIF_ELSE' is defined
 Parse_PushInput: file target.tmp, line 1

Index: src/usr.bin/make/unit-tests/directive-include-guard.mk
diff -u src/usr.bin/make/unit-tests/directive-include-guard.mk:1.11 src/usr.bin/make/unit-tests/directive-include-guard.mk:1.12
--- src/usr.bin/make/unit-tests/directive-include-guard.mk:1.11	Wed Jun 21 21:21:52 2023
+++ src/usr.bin/make/unit-tests/directive-include-guard.mk	Fri Aug 11 04:56:31 2023
@@ -1,4 +1,4 @@
-# $NetBSD: directive-include-guard.mk,v 1.11 2023/06/21 21:21:52 sjg Exp $
+# $NetBSD: directive-include-guard.mk,v 1.12 2023/08/11 

CVS commit: src/usr.bin/make

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 04:56:31 UTC 2023

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: directive-include-guard.exp
directive-include-guard.mk

Log Message:
make: clean up multiple-inclusion guards

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.353 -r1.354 src/usr.bin/make/cond.c
cvs rdiff -u -r1.10 -r1.11 \
src/usr.bin/make/unit-tests/directive-include-guard.exp
cvs rdiff -u -r1.11 -r1.12 \
src/usr.bin/make/unit-tests/directive-include-guard.mk

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



CVS commit: src/tests/usr.bin/xlint/lint1

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 04:27:49 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: check-expect.lua msg_255.c

Log Message:
tests/lint: test parsing of preprocessing directives


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_255.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/usr.bin/xlint/lint1/check-expect.lua
diff -u src/tests/usr.bin/xlint/lint1/check-expect.lua:1.7 src/tests/usr.bin/xlint/lint1/check-expect.lua:1.8
--- src/tests/usr.bin/xlint/lint1/check-expect.lua:1.7	Sat Jul  8 11:03:00 2023
+++ src/tests/usr.bin/xlint/lint1/check-expect.lua	Fri Aug 11 04:27:49 2023
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.7 2023/07/08 11:03:00 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.8 2023/08/11 04:27:49 rillig Exp $
 
 --[[
 
@@ -62,7 +62,7 @@ end
 --
 -- example return values:
 --   {
--- ["file.c(18)"] = {"invalid argument 'a'", "invalid argument 'b'"},
+-- ["file.c(18)"] = {"syntax error 'a' [249]", "syntax error 'b' [249]"},
 -- ["file.c(23)"] = {"not a constant expression [123]"},
 --   },
 --   { "file.c(18)", "file.c(23)" }
@@ -132,7 +132,7 @@ local function load_exp(exp_fname)
 
   local messages = {}
   for exp_lineno, line in ipairs(lines) do
-for location, message in line:gmatch("(%S+%(%d+%)): (.+)$") do
+for location, message in line:gmatch("(.+%(%d+%)): (.+)$") do
   table.insert(messages, {
 exp_lineno = exp_lineno,
 location = location,

Index: src/tests/usr.bin/xlint/lint1/msg_255.c
diff -u src/tests/usr.bin/xlint/lint1/msg_255.c:1.5 src/tests/usr.bin/xlint/lint1/msg_255.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_255.c:1.5	Sun Jul  9 11:01:27 2023
+++ src/tests/usr.bin/xlint/lint1/msg_255.c	Fri Aug 11 04:27:49 2023
@@ -1,13 +1,45 @@
-/*	$NetBSD: msg_255.c,v 1.5 2023/07/09 11:01:27 rillig Exp $	*/
+/*	$NetBSD: msg_255.c,v 1.6 2023/08/11 04:27:49 rillig Exp $	*/
 # 3 "msg_255.c"
 
 // Test for message: undefined or invalid '#' directive [255]
 
 /* lint1-extra-flags: -X 351 */
 
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+#
+
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+#pragma
+
 #pragma once
 
 /* expect+1: warning: undefined or invalid '#' directive [255] */
 #fatal_error
 
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+#ident "obsolete"
+
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+#1
+
+// Sets the line number of the current file.
+# 2
+
+// Switch back to the main file.
+# 30 "msg_255.c"
+
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+# 3/
+
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+# 4 /
+
+/* expect+1: warning: undefined or invalid '#' directive [255] */
+# 5 "unfinished
+
+// An empty string means standard input; tabs may be used for spacing.
+#	6	""
+
+# 44 "msg_255.c"
+
 int dummy;



CVS commit: src/tests/usr.bin/xlint/lint1

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 04:27:49 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: check-expect.lua msg_255.c

Log Message:
tests/lint: test parsing of preprocessing directives


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_255.c

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



CVS commit: src/usr.bin/base64

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 02:49:28 UTC 2023

Modified Files:
src/usr.bin/base64: base64.c

Log Message:
base64: fix double fclose

Input errors are currently not reported, therefore no user-visible
change.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/base64/base64.c

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

Modified files:

Index: src/usr.bin/base64/base64.c
diff -u src/usr.bin/base64/base64.c:1.6 src/usr.bin/base64/base64.c:1.7
--- src/usr.bin/base64/base64.c:1.6	Fri Aug 11 02:43:59 2023
+++ src/usr.bin/base64/base64.c	Fri Aug 11 02:49:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: base64.c,v 1.6 2023/08/11 02:43:59 rillig Exp $	*/
+/*	$NetBSD: base64.c,v 1.7 2023/08/11 02:49:28 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: base64.c,v 1.6 2023/08/11 02:43:59 rillig Exp $");
+__RCSID("$NetBSD: base64.c,v 1.7 2023/08/11 02:49:28 rillig Exp $");
 
 #include 
 #include 
@@ -274,7 +274,6 @@ main(int argc, char *argv[])
 		doit(stdout, fp, decode, ignore, wrap);
 		if (fp != stdin)
 			fclose(fp);
-		fclose(fp);
 	}
 
 	return EXIT_SUCCESS;



CVS commit: src/usr.bin/base64

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 02:49:28 UTC 2023

Modified Files:
src/usr.bin/base64: base64.c

Log Message:
base64: fix double fclose

Input errors are currently not reported, therefore no user-visible
change.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/base64/base64.c

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



CVS commit: src/usr.bin/base64

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 02:43:59 UTC 2023

Modified Files:
src/usr.bin/base64: Makefile base64.c

Log Message:
base64: nix trailing whitespace and redundant braces, strict bool mode

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/base64/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/base64/base64.c

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

Modified files:

Index: src/usr.bin/base64/Makefile
diff -u src/usr.bin/base64/Makefile:1.1 src/usr.bin/base64/Makefile:1.2
--- src/usr.bin/base64/Makefile:1.1	Tue Jul 24 15:26:16 2018
+++ src/usr.bin/base64/Makefile	Fri Aug 11 02:43:59 2023
@@ -1,9 +1,7 @@
-#	$NetBSD: Makefile,v 1.1 2018/07/24 15:26:16 christos Exp $
-
-WARNS?= 6	
-
-.include 
+#	$NetBSD: Makefile,v 1.2 2023/08/11 02:43:59 rillig Exp $
 
 PROG=		base64
+WARNS?=		6		# instead of 5 from usr.bin
+LINTFLAGS+=	-T		# strict bool mode
 
 .include 

Index: src/usr.bin/base64/base64.c
diff -u src/usr.bin/base64/base64.c:1.5 src/usr.bin/base64/base64.c:1.6
--- src/usr.bin/base64/base64.c:1.5	Fri Aug 27 17:53:13 2021
+++ src/usr.bin/base64/base64.c	Fri Aug 11 02:43:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: base64.c,v 1.5 2021/08/27 17:53:13 christos Exp $	*/
+/*	$NetBSD: base64.c,v 1.6 2023/08/11 02:43:59 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: base64.c,v 1.5 2021/08/27 17:53:13 christos Exp $");
+__RCSID("$NetBSD: base64.c,v 1.6 2023/08/11 02:43:59 rillig Exp $");
 
 #include 
 #include 
@@ -65,9 +65,8 @@ putoutput(FILE *fout, uint8_t out[4], si
 	size_t i;
 
 	for (i = 0; i < len + 1; i++) {
-		if (out[i] >= 64) {
+		if (out[i] >= 64)
 			return EINVAL;
-		}
 		if (fputc(B64[out[i]], fout) == -1)
 			return errno;
 		if (++(*pos) == wrap) {
@@ -119,13 +118,12 @@ b64_encode(FILE *fout, FILE *fin, size_t
 			return e;
 	}
 
-	if (pos && wrap) {
+	if (pos != 0 && wrap != 0) {
 		if (fputc('\n', fout) == -1)
 			return errno;
 	}
 	return 0;
 }
-		
 
 static int
 b64_decode(FILE *fout, FILE *fin, bool ignore)
@@ -152,7 +150,7 @@ b64_decode(FILE *fout, FILE *fin, bool i
 
 		switch (state) {
 		case 0:
-			out = (uint8_t)(b << 2); 
+			out = (uint8_t)(b << 2);
 			break;
 		case 1:
 			out |= b >> 4;
@@ -212,7 +210,7 @@ b64_decode(FILE *fout, FILE *fin, bool i
 	return 0;
 }
 
-static __dead void 
+static __dead void
 usage(void)
 {
 	fprintf(stderr, "Usage: %s [-di] [-w ] []...\n",



CVS commit: src/usr.bin/base64

2023-08-10 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Aug 11 02:43:59 UTC 2023

Modified Files:
src/usr.bin/base64: Makefile base64.c

Log Message:
base64: nix trailing whitespace and redundant braces, strict bool mode

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/base64/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/base64/base64.c

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



CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 22:45:58 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64eb: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64eb: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64el: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64eb/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64el/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/mipsn64eb: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/mipsn64el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/mipsn64el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/mipsn64el: defs.mk

Log Message:
add mipsn64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfdver.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/config.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/defs.mk \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfdver.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/config.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/defs.mk \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mipsn64eb/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mipsn64el/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64eb/gstdint.h
cvs rdiff -u -r1.1 -r1.2 \

CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 22:45:58 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64eb: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64eb: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/mipsn64el: config.h defs.mk
init.c jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64eb/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mipsn64el/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/mipsn64el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/mipsn64eb: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/mipsn64el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/mipsn64el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64eb/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mipsn64el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/mipsn64eb: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/mipsn64el: defs.mk

Log Message:
add mipsn64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/backtrace-supported.h 
\
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mipsn64el/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/bfdver.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/config.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/defs.mk \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64eb/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/bfdver.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/config.h \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/defs.mk \
src/external/gpl3/gdb/lib/libbfd/arch/mipsn64el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mipsn64eb/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mipsn64el/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libdecnumber/arch/mipsn64eb/gstdint.h
cvs rdiff -u -r1.1 -r1.2 \

CVS commit: src/tests/rump/kernspace

2023-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 22:20:20 UTC 2023

Modified Files:
src/tests/rump/kernspace: workqueue.c

Log Message:
workqueue(9) tests: Fix mistake in rev. 1.9.

Somehow, despite manually verifying a build/install/test of every
revision in my patch series, I managed to commit the wrong version of
the file for what became rev. 1.9, so the test was just broken when
it went in and remained broken in the commit where I fixed the real
bug and removed the xfail marker on the test.

PR kern/5757

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/rump/kernspace/workqueue.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/rump/kernspace/workqueue.c
diff -u src/tests/rump/kernspace/workqueue.c:1.9 src/tests/rump/kernspace/workqueue.c:1.10
--- src/tests/rump/kernspace/workqueue.c:1.9	Wed Aug  9 08:23:02 2023
+++ src/tests/rump/kernspace/workqueue.c	Thu Aug 10 22:20:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: workqueue.c,v 1.9 2023/08/09 08:23:02 riastradh Exp $	*/
+/*	$NetBSD: workqueue.c,v 1.10 2023/08/10 22:20:20 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 
 #include 
 #if !defined(lint)
-__RCSID("$NetBSD: workqueue.c,v 1.9 2023/08/09 08:23:02 riastradh Exp $");
+__RCSID("$NetBSD: workqueue.c,v 1.10 2023/08/10 22:20:20 riastradh Exp $");
 #endif /* !lint */
 
 #include 
@@ -162,10 +162,11 @@ rumptest_workqueue_wait_pause(void)
 		workqueue_enqueue(sc->wq, >wk, NULL);
 		kpause("tstwk2", /*intr*/false, /*timo*/1, /*lock*/NULL);
 		workqueue_wait(sc->wq, >wk);
-		KASSERT(sc->counter == (i + 1));
+		workqueue_wait(sc->wq, );
+		KASSERT(sc->counter == (i + 2));
 	}
 
-	KASSERT(sc->counter == ITERATIONS);
+	KASSERT(sc->counter == 2*ITERATIONS);
 
 	/* Wait for a work that is not enqueued. Just return immediately. */
 	workqueue_wait(sc->wq, );



CVS commit: src/tests/rump/kernspace

2023-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 22:20:20 UTC 2023

Modified Files:
src/tests/rump/kernspace: workqueue.c

Log Message:
workqueue(9) tests: Fix mistake in rev. 1.9.

Somehow, despite manually verifying a build/install/test of every
revision in my patch series, I managed to commit the wrong version of
the file for what became rev. 1.9, so the test was just broken when
it went in and remained broken in the commit where I fixed the real
bug and removed the xfail marker on the test.

PR kern/5757

XXX pullup-10
XXX pullup-9
XXX pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/rump/kernspace/workqueue.c

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



CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 21:35:17 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/mips64el: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/mips64eb: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/mips64el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/mips64el: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64eb/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64el/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/mips64eb: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/mips64el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/mips64el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/mips64el: defs.mk

Log Message:
add mips64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfd.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/config.h
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/defs.mk
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/targmatch.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfd.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/config.h
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/defs.mk
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mips64eb/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mips64el/defs.mk
cvs rdiff -u -r1.10 

CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 21:35:17 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/mips64el: bfd-in3.h bfd.h
bfdver.h config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libctf/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/mips64eb: gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/mips64el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/mips64el: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64eb/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/mips64el/gdbsupport:
config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import:
alloca.h ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h
limits.h locale.h math.h signal.h stdint.h stdio.h stdlib.h
string.h time.h unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/mips64el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/mips64eb: config.h
src/external/gpl3/gdb/lib/libopcodes/arch/mips64el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/mips64el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64eb/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/mips64el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/mips64eb: defs.mk
src/external/gpl3/gdb/lib/libsframe/arch/mips64el: defs.mk

Log Message:
add mips64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/mips64el/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfd.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/config.h
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/defs.mk
cvs rdiff -u -r1.15 -r1.16 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64eb/targmatch.h
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfd.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/config.h
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/defs.mk
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gdb/lib/libbfd/arch/mips64el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mips64eb/defs.mk
cvs rdiff -u -r1.1 -r1.2 \
src/external/gpl3/gdb/lib/libctf/arch/mips64el/defs.mk
cvs rdiff -u -r1.10 

CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 20:51:05 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/sh3el: defs.mk

Log Message:
Add dreamcast


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/defs.mk
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/glob-libc.gl.h
cvs rdiff -u -r0 -r1.1 \

src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/malloc/scratch_buffer.gl.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/lib/libsframe/arch/sh3el/defs.mk

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



CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 20:51:05 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/sh3el: defs.mk

Log Message:
Add dreamcast


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/sh3el/defs.mk
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/glob-libc.gl.h
cvs rdiff -u -r0 -r1.1 \

src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import/malloc/scratch_buffer.gl.h
cvs rdiff -u -r0 -r1.1 src/external/gpl3/gdb/lib/libsframe/arch/sh3el/defs.mk

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

Modified files:

Index: src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk
diff -u src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk:1.17 src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk:1.18
--- src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk:1.17	Sun Jun 26 01:48:12 2022
+++ src/external/gpl3/gdb/lib/libgdb/arch/mips64eb/defs.mk	Thu Aug 10 16:51:04 2023
@@ -1,7 +1,4 @@
 # This file is automatically generated.  DO NOT EDIT!
-# Generated from: NetBSD: mknative-gdb,v 1.15 2020/12/05 21:27:31 christos Exp 
+# Generated from: NetBSD: mknative-gdb,v 1.16 2023/07/31 17:09:59 christos Exp 
 # Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp 
 #
-G_INTERNAL_CFLAGS=   -I. -I${GNUHOSTDIST}/gdb -I${GNUHOSTDIST}/gdb/config -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I${GNUHOSTDIST}/gdb/../include/opcode -I${GNUHOSTDIST}/gdb/../readline/readline/.. -I${GNUHOSTDIST}/gdb/../zlib -I../bfd -I${GNUHOSTDIST}/gdb/../bfd -I${GNUHOSTDIST}/gdb/../include -I../libdecnumber -I${GNUHOSTDIST}/gdb/../libdecnumber -I./../intl -I${GNUHOSTDIST}/gdb/../gnulib/import -I../gnulib/import -I${GNUHOSTDIST}/gdb/.. -I..  -DTUI=1-I${GNUHOSTDIST}/gdb/.. -pthread  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations -Wstrict-null-sentinel -Wformat -Wformat-nonliteral -Werror
-G_LIBGDB_OBS=ada-exp.o ada-lang.o ada-tasks.o ada-typeprint.o ada-valprint.o ada-varobj.o addrmap.o agent.o alloc.o annotate.o arch-utils.o async-event.o auto-load.o auxv.o ax-gdb.o ax-general.o bcache.o bfd-target.o block.o blockframe.o break-catch-sig.o break-catch-syscall.o break-catch-throw.o breakpoint.o bsd-kvm.o btrace.o build-id.o buildsym-legacy.o buildsym.o c-exp.o c-lang.o c-typeprint.o c-valprint.o c-varobj.o charset.o cli-out.o cli-cmds.o cli-decode.o cli-dump.o cli-interp.o cli-logging.o cli-option.o cli-script.o cli-setshow.o cli-style.o cli-utils.o coff-pe-read.o coffread.o compile-c-support.o compile-c-symbols.o compile-c-types.o compile-cplus-symbols.o compile-cplus-types.o compile-loc2c.o compile-object-load.o compile-object-run.o compile.o complaints.o completer.o continuations.o copying.o corefile.o corelow.o cp-abi.o cp-name-parser.o cp-namespace.o cp-support.o cp-valprint.o ctfread.o d-exp.o d-lang.o d-namespace.o d-valprint.o dbxread.o dcache.o debug.o debugi
 nfod-support.o dictionary.o disasm-selftests.o disasm.o dtrace-probe.o dummy-frame.o abbrev.o attribute.o comp-unit.o dwz.o expr.o frame-tailcall.o frame.o index-cache.o index-common.o index-write.o leb.o line-header.o loc.o macro.o read.o section.o stringify.o elfread.o eval.o event-top.o exceptions.o exec.o expprint.o extension.o f-exp.o f-lang.o f-typeprint.o f-valprint.o filename-seen-cache.o filesystem.o findcmd.o findvar.o fork-child.o frame-base.o frame-unwind.o frame.o gcore.o gdb-demangle.o gdb_bfd.o gdb_obstack.o gdb_regex.o gdbarch-selftests.o gdbarch.o gdbtypes.o gnu-v2-abi.o gnu-v3-abi.o go-exp.o go-lang.o go-typeprint.o go-valprint.o guile.o inf-child.o inf-loop.o inf-ptrace.o infcall.o infcmd.o inferior.o inflow.o infrun.o inline-frame.o interps.o jit.o language.o linespec.o location.o m2-exp.o m2-lang.o m2-typeprint.o m2-valprint.o macrocmd.o macroexp.o macroscope.o macrotab.o main.o maint-test-options.o maint-test-settings.o 

CVS commit: src

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:49:20 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c
src/sys/dev/ieee1394: fwohci.c
src/sys/ufs/ext2fs: ext2fs_lookup.c
src/sys/ufs/ufs: ufs_lookup.c
src/usr.sbin/fwctl: fwdv.c

Log Message:
don't assign struct pointers to smaller then structure regions of memory.

in all cases here, the later parts of the structure are not actually
accessed, so there are no existing bugs here beyond general UB.  for the
ufs ones, this also removes some casts.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/acpi/wmi/wmi_acpi.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/ieee1394/fwohci.c
cvs rdiff -u -r1.92 -r1.93 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.157 -r1.158 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fwctl/fwdv.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/acpi/wmi/wmi_acpi.c
diff -u src/sys/dev/acpi/wmi/wmi_acpi.c:1.21 src/sys/dev/acpi/wmi/wmi_acpi.c:1.22
--- src/sys/dev/acpi/wmi/wmi_acpi.c:1.21	Wed May 10 00:08:22 2023
+++ src/sys/dev/acpi/wmi/wmi_acpi.c	Thu Aug 10 20:49:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $	*/
+/*	$NetBSD: wmi_acpi.c,v 1.22 2023/08/10 20:49:19 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.21 2023/05/10 00:08:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmi_acpi.c,v 1.22 2023/08/10 20:49:19 mrg Exp $");
 
 #include 
 #include 
@@ -321,7 +321,7 @@ acpi_wmi_guid_get(struct acpi_wmi_softc 
 {
 	struct wmi_t *wmi;
 	struct guid_t *guid;
-	char bin[16];
+	char bin[MAX(16, sizeof(*guid))];
 	char hex[3];
 	const char *ptr;
 	uint8_t i;

Index: src/sys/dev/ieee1394/fwohci.c
diff -u src/sys/dev/ieee1394/fwohci.c:1.151 src/sys/dev/ieee1394/fwohci.c:1.152
--- src/sys/dev/ieee1394/fwohci.c:1.151	Sun Jul  3 19:58:42 2022
+++ src/sys/dev/ieee1394/fwohci.c	Thu Aug 10 20:49:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci.c,v 1.151 2022/07/03 19:58:42 andvar Exp $	*/
+/*	$NetBSD: fwohci.c,v 1.152 2023/08/10 20:49:20 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.151 2022/07/03 19:58:42 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci.c,v 1.152 2023/08/10 20:49:20 mrg Exp $");
 
 #include 
 #include 
@@ -2643,17 +2643,20 @@ static int
 fwohci_arcv_swap(struct fw_pkt *fp, int len)
 {
 	struct fw_pkt *fp0;
-	uint32_t ld0;
+	union {
+		uint32_t ld0;
+		struct fw_pkt pkt;
+	} pktu;
 	int hlen;
 #if BYTE_ORDER == BIG_ENDIAN
 	int slen, i;
 #endif
 
-	ld0 = FWOHCI_DMA_READ(fp->mode.ld[0]);
+	pktu.ld0 = FWOHCI_DMA_READ(fp->mode.ld[0]);
 #if 0
-	printf("ld0: x%08x\n", ld0);
+	printf("ld0: x%08x\n", pktu.ld0);
 #endif
-	fp0 = (struct fw_pkt *)
+	fp0 = (struct fw_pkt *)
 	/* determine length to swap */
 	switch (fp0->mode.common.tcode) {
 	case FWTCODE_WRES:

Index: src/sys/ufs/ext2fs/ext2fs_lookup.c
diff -u src/sys/ufs/ext2fs/ext2fs_lookup.c:1.92 src/sys/ufs/ext2fs/ext2fs_lookup.c:1.93
--- src/sys/ufs/ext2fs/ext2fs_lookup.c:1.92	Sat Aug  6 18:26:42 2022
+++ src/sys/ufs/ext2fs/ext2fs_lookup.c	Thu Aug 10 20:49:19 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_lookup.c,v 1.92 2022/08/06 18:26:42 andvar Exp $	*/
+/*	$NetBSD: ext2fs_lookup.c,v 1.93 2023/08/10 20:49:19 mrg Exp $	*/
 
 /*
  * Modified for NetBSD 1.2E
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.92 2022/08/06 18:26:42 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_lookup.c,v 1.93 2023/08/10 20:49:19 mrg Exp $");
 
 #include 
 #include 
@@ -1126,8 +1126,8 @@ int
 ext2fs_dirempty(struct inode *ip, ino_t parentino, kauth_cred_t cred)
 {
 	off_t off;
-	struct ext2fs_dirtemplate dbuf;
-	struct ext2fs_direct *dp = (struct ext2fs_direct *)
+	struct ext2fs_direct dbuf;
+	struct ext2fs_direct *dp = 
 	int error, namlen;
 	size_t count;
 

Index: src/sys/ufs/ufs/ufs_lookup.c
diff -u src/sys/ufs/ufs/ufs_lookup.c:1.157 src/sys/ufs/ufs/ufs_lookup.c:1.158
--- src/sys/ufs/ufs/ufs_lookup.c:1.157	Wed Feb 22 21:49:45 2023
+++ src/sys/ufs/ufs/ufs_lookup.c	Thu Aug 10 20:49:20 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_lookup.c,v 1.157 2023/02/22 21:49:45 riastradh Exp $	*/
+/*	$NetBSD: ufs_lookup.c,v 1.158 2023/08/10 20:49:20 mrg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.157 2023/02/22 21:49:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.158 2023/08/10 20:49:20 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -1297,8 +1297,8 @@ int
 ufs_dirempty(struct inode *ip, ino_t parentino, kauth_cred_t cred)
 {
 	doff_t off;
-	struct dirtemplate dbuf;
-	struct direct *dp = (void *)

CVS commit: src

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:49:20 UTC 2023

Modified Files:
src/sys/dev/acpi/wmi: wmi_acpi.c
src/sys/dev/ieee1394: fwohci.c
src/sys/ufs/ext2fs: ext2fs_lookup.c
src/sys/ufs/ufs: ufs_lookup.c
src/usr.sbin/fwctl: fwdv.c

Log Message:
don't assign struct pointers to smaller then structure regions of memory.

in all cases here, the later parts of the structure are not actually
accessed, so there are no existing bugs here beyond general UB.  for the
ufs ones, this also removes some casts.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/acpi/wmi/wmi_acpi.c
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/ieee1394/fwohci.c
cvs rdiff -u -r1.92 -r1.93 src/sys/ufs/ext2fs/ext2fs_lookup.c
cvs rdiff -u -r1.157 -r1.158 src/sys/ufs/ufs/ufs_lookup.c
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/fwctl/fwdv.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/misc

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:44:37 UTC 2023

Modified Files:
src/tests/lib/libc/misc: Makefile

Log Message:
make this build with GCC 12.

there are some odd constructs here to trigger sanitizers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/misc/Makefile

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/misc

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:44:37 UTC 2023

Modified Files:
src/tests/lib/libc/misc: Makefile

Log Message:
make this build with GCC 12.

there are some odd constructs here to trigger sanitizers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libc/misc/Makefile

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/misc/Makefile
diff -u src/tests/lib/libc/misc/Makefile:1.8 src/tests/lib/libc/misc/Makefile:1.9
--- src/tests/lib/libc/misc/Makefile:1.8	Sun May 29 10:47:40 2022
+++ src/tests/lib/libc/misc/Makefile	Thu Aug 10 20:44:37 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2022/05/29 10:47:40 andvar Exp $
+# $NetBSD: Makefile,v 1.9 2023/08/10 20:44:37 mrg Exp $
 
 .include 
 
@@ -30,12 +30,11 @@ COPTS.t_ubsan.c += -Wno-stack-protector
 COPTS.t_ubsanxx.cpp += -Wno-stack-protector
 COPTS.ubsan.c+=${${ACTIVE_CC} == "clang" && ${MACHINE_ARCH} == "powerpc":? -O0 :}
 
-.if defined(HAVE_GCC) && ${HAVE_GCC} >= 7 && ${ACTIVE_CC} == "gcc"
 COPTS.t_ubsan.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-int-in-bool-context :}
 COPTS.t_ubsanxx.cpp+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 7:? -Wno-int-in-bool-context :}
-.endif
+COPTS.t_ubsan.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-uninitialized :}
+COPTS.t_ubsanxx.cpp+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 12:? -Wno-uninitialized :}
 
-# XXX
-COPTS.ubsan.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=builtin-declaration-mismatch :}
+COPTS.ubsan.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-builtin-declaration-mismatch :}
 
 .include 



CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 20:41:53 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/alpha: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/sh3el: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libctf/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha: defs.mk gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/sh3el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/alpha: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/sh3el: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/alpha/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/sh3el/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/sh3el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/sh3el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/alpha: defs.mk

Log Message:
add alpha


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/alpha/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/targmatch.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/sh3el/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/alpha/config.h \
src/external/gpl3/gdb/lib/libctf/arch/alpha/defs.mk
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/sh3el/defs.mk
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha/defs.mk
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha/gstdint.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sh3el/gstdint.h
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/config.h
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/defs.mk
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/jit-reader.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/xml-builtin.c
cvs rdiff -u -r1.13 -r1.14 \

CVS commit: src/external/gpl3/gdb/lib

2023-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug 10 20:41:53 UTC 2023

Modified Files:
src/external/gpl3/gdb/lib/libbfd/arch/alpha: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libbfd/arch/sh3el: bfd-in3.h bfd.h bfdver.h
config.h defs.mk targmatch.h
src/external/gpl3/gdb/lib/libctf/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libctf/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha: defs.mk gstdint.h
src/external/gpl3/gdb/lib/libdecnumber/arch/sh3el: gstdint.h
src/external/gpl3/gdb/lib/libgdb/arch/alpha: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdb/arch/sh3el: config.h defs.mk init.c
jit-reader.h version.c xml-builtin.c
src/external/gpl3/gdb/lib/libgdbsupport/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/alpha/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgdbsupport/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libgdbsupport/arch/sh3el/gdbsupport: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib: config.h
src/external/gpl3/gdb/lib/libgnulib/arch/sh3el/gnulib/import: alloca.h
ctype.h dirent.h fcntl.h fnmatch.h glob.h inttypes.h limits.h
locale.h math.h signal.h stdint.h stdio.h stdlib.h string.h time.h
unistd.h wchar.h wctype.h
src/external/gpl3/gdb/lib/libiberty/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libiberty/arch/sh3el: defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/alpha: config.h defs.mk
src/external/gpl3/gdb/lib/libopcodes/arch/sh3el: config.h
src/external/gpl3/gdb/lib/libreadline/arch/alpha: defs.mk
src/external/gpl3/gdb/lib/libreadline/arch/sh3el: defs.mk
Added Files:
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha:
backtrace-supported.h config.h defs.mk
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import:
glob-libc.gl.h
src/external/gpl3/gdb/lib/libgnulib/arch/alpha/gnulib/import/malloc:
scratch_buffer.gl.h
src/external/gpl3/gdb/lib/libsframe/arch/alpha: defs.mk

Log Message:
add alpha


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/backtrace-supported.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/config.h \
src/external/gpl3/gdb/lib/libbacktrace/arch/alpha/defs.mk
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/alpha/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/alpha/targmatch.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfd-in3.h \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfd.h \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/bfdver.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/config.h
cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/lib/libbfd/arch/sh3el/defs.mk
cvs rdiff -u -r1.12 -r1.13 \
src/external/gpl3/gdb/lib/libbfd/arch/sh3el/targmatch.h
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/alpha/config.h \
src/external/gpl3/gdb/lib/libctf/arch/alpha/defs.mk
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/lib/libctf/arch/sh3el/defs.mk
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha/defs.mk
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libdecnumber/arch/alpha/gstdint.h
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libdecnumber/arch/sh3el/gstdint.h
cvs rdiff -u -r1.14 -r1.15 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/config.h
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/defs.mk
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/jit-reader.h
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/version.c \
src/external/gpl3/gdb/lib/libgdb/arch/alpha/xml-builtin.c
cvs rdiff -u -r1.13 -r1.14 \

CVS commit: src/lib

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:38:00 UTC 2023

Modified Files:
src/lib/libc/net: gethnamaddr.c
src/lib/libedit: chartype.c
src/lib/libkvm: kvm_proc.c

Log Message:
avoid various use-after-free issues.

create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/lib/libc/net/gethnamaddr.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/chartype.c
cvs rdiff -u -r1.98 -r1.99 src/lib/libkvm/kvm_proc.c

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



CVS commit: src/lib

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:38:00 UTC 2023

Modified Files:
src/lib/libc/net: gethnamaddr.c
src/lib/libedit: chartype.c
src/lib/libkvm: kvm_proc.c

Log Message:
avoid various use-after-free issues.

create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/lib/libc/net/gethnamaddr.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/chartype.c
cvs rdiff -u -r1.98 -r1.99 src/lib/libkvm/kvm_proc.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/net/gethnamaddr.c
diff -u src/lib/libc/net/gethnamaddr.c:1.94 src/lib/libc/net/gethnamaddr.c:1.95
--- src/lib/libc/net/gethnamaddr.c:1.94	Tue Apr 19 20:32:15 2022
+++ src/lib/libc/net/gethnamaddr.c	Thu Aug 10 20:38:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gethnamaddr.c,v 1.94 2022/04/19 20:32:15 rillig Exp $	*/
+/*	$NetBSD: gethnamaddr.c,v 1.95 2023/08/10 20:38:00 mrg Exp $	*/
 
 /*
  * ++Copyright++ 1985, 1988, 1993
@@ -57,7 +57,7 @@
 static char sccsid[] = "@(#)gethostnamadr.c	8.1 (Berkeley) 6/4/93";
 static char rcsid[] = "Id: gethnamaddr.c,v 8.21 1997/06/01 20:34:37 vixie Exp ";
 #else
-__RCSID("$NetBSD: gethnamaddr.c,v 1.94 2022/04/19 20:32:15 rillig Exp $");
+__RCSID("$NetBSD: gethnamaddr.c,v 1.95 2023/08/10 20:38:00 mrg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -110,10 +110,11 @@ __weak_alias(gethostent,_gethostent)
 
 #define addalias(d, s, arr, siz) do {			\
 	if (d >= [siz]) {\
+		ptrdiff_t _off = d - arr;		\
 		char **xptr = realloc(arr, (siz + 10) * sizeof(*arr)); \
 		if (xptr == NULL)			\
 			goto nospc;			\
-		d = xptr + (d - arr);			\
+		d = xptr + _off;			\
 		arr = xptr;\
 		siz += 10;\
 	}		\

Index: src/lib/libedit/chartype.c
diff -u src/lib/libedit/chartype.c:1.36 src/lib/libedit/chartype.c:1.37
--- src/lib/libedit/chartype.c:1.36	Sun Oct 30 19:11:31 2022
+++ src/lib/libedit/chartype.c	Thu Aug 10 20:38:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.36 2022/10/30 19:11:31 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.37 2023/08/10 20:38:00 mrg Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.36 2022/10/30 19:11:31 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.37 2023/08/10 20:38:00 mrg Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -235,17 +235,17 @@ ct_visual_string(const wchar_t *s, ct_bu
 		}
 
 		/* failed to encode, need more buffer space */
-		used = dst - conv->wbuff;
+		uintptr_t sused = (uintptr_t)dst - (uintptr_t)conv->wbuff;
 		if (ct_conv_wbuff_resize(conv, conv->wsize + CT_BUFSIZ) == -1)
 			return NULL;
-		dst = conv->wbuff + used;
+		dst = conv->wbuff + sused;
 	}
 
 	if (dst >= (conv->wbuff + conv->wsize)) { /* sigh */
-		used = dst - conv->wbuff;
+		uintptr_t sused = (uintptr_t)dst - (uintptr_t)conv->wbuff;
 		if (ct_conv_wbuff_resize(conv, conv->wsize + CT_BUFSIZ) == -1)
 			return NULL;
-		dst = conv->wbuff + used;
+		dst = conv->wbuff + sused;
 	}
 
 	*dst = L'\0';

Index: src/lib/libkvm/kvm_proc.c
diff -u src/lib/libkvm/kvm_proc.c:1.98 src/lib/libkvm/kvm_proc.c:1.99
--- src/lib/libkvm/kvm_proc.c:1.98	Tue Apr 19 20:32:16 2022
+++ src/lib/libkvm/kvm_proc.c	Thu Aug 10 20:38:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: kvm_proc.c,v 1.98 2022/04/19 20:32:16 rillig Exp $	*/
+/*	$NetBSD: kvm_proc.c,v 1.99 2023/08/10 20:38:00 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)kvm_proc.c	8.3 (Berkeley) 9/23/93";
 #else
-__RCSID("$NetBSD: kvm_proc.c,v 1.98 2022/04/19 20:32:16 rillig Exp $");
+__RCSID("$NetBSD: kvm_proc.c,v 1.99 2023/08/10 20:38:00 mrg Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -980,7 +980,7 @@ kvm_argv(kvm_t *kd, const struct minipro
 		if (len + cc > kd->argspc_len) {
 			ptrdiff_t off;
 			char **pp;
-			char *op = kd->argspc;
+			uintptr_t op = (uintptr_t)kd->argspc;
 
 			kd->argspc_len *= 2;
 			kd->argspc = _kvm_realloc(kd, kd->argspc,
@@ -991,7 +991,7 @@ kvm_argv(kvm_t *kd, const struct minipro
 			 * Adjust argv pointers in case realloc moved
 			 * the string space.
 			 */
-			off = kd->argspc - op;
+			off = (uintptr_t)kd->argspc - op;
 			for (pp = kd->argv; pp < argv; pp++)
 *pp += off;
 			ap += off;



CVS commit: src

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:36:29 UTC 2023

Modified Files:
src/external/bsd/pdisk/dist: io.c
src/usr.bin/find: misc.c
src/usr.bin/mail: extern.h fio.c thread.c thread.h
src/usr.bin/rs: rs.c
src/usr.bin/sort: files.c

Log Message:
avoid various use-after-free issues.

create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.  for pdisk(), realloc() is a locally inlind malloc()
and free() pair.

for mail(1), this required a little bit more effort as the old pointer
was passed into another file for fix-ups there, and that code needed to
be adjusted for offset vs old pointer usage.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pdisk/dist/io.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/find/misc.c
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/mail/extern.h
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/mail/fio.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/mail/thread.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/mail/thread.h
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/rs/rs.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/sort/files.c

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



CVS commit: src

2023-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 10 20:36:29 UTC 2023

Modified Files:
src/external/bsd/pdisk/dist: io.c
src/usr.bin/find: misc.c
src/usr.bin/mail: extern.h fio.c thread.c thread.h
src/usr.bin/rs: rs.c
src/usr.bin/sort: files.c

Log Message:
avoid various use-after-free issues.

create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.  for pdisk(), realloc() is a locally inlind malloc()
and free() pair.

for mail(1), this required a little bit more effort as the old pointer
was passed into another file for fix-ups there, and that code needed to
be adjusted for offset vs old pointer usage.

found by GCC 12.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/pdisk/dist/io.c
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/find/misc.c
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/mail/extern.h
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/mail/fio.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/mail/thread.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/mail/thread.h
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/rs/rs.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/sort/files.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/bsd/pdisk/dist/io.c
diff -u src/external/bsd/pdisk/dist/io.c:1.2 src/external/bsd/pdisk/dist/io.c:1.3
--- src/external/bsd/pdisk/dist/io.c:1.2	Sat Mar 23 15:39:43 2013
+++ src/external/bsd/pdisk/dist/io.c	Thu Aug 10 20:36:28 2023
@@ -328,6 +328,7 @@ get_string(int eos)
 char *ret_value;
 char *limit;
 int length;
+ptrdiff_t off;
 
 ret_value = (char *) malloc(STRING_CHUNK);
 if (ret_value == NULL) {
@@ -348,8 +349,9 @@ get_string(int eos)
 		break;
 	}
 	strncpy(limit, ret_value, length);
+	off = s - ret_value;
 	free(ret_value);
-	s = limit + (s - ret_value);
+	s = limit + off;
 	ret_value = limit;
 	length += STRING_CHUNK;
 	limit = ret_value + length;

Index: src/usr.bin/find/misc.c
diff -u src/usr.bin/find/misc.c:1.15 src/usr.bin/find/misc.c:1.16
--- src/usr.bin/find/misc.c:1.15	Sat Jan 22 14:08:19 2022
+++ src/usr.bin/find/misc.c	Thu Aug 10 20:36:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.15 2022/01/22 14:08:19 christos Exp $	*/
+/*	$NetBSD: misc.c,v 1.16 2023/08/10 20:36:28 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)misc.c	8.2 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: misc.c,v 1.15 2022/01/22 14:08:19 christos Exp $");
+__RCSID("$NetBSD: misc.c,v 1.16 2023/08/10 20:36:28 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -78,11 +78,13 @@ brace_subst(char *orig, char **store, ch
 nlen *= 2;
 
 			if (nlen > *len) {
+ptrdiff_t off = p - *store;
+
 ostore = *store;
 if ((*store = realloc(ostore, nlen)) == NULL)
 	err(1, "realloc");
 *len = nlen;
-p += *store - ostore;	/* Relocate. */
+p = *store + off;	/* Relocate. */
 			}
 			memmove(p, path, plen);
 			p += plen;

Index: src/usr.bin/mail/extern.h
diff -u src/usr.bin/mail/extern.h:1.35 src/usr.bin/mail/extern.h:1.36
--- src/usr.bin/mail/extern.h:1.35	Tue Aug  1 07:04:17 2023
+++ src/usr.bin/mail/extern.h	Thu Aug 10 20:36:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.35 2023/08/01 07:04:17 mrg Exp $	*/
+/*	$NetBSD: extern.h,v 1.36 2023/08/10 20:36:28 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  *
  *	@(#)extern.h	8.2 (Berkeley) 4/20/95
- *	$NetBSD: extern.h,v 1.35 2023/08/01 07:04:17 mrg Exp $
+ *	$NetBSD: extern.h,v 1.36 2023/08/10 20:36:28 mrg Exp $
  */
 
 #ifndef __EXTERN_H__
@@ -357,7 +357,7 @@ int	get_msgCount(void);
 /* we trash these commands */
 # define do_recursion()			0
 # define thread_recursion(mp,fn,args)	fn(mp,args)
-# define thread_fix_old_links(nmessage,message,omsgCount)
+# define thread_fix_old_links(nmessage,off,omsgCount)
 # define thread_fix_new_links(message,omsgCount,msgCount)
 #endif /* THREAD_SUPPORT */
 

Index: src/usr.bin/mail/fio.c
diff -u src/usr.bin/mail/fio.c:1.43 src/usr.bin/mail/fio.c:1.44
--- src/usr.bin/mail/fio.c:1.43	Thu Nov  9 20:27:50 2017
+++ src/usr.bin/mail/fio.c	Thu Aug 10 20:36:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: fio.c,v 1.43 2017/11/09 20:27:50 christos Exp $	*/
+/*	$NetBSD: fio.c,v 1.44 2023/08/10 20:36:28 mrg Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)fio.c	8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: fio.c,v 1.43 2017/11/09 20:27:50 christos Exp $");
+__RCSID("$NetBSD: fio.c,v 1.44 2023/08/10 20:36:28 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -125,20 +125,23 @@ makemessage(FILE *f, int omsgCount, int 
 	size_t size;
 	struct message *omessage;	/* old message structure array */
 	struct message *nmessage;
+	ptrdiff_t off;
 
 	omessage = get_abs_message(1);
 

CVS commit: src/sys

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 20:02:56 UTC 2023

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c
src/sys/arch/powerpc/booke: e500_timer.c
src/sys/arch/sparc64/include: ctlreg.h
src/sys/dev/pci: pci_subr.c

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/gemini/gemini_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/e500_timer.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.242 -r1.243 src/sys/dev/pci/pci_subr.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/evbarm/gemini/gemini_machdep.c
diff -u src/sys/arch/evbarm/gemini/gemini_machdep.c:1.34 src/sys/arch/evbarm/gemini/gemini_machdep.c:1.35
--- src/sys/arch/evbarm/gemini/gemini_machdep.c:1.34	Thu Apr 20 08:28:04 2023
+++ src/sys/arch/evbarm/gemini/gemini_machdep.c	Thu Aug 10 20:02:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: gemini_machdep.c,v 1.34 2023/04/20 08:28:04 skrll Exp $	*/
+/*	$NetBSD: gemini_machdep.c,v 1.35 2023/08/10 20:02:55 andvar Exp $	*/
 
 /* adapted from:
  *	NetBSD: sdp24xx_machdep.c,v 1.4 2008/08/27 11:03:10 matt Exp
@@ -129,7 +129,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.34 2023/04/20 08:28:04 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.35 2023/08/10 20:02:55 andvar Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_console.h"
@@ -1079,7 +1079,7 @@ printf("%s:%d: pmap_link_l2pt ipmq_pt\n"
 
 #ifdef GEMINI_SLAVE
 	/*
-	 * Map all memory, incluuding that owned by other core
+	 * Map all memory, including that owned by other core
 	 * take into account the RAM remap, so view in this region
 	 * is consistent with MASTER
 	 */
@@ -1094,7 +1094,7 @@ printf("%s:%d: pmap_link_l2pt ipmq_pt\n"
 	(MEMSIZE * 1024 * 1024),
 	VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 #else
-	/* Map all memory, incluuding that owned by other core */
+	/* Map all memory, including that owned by other core */
 	pmap_map_chunk(l1_va, GEMINI_ALLMEM_VBASE, GEMINI_ALLMEM_PBASE,
 	GEMINI_ALLMEM_SIZE * 1024 * 1024, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE);
 #endif	/* GEMINI_SLAVE */

Index: src/sys/arch/powerpc/booke/e500_timer.c
diff -u src/sys/arch/powerpc/booke/e500_timer.c:1.7 src/sys/arch/powerpc/booke/e500_timer.c:1.8
--- src/sys/arch/powerpc/booke/e500_timer.c:1.7	Fri May 29 12:30:40 2020
+++ src/sys/arch/powerpc/booke/e500_timer.c	Thu Aug 10 20:02:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: e500_timer.c,v 1.7 2020/05/29 12:30:40 rin Exp $	*/
+/*	$NetBSD: e500_timer.c,v 1.8 2023/08/10 20:02:56 andvar Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: e500_timer.c,v 1.7 2020/05/29 12:30:40 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_timer.c,v 1.8 2023/08/10 20:02:56 andvar Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@ e500_clock_intr(void *v)
 	 * Now let's how delayed the clock interrupt was.  Obviously it must
 	 * at least one clock tick since the clock interrupt.  But it might
 	 * be more if interrupts were blocked for a long time.  We keep 
-	 * suubtracting an interrupts We should be
+	 * subtracting an interrupts We should be
 	 * [well] within a single tick.
 	 * We add back one tick (which should put us back above 0).  If we
 	 * are still below 0, keep adding ticks until we are above 0.

Index: src/sys/arch/sparc64/include/ctlreg.h
diff -u src/sys/arch/sparc64/include/ctlreg.h:1.68 src/sys/arch/sparc64/include/ctlreg.h:1.69
--- src/sys/arch/sparc64/include/ctlreg.h:1.68	Sat May  6 22:17:28 2023
+++ src/sys/arch/sparc64/include/ctlreg.h	Thu Aug 10 20:02:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.68 2023/05/06 22:17:28 andvar Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.69 2023/08/10 20:02:56 andvar Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -293,7 +293,7 @@
 #define	SFSR_FT_IO_ATOMIC	0x00200	/* DMMU: Atomic access to noncacheable page */
 #define	SFSR_FT_ILL_NF		0x00100	/* DMMU: NF load or flush to page marked E (has side effects) */
 #define	SFSR_FT_PRIV		0x00080	/* Privilege violation */
-#define	SFSR_FT_E		0x00040	/* DMUU: value of E bit associated address */
+#define	SFSR_FT_E		0x00040	/* DMMU: value of E bit associated address */
 #define	SFSR_CTXT(x)		(((x)>>4)&0x3)
 #define	SFSR_CTXT_IS_PRIM(x)	(SFSR_CTXT(x)==0x00)
 #define	SFSR_CTXT_IS_SECOND(x)	(SFSR_CTXT(x)==0x01)

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.242 src/sys/dev/pci/pci_subr.c:1.243
--- src/sys/dev/pci/pci_subr.c:1.242	Tue Feb  1 01:28:26 2022
+++ src/sys/dev/pci/pci_subr.c	Thu Aug 10 20:02:56 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.242 2022/02/01 01:28:26 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.243 2023/08/10 20:02:56 andvar Exp $	*/
 
 /*
  * Copyright (c) 

CVS commit: src/sys

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 20:02:56 UTC 2023

Modified Files:
src/sys/arch/evbarm/gemini: gemini_machdep.c
src/sys/arch/powerpc/booke: e500_timer.c
src/sys/arch/sparc64/include: ctlreg.h
src/sys/dev/pci: pci_subr.c

Log Message:
fix typos in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/gemini/gemini_machdep.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/powerpc/booke/e500_timer.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.242 -r1.243 src/sys/dev/pci/pci_subr.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/vax/include

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 19:13:52 UTC 2023

Modified Files:
src/sys/arch/vax/include: uvax.h

Log Message:
s/VAXststions/VAXstations/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/uvax.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/vax/include/uvax.h
diff -u src/sys/arch/vax/include/uvax.h:1.8 src/sys/arch/vax/include/uvax.h:1.9
--- src/sys/arch/vax/include/uvax.h:1.8	Mon May 22 17:12:11 2017
+++ src/sys/arch/vax/include/uvax.h	Thu Aug 10 19:13:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvax.h,v 1.8 2017/05/22 17:12:11 ragge Exp $ */
+/*	$NetBSD: uvax.h,v 1.9 2023/08/10 19:13:52 andvar Exp $ */
 /*
  * Copyright (c) 2002 Hugh Graham.
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
@@ -55,7 +55,7 @@
 #define uVAX_CLKLANG	0360
 
 /*
- * Miscellaneous registers common on most VAXststions.
+ * Miscellaneous registers common on most VAXstations.
  */
 struct vs_cpu {
 	u_long	vc_hltcod;	/* 00 - Halt Code Register */



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

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 19:13:52 UTC 2023

Modified Files:
src/sys/arch/vax/include: uvax.h

Log Message:
s/VAXststions/VAXstations/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/include/uvax.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/dev/pci

2023-08-10 Thread Taylor R Campbell
> Date: Thu, 10 Aug 2023 17:42:35 +0900
> From: Kengo NAKAHARA 
> 
> Could you tell me how you test this fix for future reference?

I asked skrll@ to boot a VM with vmxnet3 and hammer on it with a
combination of:

1. dhcp
2. host$ nc -l 54321 /dev/null
   guest$ nc host 54321 /dev/null
3. for i in `jot 4`; do
  jot 100 | while read i; do
 ifconfig vmxnet0 down
 ifconfig vmxnet0 up
  done &
   done
   wait

and then see if the network continued functioning.

However, I didn't do anything to verify that we could trigger all the
problems that I noticed by code inspection.  I didn't do that mostly
because I'd been sitting on this patch for a year, and I didn't want
it to languish indefinitely with obvious bugs lurking in vmxnet(4).

Here are a couple more things that it would be good to do:

1. Create a sysctl knob to simulate watchdog failure and trigger
   reset.  I don't think we tested this path at all, but it's a common
   bug with an easy fix -- defer to workqueue.  Some other drivers
   have a sysctl knob like this: wm(4), bge(4).

2. Verify that SIOCADDMULTI and SIOCDELMULTI don't deadlock when run
   concurrently with ifconfig up/down.

vmxnet(4) still has a serious bug: the `core lock' can still lead to a
deadlock with reset and softint.  It should be removed from most uses,
and be limited to cover only mii transactions like I did for usbnet(4)
last year.


CVS commit: [netbsd-9] src/doc

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:30:56 UTC 2023

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1713


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.89 -r1.1.2.90 src/doc/CHANGES-9.4

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

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.89 src/doc/CHANGES-9.4:1.1.2.90
--- src/doc/CHANGES-9.4:1.1.2.89	Wed Aug  9 17:48:30 2023
+++ src/doc/CHANGES-9.4	Thu Aug 10 10:30:56 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.89 2023/08/09 17:48:30 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.90 2023/08/10 10:30:56 sborrill Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -1999,3 +1999,9 @@ external/cddl/osnet/sys/sys/proc.h		1.10
 	solaris: give threads less bad names.
 	[riastradh, ticket #1711]
 
+sys/arch/xen/x86/xen_ipi.c			1.41 via patch
+
+	xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer
+	to a struct intrframe to IPI handlers.
+	[riastradh, ticket #1713]
+



CVS commit: [netbsd-9] src/doc

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:30:56 UTC 2023

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1713


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.89 -r1.1.2.90 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/sys/arch/xen/x86

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:30:28 UTC 2023

Modified Files:
src/sys/arch/xen/x86 [netbsd-9]: xen_ipi.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #1713):
sys/arch/xen/x86/xen_ipi.c: revision 1.41 via patch

xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer to a
struct intrframe to IPI handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/arch/xen/x86/xen_ipi.c

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



CVS commit: [netbsd-9] src/sys/arch/xen/x86

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:30:28 UTC 2023

Modified Files:
src/sys/arch/xen/x86 [netbsd-9]: xen_ipi.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #1713):
sys/arch/xen/x86/xen_ipi.c: revision 1.41 via patch

xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer to a
struct intrframe to IPI handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/arch/xen/x86/xen_ipi.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/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.32 src/sys/arch/xen/x86/xen_ipi.c:1.32.4.1
--- src/sys/arch/xen/x86/xen_ipi.c:1.32	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/x86/xen_ipi.c	Thu Aug 10 10:30:28 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.32 2019/02/02 12:32:55 cherry Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.32.4.1 2023/08/10 10:30:28 sborrill Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.32 2019/02/02 12:32:55 cherry Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.32.4.1 2023/08/10 10:30:28 sborrill Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.32 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.32.4.1 2023/08/10 10:30:28 sborrill Exp $");
 
 #include "opt_ddb.h"
 
@@ -87,16 +87,13 @@ static void (*ipifunc[XEN_NIPIS])(struct
 };
 
 static int
-xen_ipi_handler(void *arg)
+xen_ipi_handler(void *arg, struct intrframe *regs)
 {
 	uint32_t pending;
 	int bit;
 	struct cpu_info *ci;
-	struct intrframe *regs;
 
 	ci = curcpu();
-	regs = arg;
-	
 	pending = atomic_swap_32(>ci_ipis, 0);
 
 	KDASSERT((pending >> XEN_NIPIS) == 0);
@@ -138,7 +135,8 @@ xen_ipi_init(void)
 	device_xname(ci->ci_dev));
 
 	if (xen_intr_establish_xname(-1, _pic, evtchn, IST_LEVEL, IPL_HIGH,
-		xen_ipi_handler, ci, true, intr_xname) == NULL) {
+		(int (*)(void *))xen_ipi_handler, ci, true, intr_xname)
+	== NULL) {
 		panic("%s: unable to register ipi handler\n", __func__);
 		/* NOTREACHED */
 	}



Re: CVS commit: src/sys/dev/pci

2023-08-10 Thread Kengo NAKAHARA

Hi,

On 2023/08/10 18:07, Nick Hudson wrote:

On 10/08/2023 09:42, Kengo NAKAHARA wrote:

Hi,

Could you tell me how you test this fix for future reference?


He didn't - I did. :)

Taylor suggested running with network traffic and doing ifconfig
down/up. To generate network traffic Taylor suggested


host$ nc -l 54321 /dev/null
guest$ nc host 54321 /dev/null

and I did

 for i in `jot 64`; do
     ifconfig vmx0 down
     sleep 1
     ifconfig vmx0 up
 done

Nick


I see.  I want to know the traffic generator and ioctl jobs, that is
exactly what is.  Thank you for your comment.


Thanks,

--
//
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 




CVS commit: [netbsd-10] src/doc

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:24:39 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket #318


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.98 -r1.1.2.99 src/doc/CHANGES-10.0

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

Modified files:

Index: src/doc/CHANGES-10.0
diff -u src/doc/CHANGES-10.0:1.1.2.98 src/doc/CHANGES-10.0:1.1.2.99
--- src/doc/CHANGES-10.0:1.1.2.98	Wed Aug  9 17:49:28 2023
+++ src/doc/CHANGES-10.0	Thu Aug 10 10:24:39 2023
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-10.0,v 1.1.2.98 2023/08/09 17:49:28 martin Exp $
+# $NetBSD: CHANGES-10.0,v 1.1.2.99 2023/08/10 10:24:39 sborrill Exp $
 
 A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16
 until the 10.0 release:
@@ -3701,3 +3701,9 @@ usr.sbin/crash/Makefile1.49
 	ddb(4): new command: show all tstiles.
 	[maya, ticket #316]
 
+sys/arch/xen/x86/xen_ipi.c			1.41
+
+	xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer
+	to a struct intrframe to IPI handlers.
+	[riastradh, ticket #318]
+



CVS commit: [netbsd-10] src/doc

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:24:39 UTC 2023

Modified Files:
src/doc [netbsd-10]: CHANGES-10.0

Log Message:
Ticket #318


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.98 -r1.1.2.99 src/doc/CHANGES-10.0

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



CVS commit: [netbsd-10] src/sys/arch/xen/x86

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:23:54 UTC 2023

Modified Files:
src/sys/arch/xen/x86 [netbsd-10]: xen_ipi.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #318):
sys/arch/xen/x86/xen_ipi.c: revision 1.41

xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer to a
struct intrframe to IPI handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.4.1 src/sys/arch/xen/x86/xen_ipi.c

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



CVS commit: [netbsd-10] src/sys/arch/xen/x86

2023-08-10 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Thu Aug 10 10:23:54 UTC 2023

Modified Files:
src/sys/arch/xen/x86 [netbsd-10]: xen_ipi.c

Log Message:
Pull up the following revisions(s) (requested by riastradh in ticket #318):
sys/arch/xen/x86/xen_ipi.c: revision 1.41

xen/x86: Fix 'mach cpu N' in ddb by passing the right pointer to a
struct intrframe to IPI handlers.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.4.1 src/sys/arch/xen/x86/xen_ipi.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/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.40 src/sys/arch/xen/x86/xen_ipi.c:1.40.4.1
--- src/sys/arch/xen/x86/xen_ipi.c:1.40	Wed Jan  5 20:21:29 2022
+++ src/sys/arch/xen/x86/xen_ipi.c	Thu Aug 10 10:23:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.40 2022/01/05 20:21:29 christos Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.40.4.1 2023/08/10 10:23:54 sborrill Exp $ */
 
 /*-
  * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  * Based on: x86/ipi.c
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.40 2022/01/05 20:21:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.40.4.1 2023/08/10 10:23:54 sborrill Exp $");
 
 #include "opt_ddb.h"
 
@@ -90,18 +90,15 @@ static void (*xen_ipifunc[XEN_NIPIS])(st
 };
 
 static int
-xen_ipi_handler(void *arg)
+xen_ipi_handler(void *arg, struct intrframe *regs)
 {
 	uint32_t pending;
 	int bit;
 	struct cpu_info *ci;
-	struct intrframe *regs;
 
 	ci = curcpu();
-	regs = arg;
 
 	KASSERT(ci == arg);
-	
 	pending = atomic_swap_32(>ci_ipis, 0);
 
 	KDASSERT((pending >> XEN_NIPIS) == 0);
@@ -142,8 +139,9 @@ xen_ipi_init(void)
 	snprintf(intr_xname, sizeof(intr_xname), "%s ipi",
 	device_xname(ci->ci_dev));
 
-	if (event_set_handler(evtchn, xen_ipi_handler, ci, IPL_HIGH, NULL,
-	intr_xname, true, ci) == NULL) {
+	if (event_set_handler(evtchn,
+		__FPTRCAST(int (*)(void *), xen_ipi_handler), ci, IPL_HIGH,
+		NULL, intr_xname, true, ci) == NULL) {
 		panic("%s: unable to register ipi handler\n", __func__);
 		/* NOTREACHED */
 	}



Re: CVS commit: src/sys/dev/pci

2023-08-10 Thread Nick Hudson

On 10/08/2023 09:42, Kengo NAKAHARA wrote:

Hi,

Could you tell me how you test this fix for future reference?


He didn't - I did. :)

Taylor suggested running with network traffic and doing ifconfig
down/up. To generate network traffic Taylor suggested


host$ nc -l 54321 /dev/null
guest$ nc host 54321 /dev/null

and I did

for i in `jot 64`; do
ifconfig vmx0 down
sleep 1
ifconfig vmx0 up
done

Nick


Re: CVS commit: src/sys/dev/pci

2023-08-10 Thread Kengo NAKAHARA

Hi,

Could you tell me how you test this fix for future reference?


Thanks,

On 2023/08/10 17:24, Taylor R Campbell wrote:

Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 08:24:45 UTC 2023

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

Log Message:
vmxnet(4): Fix various MP bugs.

- Defer reset to workqueue.
   => vmxnet3_stop_locked is forbidden in softint.
   => XXX Problem: We still take the core lock in softint, and we
  still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
   => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
   => Don't call vmxnet3_set_rxfilter unless up and running; cache
  this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
  instead of calling vmxnet3_set_rxfilter directly.
  . (The cache is currently serialized by the core lock, but it
might reasonably be serialized by an independent lock like in
usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
   => New vxtxq_stopping, vxrxq_stopping variables synchronize with
  Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_vmx.c

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



--
//
Internet Initiative Japan Inc.

Device Engineering Section,
Core Product Development Department,
Network Division,
Technology Unit

Kengo NAKAHARA 




CVS commit: src/sys/dev/pci

2023-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 08:24:45 UTC 2023

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

Log Message:
vmxnet(4): Fix various MP bugs.

- Defer reset to workqueue.
  => vmxnet3_stop_locked is forbidden in softint.
  => XXX Problem: We still take the core lock in softint, and we
 still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
  => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
  => Don't call vmxnet3_set_rxfilter unless up and running; cache
 this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
 instead of calling vmxnet3_set_rxfilter directly.
 . (The cache is currently serialized by the core lock, but it
   might reasonably be serialized by an independent lock like in
   usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
  => New vxtxq_stopping, vxrxq_stopping variables synchronize with
 Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_vmx.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-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 08:24:45 UTC 2023

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

Log Message:
vmxnet(4): Fix various MP bugs.

- Defer reset to workqueue.
  => vmxnet3_stop_locked is forbidden in softint.
  => XXX Problem: We still take the core lock in softint, and we
 still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
  => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
  => Don't call vmxnet3_set_rxfilter unless up and running; cache
 this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
 instead of calling vmxnet3_set_rxfilter directly.
 . (The cache is currently serialized by the core lock, but it
   might reasonably be serialized by an independent lock like in
   usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
  => New vxtxq_stopping, vxrxq_stopping variables synchronize with
 Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_vmx.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_vmx.c
diff -u src/sys/dev/pci/if_vmx.c:1.11 src/sys/dev/pci/if_vmx.c:1.12
--- src/sys/dev/pci/if_vmx.c:1.11	Fri Sep 16 07:55:34 2022
+++ src/sys/dev/pci/if_vmx.c	Thu Aug 10 08:24:44 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.11 2022/09/16 07:55:34 knakahara Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.12 2023/08/10 08:24:44 riastradh Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.11 2022/09/16 07:55:34 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.12 2023/08/10 08:24:44 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_vmx.h"
@@ -212,6 +212,8 @@ struct vmxnet3_txqueue {
 	struct evcnt vxtxq_watchdogto;
 	struct evcnt vxtxq_defragged;
 	struct evcnt vxtxq_defrag_failed;
+
+	bool vxtxq_stopping;
 };
 
 
@@ -230,6 +232,8 @@ struct vmxnet3_rxqueue {
 	struct evcnt vxrxq_deferreq;
 	struct evcnt vxrxq_mgetcl_failed;
 	struct evcnt vxrxq_mbuf_load_failed;
+
+	bool vxrxq_stopping;
 };
 
 struct vmxnet3_queue {
@@ -291,6 +295,9 @@ struct vmxnet3_softc {
 
 	kmutex_t *vmx_mtx;
 
+	int vmx_if_flags;
+	bool vmx_promisc;
+	bool vmx_mcastactive;
 	uint8_t *vmx_mcast;
 	void *vmx_qs;
 	struct vmxnet3_rss_shared *vmx_rss;
@@ -311,6 +318,10 @@ struct vmxnet3_softc {
 
 	bool vmx_txrx_workqueue;
 	struct workqueue *vmx_queue_wq;
+
+	struct workqueue *vmx_reset_wq;
+	struct work vmx_reset_work;
+	bool vmx_reset_pending;
 };
 
 #define VMXNET3_STAT
@@ -435,6 +446,7 @@ static int vmxnet3_ifflags_cb(struct eth
 static int vmxnet3_watchdog(struct vmxnet3_txqueue *);
 static void vmxnet3_refresh_host_stats(struct vmxnet3_softc *);
 static void vmxnet3_tick(void *);
+static void vmxnet3_reset_work(struct work *, void *);
 static void vmxnet3_if_link_status(struct vmxnet3_softc *);
 static bool vmxnet3_cmd_link_status(struct ifnet *);
 static void vmxnet3_ifmedia_status(struct ifnet *, struct ifmediareq *);
@@ -633,6 +645,18 @@ vmxnet3_attach(device_t parent, device_t
 	if (error)
 		return;
 
+	char buf[128];
+	snprintf(buf, sizeof(buf), "%s_reset", device_xname(sc->vmx_dev));
+	error = workqueue_create(>vmx_reset_wq, "%s_reset",
+	vmxnet3_reset_work, sc, VMXNET3_WORKQUEUE_PRI, IPL_SOFTCLOCK,
+	WQ_MPSAFE);
+	if (error) {
+		aprint_error_dev(sc->vmx_dev,
+		"failed to create reset workqueue: %d\n",
+		error);
+		return;
+	}
+
 	sc->vmx_flags |= VMXNET3_FLAG_ATTACHED;
 }
 
@@ -1124,6 +1148,8 @@ vmxnet3_init_rxq(struct vmxnet3_softc *s
 		rxq->vxrxq_comp_ring.vxcr_ndesc += sc->vmx_nrxdescs;
 	}
 
+	rxq->vxrxq_stopping = true;
+
 	return (0);
 }
 
@@ -1159,6 +1185,8 @@ vmxnet3_init_txq(struct vmxnet3_softc *s
 
 	txq->vxtxq_interq = pcq_create(sc->vmx_ntxdescs, KM_SLEEP);
 
+	txq->vxtxq_stopping = true;
+
 	return (0);
 }
 
@@ -2336,7 +2364,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *
 
 	VMXNET3_RXQ_LOCK_ASSERT(rxq);
 
-	if ((ifp->if_flags & IFF_RUNNING) == 0)
+	if (rxq->vxrxq_stopping)
 		return more;
 
 	m_head = rxq->vxrxq_mhead;
@@ -2442,7 +2470,7 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *
 			m_head = m_tail = NULL;
 
 			/* Must recheck after dropping the Rx lock. */
-			if ((ifp->if_flags & IFF_RUNNING) == 0)
+			if (rxq->vxrxq_stopping)
 break;
 		}
 
@@ -2711,11 +2739,13 @@ vmxnet3_stop_rendezvous(struct vmxnet3_s
 	for (i = 0; i < sc->vmx_nrxqueues; i++) {
 		rxq = >vmx_queue[i].vxq_rxqueue;
 		VMXNET3_RXQ_LOCK(rxq);
+		rxq->vxrxq_stopping = true;
 		VMXNET3_RXQ_UNLOCK(rxq);
 	}
 	for (i = 0; i < sc->vmx_ntxqueues; i++) {
 		txq = >vmx_queue[i].vxq_txqueue;
 		VMXNET3_TXQ_LOCK(txq);
+		txq->vxtxq_stopping = true;
 		VMXNET3_TXQ_UNLOCK(txq);
 	}
 	for (i = 0; i < sc->vmx_nrxqueues; i++) {
@@ -2727,22 

CVS commit: src/crypto/external/cpl/trousers

2023-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 06:56:12 UTC 2023

Modified Files:
src/crypto/external/cpl/trousers/bin/tcsd: Makefile
src/crypto/external/cpl/trousers/dist/src/include: tcsd.h
trousers_types.h
src/crypto/external/cpl/trousers/lib/libtcs: Makefile
src/crypto/external/cpl/trousers/lib/libtspi: Makefile

Log Message:
trousers: Make this build again.

- Downgrade address-of-packed-member errors to warnings.  Not sure if
  this is safe, but there's too many to audit.

- Silence deprecation warnings for openssl3.

- Address removal of const qualifier in iconv.

- Nix unused definitions in a .h file, which cause trouble now that
  -fno-common is the default.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/cpl/trousers/bin/tcsd/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/cpl/trousers/dist/src/include/tcsd.h \
src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/cpl/trousers/lib/libtcs/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/cpl/trousers/lib/libtspi/Makefile

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

Modified files:

Index: src/crypto/external/cpl/trousers/bin/tcsd/Makefile
diff -u src/crypto/external/cpl/trousers/bin/tcsd/Makefile:1.2 src/crypto/external/cpl/trousers/bin/tcsd/Makefile:1.3
--- src/crypto/external/cpl/trousers/bin/tcsd/Makefile:1.2	Mon Jan  7 15:18:03 2019
+++ src/crypto/external/cpl/trousers/bin/tcsd/Makefile	Thu Aug 10 06:56:12 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2019/01/07 15:18:03 christos Exp $
+# $NetBSD: Makefile,v 1.3 2023/08/10 06:56:12 riastradh Exp $
 .include "../Makefile.inc"
 
 .PATH.c: ${DIST}/src/tcsd
@@ -6,6 +6,8 @@
 CPPFLAGS+=-DAPPID=\"TCSD\" -DVAR_PREFIX=\"/var\"  -DETC_PREFIX=\"/etc\"
 CPPFLAGS+=-DTSS_BUILD_PS -DTSS_BUILD_PCR_EVENTS
 
+COPTS.tcsd_threads.c+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
+
 BINDIR=/usr/sbin
 PROG=tcsd
 SRCS=\

Index: src/crypto/external/cpl/trousers/dist/src/include/tcsd.h
diff -u src/crypto/external/cpl/trousers/dist/src/include/tcsd.h:1.3 src/crypto/external/cpl/trousers/dist/src/include/tcsd.h:1.4
--- src/crypto/external/cpl/trousers/dist/src/include/tcsd.h:1.3	Mon Jan  7 15:18:03 2019
+++ src/crypto/external/cpl/trousers/dist/src/include/tcsd.h	Thu Aug 10 06:56:12 2023
@@ -170,7 +170,7 @@ void	   *tcsd_thread_run(void *);
 void	   thread_signal_init();
 
 /* signal handling */
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__NetBSD__)
 struct sigaction tcsd_sa_int;
 struct sigaction tcsd_sa_chld;
 #endif
Index: src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h
diff -u src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h:1.3 src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h:1.4
--- src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h:1.3	Mon Jan  7 15:18:03 2019
+++ src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h	Thu Aug 10 06:56:12 2023
@@ -118,9 +118,9 @@ typedef struct tdTSS_KEY {
 	BYTE *encData;
 } TSS_KEY;
 
-#if (defined (__linux) || defined (linux) || defined (SOLARIS) || defined (__GLIBC__))
+#if (defined (__linux) || defined (linux) || defined (SOLARIS) || defined (__GLIBC__) || defined (__NetBSD__))
 #define BSD_CONST
-#elif defined (__OpenBSD__) || defined (__FreeBSD__) || defined (__NetBSD__) || defined (__APPLE__)
+#elif defined (__OpenBSD__) || defined (__FreeBSD__) || defined (__APPLE__)
 #define BSD_CONST const
 #endif
 

Index: src/crypto/external/cpl/trousers/lib/libtcs/Makefile
diff -u src/crypto/external/cpl/trousers/lib/libtcs/Makefile:1.1 src/crypto/external/cpl/trousers/lib/libtcs/Makefile:1.2
--- src/crypto/external/cpl/trousers/lib/libtcs/Makefile:1.1	Sat Jan 28 02:15:26 2012
+++ src/crypto/external/cpl/trousers/lib/libtcs/Makefile	Thu Aug 10 06:56:12 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/01/28 02:15:26 christos Exp $
+# $NetBSD: Makefile,v 1.2 2023/08/10 06:56:12 riastradh Exp $
 
 LIBISPRIVATE=yes
 .include "../Makefile.inc"
@@ -18,6 +18,8 @@ CPPFLAGS+=-DTSS_BUILD_PCR_EXTEND -DTSS_B
 CPPFLAGS+=-DTSS_BUILD_AUDIT -DTSS_BUILD_SEALX -DTSS_BUILD_TSS12
 CPPFLAGS+=-DTSS_BUILD_DELEGATION -DTSS_BUILD_QUOTE2  -DTSS_BUILD_CMK
 
+COPTS.tcs_key.c+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
+
 LIB=tcs
 SRCS=\
 crypto.c \

Index: src/crypto/external/cpl/trousers/lib/libtspi/Makefile
diff -u src/crypto/external/cpl/trousers/lib/libtspi/Makefile:1.3 src/crypto/external/cpl/trousers/lib/libtspi/Makefile:1.4
--- src/crypto/external/cpl/trousers/lib/libtspi/Makefile:1.3	Mon Jan  7 15:43:17 2019
+++ src/crypto/external/cpl/trousers/lib/libtspi/Makefile	Thu Aug 10 06:56:12 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2019/01/07 15:43:17 christos Exp $
+# $NetBSD: Makefile,v 1.4 2023/08/10 06:56:12 riastradh Exp $
 .include "../Makefile.inc"
 
 

CVS commit: src/crypto/external/cpl/trousers

2023-08-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Aug 10 06:56:12 UTC 2023

Modified Files:
src/crypto/external/cpl/trousers/bin/tcsd: Makefile
src/crypto/external/cpl/trousers/dist/src/include: tcsd.h
trousers_types.h
src/crypto/external/cpl/trousers/lib/libtcs: Makefile
src/crypto/external/cpl/trousers/lib/libtspi: Makefile

Log Message:
trousers: Make this build again.

- Downgrade address-of-packed-member errors to warnings.  Not sure if
  this is safe, but there's too many to audit.

- Silence deprecation warnings for openssl3.

- Address removal of const qualifier in iconv.

- Nix unused definitions in a .h file, which cause trouble now that
  -fno-common is the default.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/cpl/trousers/bin/tcsd/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/cpl/trousers/dist/src/include/tcsd.h \
src/crypto/external/cpl/trousers/dist/src/include/trousers_types.h
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/cpl/trousers/lib/libtcs/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/cpl/trousers/lib/libtspi/Makefile

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



CVS commit: src/sys

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:44:12 UTC 2023

Modified Files:
src/sys/arch/hpc/stand/hpcboot/mips: mips_arch.h
src/sys/netinet: sctp_structs.h
src/sys/netipsec: key.c

Log Message:
fix typos in comments s/iton/tion/ or s/ton/tion/.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/sctp_structs.h
cvs rdiff -u -r1.281 -r1.282 src/sys/netipsec/key.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/hpc/stand/hpcboot/mips/mips_arch.h
diff -u src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h:1.6 src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h:1.7
--- src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h:1.6	Mon Apr 28 20:23:20 2008
+++ src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h	Thu Aug 10 06:44:11 2023
@@ -1,4 +1,4 @@
-/* -*-C++-*-	$NetBSD: mips_arch.h,v 1.6 2008/04/28 20:23:20 martin Exp $	*/
+/* -*-C++-*-	$NetBSD: mips_arch.h,v 1.7 2023/08/10 06:44:11 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@ public:
 /*
  * 2nd-bootloader.  make sure that PIC and its size is lower than page size.
  * and can't call subroutine.
- * naked funciton can't use stack. if you want to use, remove its declare.
+ * naked function can't use stack. if you want to use, remove its declare.
  * interrupts are disabled. but if access kuseg,(should not occur)
  * it causes TLB exception and then Windows CE enable interrupts again.
  */

Index: src/sys/netinet/sctp_structs.h
diff -u src/sys/netinet/sctp_structs.h:1.3 src/sys/netinet/sctp_structs.h:1.4
--- src/sys/netinet/sctp_structs.h:1.3	Sat Jun 24 05:35:00 2023
+++ src/sys/netinet/sctp_structs.h	Thu Aug 10 06:44:12 2023
@@ -1,5 +1,5 @@
 /*	$KAME: sctp_structs.h,v 1.13 2005/03/06 16:04:18 itojun Exp $	*/
-/*	$NetBSD: sctp_structs.h,v 1.3 2023/06/24 05:35:00 msaitoh Exp $ */
+/*	$NetBSD: sctp_structs.h,v 1.4 2023/08/10 06:44:12 andvar Exp $ */
 
 #ifndef __SCTP_STRUCTS_H__
 #define __SCTP_STRUCTS_H__
@@ -491,7 +491,7 @@ struct sctp_association {
 	unsigned int total_flight;
 	/* Total book size in flight */
 	unsigned int total_flight_count;	/* count of chunks used with book total */
-	/* count of destinaton nets and list of destination nets */
+	/* count of destination nets and list of destination nets */
 	unsigned int numnets;
 
 	/* Total error count on this association */

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.281 src/sys/netipsec/key.c:1.282
--- src/sys/netipsec/key.c:1.281	Fri Jul 21 00:44:38 2023
+++ src/sys/netipsec/key.c	Thu Aug 10 06:44:12 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.281 2023/07/21 00:44:38 knakahara Exp $	*/
+/*	$NetBSD: key.c,v 1.282 2023/08/10 06:44:12 andvar Exp $	*/
 /*	$FreeBSD: key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.281 2023/07/21 00:44:38 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.282 2023/08/10 06:44:12 andvar Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -2240,7 +2240,7 @@ key_spdadd(struct socket *so, struct mbu
 
 	xpl0 = mhp->ext[SADB_X_EXT_POLICY];
 
-	/* checking the direciton. */
+	/* checking the direction. */
 	switch (xpl0->sadb_x_policy_dir) {
 	case IPSEC_DIR_INBOUND:
 	case IPSEC_DIR_OUTBOUND:



CVS commit: src/sys

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:44:12 UTC 2023

Modified Files:
src/sys/arch/hpc/stand/hpcboot/mips: mips_arch.h
src/sys/netinet: sctp_structs.h
src/sys/netipsec: key.c

Log Message:
fix typos in comments s/iton/tion/ or s/ton/tion/.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h
cvs rdiff -u -r1.3 -r1.4 src/sys/netinet/sctp_structs.h
cvs rdiff -u -r1.281 -r1.282 src/sys/netipsec/key.c

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



CVS commit: src/distrib/mvme68k/ramdisk

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:38:15 UTC 2023

Modified Files:
src/distrib/mvme68k/ramdisk: rd.welcome

Log Message:
s/Partititon/Partition/


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/mvme68k/ramdisk/rd.welcome

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

Modified files:

Index: src/distrib/mvme68k/ramdisk/rd.welcome
diff -u src/distrib/mvme68k/ramdisk/rd.welcome:1.4 src/distrib/mvme68k/ramdisk/rd.welcome:1.5
--- src/distrib/mvme68k/ramdisk/rd.welcome:1.4	Wed Mar 10 23:13:09 2010
+++ src/distrib/mvme68k/ramdisk/rd.welcome	Thu Aug 10 06:38:15 2023
@@ -1,7 +1,7 @@
 	Welcome to the NetBSD/mvme68k RAMDISK root!
 
 This environment is designed to do only four things:
- 1:  Partititon your disk (use the command:  disklabel -i -I /dev/rsd?c)
+ 1:  Partition your disk (use the command:  disklabel -i -I /dev/rsd?c)
  2:  Copy a miniroot image into the swap partition  (/dev/rsd?b)
  3:  Make that partition bootable (using 'installboot')
  4:  Reboot (using the swap partition, i.e. /dev/sd?b).



CVS commit: src/distrib/mvme68k/ramdisk

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:38:15 UTC 2023

Modified Files:
src/distrib/mvme68k/ramdisk: rd.welcome

Log Message:
s/Partititon/Partition/


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/mvme68k/ramdisk/rd.welcome

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-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:23:28 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1472 -r1.1473 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1471 -r1.1472 src/sys/dev/pci/pcidevs_data.h

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-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:23:28 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1472 -r1.1473 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1471 -r1.1472 src/sys/dev/pci/pcidevs_data.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/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.1472 src/sys/dev/pci/pcidevs.h:1.1473
--- src/sys/dev/pci/pcidevs.h:1.1472	Wed Aug  9 09:58:00 2023
+++ src/sys/dev/pci/pcidevs.h	Thu Aug 10 06:23:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcidevs.h,v 1.1472 2023/08/09 09:58:00 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1473 2023/08/10 06:23:27 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -9941,7 +9941,7 @@
 #define	PCI_PRODUCT_VIATECH_VX900_PCIE_1	0xb410		/* VX900 PCI Express Root Port 1 */
 #define	PCI_PRODUCT_VIATECH_VT3237_PPB	0xb999		/* K8T890 North / VT8237 South PCI-PCI Bridge */
 #define	PCI_PRODUCT_VIATECH_K8T890_PPB_C238	0xc238		/* K8T890 PCI-PCI Bridge */
-#define	PCI_PRODUCT_VIATECH_VX800_PCI_G0	0xc353		/* VX800/VX820 PCI Express Root Port G0 */
+#define	PCI_PRODUCT_VIATECH_VX800_PCIE_G0	0xc353		/* VX800/VX820 PCI Express Root Port G0 */
 #define	PCI_PRODUCT_VIATECH_P4M900_PPB_2	0xc364		/* CN896/P4M900 PCI-PCI Bridge */
 #define	PCI_PRODUCT_VIATECH_VX900_PCIE_2	0xc410		/* VX900 PCI Express Root Port 2 */
 #define	PCI_PRODUCT_VIATECH_K8T890_PPB_D238	0xd238		/* K8T890 PCI-PCI Bridge */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1471 src/sys/dev/pci/pcidevs_data.h:1.1472
--- src/sys/dev/pci/pcidevs_data.h:1.1471	Wed Aug  9 09:58:00 2023
+++ src/sys/dev/pci/pcidevs_data.h	Thu Aug 10 06:23:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1471 2023/08/09 09:58:00 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1472 2023/08/10 06:23:27 andvar Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -17989,7 +17989,7 @@ static const uint32_t pci_products[] = {
 	41543, 8360, 2173, 42050, 8644, 8725, 6521, 0,
 	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_K8T890_PPB_C238, 
 	41543, 8725, 6521, 0,
-	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VX800_PCI_G0, 
+	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VX800_PCIE_G0, 
 	41591, 615, 4320, 8083, 8096, 42380, 0,
 	PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_P4M900_PPB_2, 
 	41603, 8725, 6521, 0,



CVS commit: src/sys/dev/pci

2023-08-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:22:48 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
rename PCI to PCIE for naming consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1491 -r1.1492 src/sys/dev/pci/pcidevs

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-10 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Aug 10 06:22:48 UTC 2023

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
rename PCI to PCIE for naming consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1491 -r1.1492 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1491 src/sys/dev/pci/pcidevs:1.1492
--- src/sys/dev/pci/pcidevs:1.1491	Wed Aug  9 09:57:35 2023
+++ src/sys/dev/pci/pcidevs	Thu Aug 10 06:22:47 2023
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1491 2023/08/09 09:57:35 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1492 2023/08/10 06:22:47 andvar Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -9934,7 +9934,7 @@ product VIATECH VX800_PPB	0xb353	VX8xx/V
 product VIATECH VX900_PCIE_1	0xb410	VX900 PCI Express Root Port 1
 product VIATECH VT3237_PPB	0xb999	K8T890 North / VT8237 South PCI-PCI Bridge
 product VIATECH K8T890_PPB_C238	0xc238	K8T890 PCI-PCI Bridge
-product VIATECH VX800_PCI_G0	0xc353	VX800/VX820 PCI Express Root Port G0
+product VIATECH VX800_PCIE_G0	0xc353	VX800/VX820 PCI Express Root Port G0
 product VIATECH P4M900_PPB_2	0xc364	CN896/P4M900 PCI-PCI Bridge
 product VIATECH VX900_PCIE_2	0xc410	VX900 PCI Express Root Port 2
 product VIATECH K8T890_PPB_D238	0xd238	K8T890 PCI-PCI Bridge