CVS commit: src/share/man/man4

2021-02-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Feb 12 01:52:09 UTC 2021

Modified Files:
src/share/man/man4: rnd.4

Log Message:
rnd(4): Consistently call it the `global pool'.

The `ready pool' is a term I used in a draft that I never committed.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/share/man/man4/rnd.4

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.37 src/share/man/man4/rnd.4:1.38
--- src/share/man/man4/rnd.4:1.37	Fri Jan 15 15:54:20 2021
+++ src/share/man/man4/rnd.4	Fri Feb 12 01:52:09 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rnd.4,v 1.37 2021/01/15 15:54:20 riastradh Exp $
+.\"	$NetBSD: rnd.4,v 1.38 2021/02/12 01:52:09 riastradh Exp $
 .\"
 .\" Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -521,7 +521,7 @@ entropy of the adversary's state of know
 If the operator is confident that the drivers' estimates of the entropy
 of the sampling processes are too conservative, the operator can issue
 .Dl # sysctl -w kern.entropy.consolidate=1
-to force consolidation into the ready pool.
+to force consolidation into the global pool.
 The operator can also fool the system into thinking it has more entropy
 than it does by feeding data from
 .Pa /dev/urandom



CVS commit: src/sys/arch/macppc/macppc

2021-02-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb 11 19:06:24 UTC 2021

Modified Files:
src/sys/arch/macppc/macppc: locore.S

Log Message:
remove unused/useless #ifdef block


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/macppc/macppc/locore.S

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

Modified files:

Index: src/sys/arch/macppc/macppc/locore.S
diff -u src/sys/arch/macppc/macppc/locore.S:1.74 src/sys/arch/macppc/macppc/locore.S:1.75
--- src/sys/arch/macppc/macppc/locore.S:1.74	Fri Oct 11 21:56:55 2019
+++ src/sys/arch/macppc/macppc/locore.S	Thu Feb 11 19:06:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.74 2019/10/11 21:56:55 macallan Exp $	*/
+/*	$NetBSD: locore.S,v 1.75 2021/02/11 19:06:24 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -90,11 +90,6 @@ __start:
 #ifndef FIRMWORKSBUGS
 	mtmsr	0			/* Disable FPU/MMU/exceptions */
 #endif
-#if defined(PMAP_OEA64_BRIDGE)
-	mfmsr	0			/* Clear SF and ISF bits */
-	clrldi	0,0,3
-	mtmsrd	0
-#endif /* PMAP_OEA64_BRIDGE */
 	isync
 
 /* compute end of kernel memory */



CVS commit: [netbsd-8] src/doc

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 13:05:16 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1652 - #1654


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-8.3

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-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.70 src/doc/CHANGES-8.3:1.1.2.71
--- src/doc/CHANGES-8.3:1.1.2.70	Wed Feb 10 16:57:42 2021
+++ src/doc/CHANGES-8.3	Thu Feb 11 13:05:16 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.70 2021/02/10 16:57:42 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.71 2021/02/11 13:05:16 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1559,3 +1559,21 @@ usr.bin/nl/nl.c	1.13-1.15
 	minor cleanup.
 	[ginsbach, ticket #1651]
 
+sys/dev/scsipi/cd.c1.350
+sys/dev/scsipi/sd.c1.331
+
+	PR 55986: DK_BUSY must have mask as second argument.
+	[ryoon, ticket #1652]
+
+sys/fs/msdosfs/msdosfs_vfsops.c			1.136
+
+	PR 55985: do not insist on valid MSDOS bootloader signatures for
+	mounting an msdosfs.
+	[ryoon, ticket #1653]
+
+sys/arch/x68k/x68k/machdep.c			1.204
+
+	Restore fixes for PR 51663 lost in r1.195 (uvm_hotplug(9) merge),
+	fixing kernel crash dumps for x68k.
+	[tsutsui, ticket #1654]
+



CVS commit: [netbsd-8] src/sys/arch/x68k/x68k

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 13:04:01 UTC 2021

Modified Files:
src/sys/arch/x68k/x68k [netbsd-8]: machdep.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1654):

sys/arch/x68k/x68k/machdep.c: revision 1.204

Restore fixes for PR/51663 lost in r1.195 (uvm_hotplug(9) merge).

The kernel crashdump and savecore(8) on NetBSD/x68k have been broken
(even without EXTNEDED_MEMORY) since NetBSD 8.0. Oops.

Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.196.6.1 src/sys/arch/x68k/x68k/machdep.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/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.196 src/sys/arch/x68k/x68k/machdep.c:1.196.6.1
--- src/sys/arch/x68k/x68k/machdep.c:1.196	Mon Apr  3 17:37:29 2017
+++ src/sys/arch/x68k/x68k/machdep.c	Thu Feb 11 13:04:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.196 2017/04/03 17:37:29 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.196.6.1 2021/02/11 13:04:01 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196 2017/04/03 17:37:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196.6.1 2021/02/11 13:04:01 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -554,7 +554,10 @@ cpu_init_kcore_hdr(void)
 {
 	cpu_kcore_hdr_t *h = _kcore_hdr;
 	struct m68k_kcore_hdr *m = >un._m68k;
-	uvm_physseg_t i;
+	psize_t size;
+#ifdef EXTENDED_MEMORY
+	int i, seg;
+#endif
 
 	memset(_kcore_hdr, 0, sizeof(cpu_kcore_hdr));
 
@@ -603,25 +606,20 @@ cpu_init_kcore_hdr(void)
 	/*
 	 * X68k has multiple RAM segments on some models.
 	 */
-	m->ram_segs[0].start = lowram;
-	m->ram_segs[0].size = mem_size - lowram;
-
-	i = uvm_physseg_get_first();
-	
-for (uvm_physseg_get_next(i); uvm_physseg_valid_p(i); i = uvm_physseg_get_next(i)) {
-		if (uvm_physseg_valid_p(i) == false)
-			break;
-
-		const paddr_t startpfn = uvm_physseg_get_start(i);
-		const paddr_t endpfn = uvm_physseg_get_end(i);
-
-		KASSERT(startpfn != -1 && endpfn != -1);
-
-		m->ram_segs[i].start = 
-		ctob(startpfn);
-		m->ram_segs[i].size  =			
-		ctob(endpfn - startpfn);
+	size = phys_basemem_seg.end - phys_basemem_seg.start;
+	m->ram_segs[0].start = phys_basemem_seg.start;
+	m->ram_segs[0].size  = size;
+#ifdef EXTENDED_MEMORY
+	seg = 1;
+	for (i = 0; i < EXTMEM_SEGS; i++) {
+		size = phys_extmem_seg[i].end - phys_extmem_seg[i].start;
+		if (size == 0)
+			continue;
+		m->ram_segs[seg].start = phys_extmem_seg[i].start;
+		m->ram_segs[seg].size  = size;
+		seg++;
 	}
+#endif
 }
 
 /*



CVS commit: [netbsd-9] src/doc

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 13:03:10 UTC 2021

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

Log Message:
Tickets #1203 - #1205


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-9.2

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.2
diff -u src/doc/CHANGES-9.2:1.1.2.44 src/doc/CHANGES-9.2:1.1.2.45
--- src/doc/CHANGES-9.2:1.1.2.44	Wed Feb 10 16:55:39 2021
+++ src/doc/CHANGES-9.2	Thu Feb 11 13:03:10 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.44 2021/02/10 16:55:39 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.45 2021/02/11 13:03:10 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1505,3 +1505,21 @@ usr.bin/nl/nl.c	1.13-1.15
 	minor cleanup.
 	[ginsbach, ticket #1202]
 
+sys/dev/scsipi/cd.c1.350
+sys/dev/scsipi/sd.c1.331
+
+	PR 55986: DK_BUSY must have mask as second argument.
+	[ryoon, ticket #1203]
+
+sys/fs/msdosfs/msdosfs_vfsops.c			1.136
+
+	PR 55985: do not insist on valid MSDOS bootloader signatures for
+	mounting an msdosfs.
+	[ryoon, ticket #1204]
+
+sys/arch/x68k/x68k/machdep.c			1.204
+
+	Restore fixes for PR 51663 lost in r1.195 (uvm_hotplug(9) merge),
+	fixing kernel crash dumps for x68k.
+	[tsutsui, ticket #1205]
+



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

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 13:02:05 UTC 2021

Modified Files:
src/sys/arch/x68k/x68k [netbsd-9]: machdep.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1205):

sys/arch/x68k/x68k/machdep.c: revision 1.204

Restore fixes for PR/51663 lost in r1.195 (uvm_hotplug(9) merge).

The kernel crashdump and savecore(8) on NetBSD/x68k have been broken
(even without EXTNEDED_MEMORY) since NetBSD 8.0. Oops.

Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.200.4.1 src/sys/arch/x68k/x68k/machdep.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/x68k/x68k/machdep.c
diff -u src/sys/arch/x68k/x68k/machdep.c:1.200 src/sys/arch/x68k/x68k/machdep.c:1.200.4.1
--- src/sys/arch/x68k/x68k/machdep.c:1.200	Thu Apr  4 04:31:01 2019
+++ src/sys/arch/x68k/x68k/machdep.c	Thu Feb 11 13:02:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.200 2019/04/04 04:31:01 isaki Exp $	*/
+/*	$NetBSD: machdep.c,v 1.200.4.1 2021/02/11 13:02:04 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2019/04/04 04:31:01 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200.4.1 2021/02/11 13:02:04 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -568,7 +568,10 @@ cpu_init_kcore_hdr(void)
 {
 	cpu_kcore_hdr_t *h = _kcore_hdr;
 	struct m68k_kcore_hdr *m = >un._m68k;
-	uvm_physseg_t i;
+	psize_t size;
+#ifdef EXTENDED_MEMORY
+	int i, seg;
+#endif
 
 	memset(_kcore_hdr, 0, sizeof(cpu_kcore_hdr));
 
@@ -617,25 +620,20 @@ cpu_init_kcore_hdr(void)
 	/*
 	 * X68k has multiple RAM segments on some models.
 	 */
-	m->ram_segs[0].start = lowram;
-	m->ram_segs[0].size = mem_size - lowram;
-
-	i = uvm_physseg_get_first();
-	
-for (uvm_physseg_get_next(i); uvm_physseg_valid_p(i); i = uvm_physseg_get_next(i)) {
-		if (uvm_physseg_valid_p(i) == false)
-			break;
-
-		const paddr_t startpfn = uvm_physseg_get_start(i);
-		const paddr_t endpfn = uvm_physseg_get_end(i);
-
-		KASSERT(startpfn != -1 && endpfn != -1);
-
-		m->ram_segs[i].start = 
-		ctob(startpfn);
-		m->ram_segs[i].size  =			
-		ctob(endpfn - startpfn);
+	size = phys_basemem_seg.end - phys_basemem_seg.start;
+	m->ram_segs[0].start = phys_basemem_seg.start;
+	m->ram_segs[0].size  = size;
+#ifdef EXTENDED_MEMORY
+	seg = 1;
+	for (i = 0; i < EXTMEM_SEGS; i++) {
+		size = phys_extmem_seg[i].end - phys_extmem_seg[i].start;
+		if (size == 0)
+			continue;
+		m->ram_segs[seg].start = phys_extmem_seg[i].start;
+		m->ram_segs[seg].size  = size;
+		seg++;
 	}
+#endif
 }
 
 /*



CVS commit: [netbsd-8] src/sys/fs/msdosfs

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 12:59:38 UTC 2021

Modified Files:
src/sys/fs/msdosfs [netbsd-8]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by ryoon in ticket #1653):

sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.136

Enable to mount Raspberry Pi Pico's USB mass storage partition
Fix PR kern/55985.

O.k. by thorpej@.
Pull-up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.127.4.2 -r1.127.4.3 src/sys/fs/msdosfs/msdosfs_vfsops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.127.4.2 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.127.4.3
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.127.4.2	Mon Jan 22 12:34:25 2018
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Thu Feb 11 12:59:38 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.127.4.2 2018/01/22 12:34:25 martin Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.127.4.3 2021/02/11 12:59:38 martin Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.127.4.2 2018/01/22 12:34:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.127.4.3 2021/02/11 12:59:38 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -518,6 +518,13 @@ msdosfs_mountfs(struct vnode *devvp, str
 	b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB;
 	b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB;
 
+#if 0
+	/*
+	 * Some FAT partition, for example Raspberry Pi Pico's
+	 * USB mass storage, does not have exptected BOOTSIGs.
+	 * According to FreeBSD's comment, some PC-9800/9821
+	 * FAT floppy disks have similar problems.
+	 */
 	if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) {
 		if (bsp->bs50.bsBootSectSig0 != BOOTSIG0
 		|| bsp->bs50.bsBootSectSig1 != BOOTSIG1) {
@@ -528,6 +535,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 			goto error_exit;
 		}
 	}
+#endif
 
 	pmp = malloc(sizeof(*pmp), M_MSDOSFSMNT, M_WAITOK|M_ZERO);
 	pmp->pm_mountp = mp;



CVS commit: [netbsd-9] src/sys/fs/msdosfs

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 12:58:29 UTC 2021

Modified Files:
src/sys/fs/msdosfs [netbsd-9]: msdosfs_vfsops.c

Log Message:
Pull up following revision(s) (requested by ryoon in ticket #1204):

sys/fs/msdosfs/msdosfs_vfsops.c: revision 1.136

Enable to mount Raspberry Pi Pico's USB mass storage partition
Fix PR kern/55985.

O.k. by thorpej@.
Pull-up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.130.4.1 src/sys/fs/msdosfs/msdosfs_vfsops.c

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

Modified files:

Index: src/sys/fs/msdosfs/msdosfs_vfsops.c
diff -u src/sys/fs/msdosfs/msdosfs_vfsops.c:1.130 src/sys/fs/msdosfs/msdosfs_vfsops.c:1.130.4.1
--- src/sys/fs/msdosfs/msdosfs_vfsops.c:1.130	Mon Sep  3 16:29:34 2018
+++ src/sys/fs/msdosfs/msdosfs_vfsops.c	Thu Feb 11 12:58:29 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdosfs_vfsops.c,v 1.130 2018/09/03 16:29:34 riastradh Exp $	*/
+/*	$NetBSD: msdosfs_vfsops.c,v 1.130.4.1 2021/02/11 12:58:29 martin Exp $	*/
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.130 2018/09/03 16:29:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.130.4.1 2021/02/11 12:58:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -518,6 +518,13 @@ msdosfs_mountfs(struct vnode *devvp, str
 	b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB;
 	b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB;
 
+#if 0
+	/*
+	 * Some FAT partition, for example Raspberry Pi Pico's
+	 * USB mass storage, does not have exptected BOOTSIGs.
+	 * According to FreeBSD's comment, some PC-9800/9821
+	 * FAT floppy disks have similar problems.
+	 */
 	if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) {
 		if (bsp->bs50.bsBootSectSig0 != BOOTSIG0
 		|| bsp->bs50.bsBootSectSig1 != BOOTSIG1) {
@@ -528,6 +535,7 @@ msdosfs_mountfs(struct vnode *devvp, str
 			goto error_exit;
 		}
 	}
+#endif
 
 	pmp = malloc(sizeof(*pmp), M_MSDOSFSMNT, M_WAITOK|M_ZERO);
 	pmp->pm_mountp = mp;



CVS commit: [netbsd-8] src/sys/dev/scsipi

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 12:54:56 UTC 2021

Modified Files:
src/sys/dev/scsipi [netbsd-8]: cd.c sd.c

Log Message:
Pull up following revision(s) (requested by ryoon in ticket #1652):

sys/dev/scsipi/cd.c: revision 1.350
sys/dev/scsipi/sd.c: revision 1.331

PR 55986: Ryo Onodera: DK_BUSY must have mask as second argument. Make cd.c
consistent by also using __BIT()


To generate a diff of this commit:
cvs rdiff -u -r1.340.6.2 -r1.340.6.3 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.324.6.1 -r1.324.6.2 src/sys/dev/scsipi/sd.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/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.340.6.2 src/sys/dev/scsipi/cd.c:1.340.6.3
--- src/sys/dev/scsipi/cd.c:1.340.6.2	Sun Mar 29 12:10:37 2020
+++ src/sys/dev/scsipi/cd.c	Thu Feb 11 12:54:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.340.6.2 2020/03/29 12:10:37 martin Exp $	*/
+/*	$NetBSD: cd.c,v 1.340.6.3 2021/02/11 12:54:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.340.6.2 2020/03/29 12:10:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.340.6.3 2021/02/11 12:54:56 martin Exp $");
 
 #include 
 #include 
@@ -1378,7 +1378,7 @@ cdioctl(dev_t dev, u_long cmd, void *add
 		XS_CTL_IGNORE_NOT_READY | XS_CTL_IGNORE_MEDIA_CHANGE));
 	case DIOCEJECT:
 		if (*(int *)addr == 0) {
-			int pmask = 1 << part;
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.324.6.1 src/sys/dev/scsipi/sd.c:1.324.6.2
--- src/sys/dev/scsipi/sd.c:1.324.6.1	Wed Jun 21 18:18:55 2017
+++ src/sys/dev/scsipi/sd.c	Thu Feb 11 12:54:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.324.6.1 2017/06/21 18:18:55 snj Exp $	*/
+/*	$NetBSD: sd.c,v 1.324.6.2 2021/02/11 12:54:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.324.6.1 2017/06/21 18:18:55 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.324.6.2 2021/02/11 12:54:56 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -950,11 +950,12 @@ sdioctl(dev_t dev, u_long cmd, void *add
 		if ((periph->periph_flags & PERIPH_REMOVABLE) == 0)
 			return (ENOTTY);
 		if (*(int *)addr == 0) {
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.
 			 */
-			if (DK_BUSY(dksc, part) == 0) {
+			if (DK_BUSY(dksc, pmask) == 0) {
 error = scsipi_prevent(periph, SPAMR_ALLOW,
 XS_CTL_IGNORE_NOT_READY);
 if (error)



CVS commit: [netbsd-9] src/sys/dev/scsipi

2021-02-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 11 12:53:28 UTC 2021

Modified Files:
src/sys/dev/scsipi [netbsd-9]: cd.c sd.c

Log Message:
Pull up following revision(s) (requested by ryoon in ticket #1203):

sys/dev/scsipi/cd.c: revision 1.350
sys/dev/scsipi/sd.c: revision 1.331

PR 55986: Ryo Onodera: DK_BUSY must have mask as second argument. Make cd.c
consistent by also using __BIT()


To generate a diff of this commit:
cvs rdiff -u -r1.342.4.1 -r1.342.4.2 src/sys/dev/scsipi/cd.c
cvs rdiff -u -r1.327.4.1 -r1.327.4.2 src/sys/dev/scsipi/sd.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/scsipi/cd.c
diff -u src/sys/dev/scsipi/cd.c:1.342.4.1 src/sys/dev/scsipi/cd.c:1.342.4.2
--- src/sys/dev/scsipi/cd.c:1.342.4.1	Thu Apr  2 19:15:35 2020
+++ src/sys/dev/scsipi/cd.c	Thu Feb 11 12:53:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd.c,v 1.342.4.1 2020/04/02 19:15:35 martin Exp $	*/
+/*	$NetBSD: cd.c,v 1.342.4.2 2021/02/11 12:53:28 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.342.4.1 2020/04/02 19:15:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.342.4.2 2021/02/11 12:53:28 martin Exp $");
 
 #include 
 #include 
@@ -1378,7 +1378,7 @@ cdioctl(dev_t dev, u_long cmd, void *add
 		XS_CTL_IGNORE_NOT_READY | XS_CTL_IGNORE_MEDIA_CHANGE));
 	case DIOCEJECT:
 		if (*(int *)addr == 0) {
-			int pmask = 1 << part;
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.

Index: src/sys/dev/scsipi/sd.c
diff -u src/sys/dev/scsipi/sd.c:1.327.4.1 src/sys/dev/scsipi/sd.c:1.327.4.2
--- src/sys/dev/scsipi/sd.c:1.327.4.1	Sat Mar 21 15:52:09 2020
+++ src/sys/dev/scsipi/sd.c	Thu Feb 11 12:53:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: sd.c,v 1.327.4.1 2020/03/21 15:52:09 martin Exp $	*/
+/*	$NetBSD: sd.c,v 1.327.4.2 2021/02/11 12:53:28 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.327.4.1 2020/03/21 15:52:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.327.4.2 2021/02/11 12:53:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -954,11 +954,12 @@ sdioctl(dev_t dev, u_long cmd, void *add
 		if ((periph->periph_flags & PERIPH_REMOVABLE) == 0)
 			return (ENOTTY);
 		if (*(int *)addr == 0) {
+			int pmask = __BIT(part);
 			/*
 			 * Don't force eject: check that we are the only
 			 * partition open. If so, unlock it.
 			 */
-			if (DK_BUSY(dksc, part) == 0) {
+			if (DK_BUSY(dksc, pmask) == 0) {
 error = scsipi_prevent(periph, SPAMR_ALLOW,
 XS_CTL_IGNORE_NOT_READY);
 if (error)



CVS commit: src/external/mit/xorg/bin/xterm

2021-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb 11 12:30:08 UTC 2021

Modified Files:
src/external/mit/xorg/bin/xterm: Makefile

Log Message:
add new files for xterm 366.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/mit/xorg/bin/xterm/Makefile

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

Modified files:

Index: src/external/mit/xorg/bin/xterm/Makefile
diff -u src/external/mit/xorg/bin/xterm/Makefile:1.19 src/external/mit/xorg/bin/xterm/Makefile:1.20
--- src/external/mit/xorg/bin/xterm/Makefile:1.19	Sun Dec 27 21:13:18 2020
+++ src/external/mit/xorg/bin/xterm/Makefile	Thu Feb 11 12:30:08 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2020/12/27 21:13:18 reinoud Exp $
+#	$NetBSD: Makefile,v 1.20 2021/02/11 12:30:08 mrg Exp $
 
 .include 
 
@@ -8,7 +8,7 @@ SRCS=	button.c charproc.c charsets.c cur
 	misc.c print.c ptydata.c screen.c scrollback.c scrollbar.c tabs.c \
 	util.c xstrings.c TekPrsTbl.c Tekproc.c VTPrsTbl.c main.c \
 	charclass.c precompose.c wcwidth.c xutf8.c cachedGCs.c xtermcap.c \
-	version.c
+	svg.c html.c version.c
 
 CPPFLAGS+=	-I. \
 		-I${X11SRCDIR.${PROG}} \



CVS import: xsrc/external/mit/xterm/dist

2021-02-11 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Thu Feb 11 12:19:58 UTC 2021

Update of /cvsroot/xsrc/external/mit/xterm/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv27093

Log Message:
initial import of xterm-366

Status:

Vendor Tag: xorg
Release Tags:   xterm-366

U xsrc/external/mit/xterm/dist/testxmc.c
C xsrc/external/mit/xterm/dist/misc.c
U xsrc/external/mit/xterm/dist/trace.h
U xsrc/external/mit/xterm/dist/graphics_sixel.c
C xsrc/external/mit/xterm/dist/xterm.man
U xsrc/external/mit/xterm/dist/error.h
U xsrc/external/mit/xterm/dist/button.c
U xsrc/external/mit/xterm/dist/graphics.h
U xsrc/external/mit/xterm/dist/Makefile.in
U xsrc/external/mit/xterm/dist/sinstall.sh
C xsrc/external/mit/xterm/dist/xterm.h
U xsrc/external/mit/xterm/dist/cachedGCs.c
C xsrc/external/mit/xterm/dist/XTerm.ad
U xsrc/external/mit/xterm/dist/main.c
U xsrc/external/mit/xterm/dist/MANIFEST
U xsrc/external/mit/xterm/dist/resize.man
U xsrc/external/mit/xterm/dist/precompose.h
U xsrc/external/mit/xterm/dist/configure.in
U xsrc/external/mit/xterm/dist/charclass.h
U xsrc/external/mit/xterm/dist/config.guess
U xsrc/external/mit/xterm/dist/256colres.h
U xsrc/external/mit/xterm/dist/main.h
U xsrc/external/mit/xterm/dist/88colres.pl
N xsrc/external/mit/xterm/dist/gen-charsets.pl
U xsrc/external/mit/xterm/dist/graphics_regis.c
U xsrc/external/mit/xterm/dist/VTparse.def
U xsrc/external/mit/xterm/dist/df-install.in
U xsrc/external/mit/xterm/dist/UXTerm.ad
C xsrc/external/mit/xterm/dist/linedata.c
U xsrc/external/mit/xterm/dist/TekPrsTbl.c
C xsrc/external/mit/xterm/dist/ptyx.h
U xsrc/external/mit/xterm/dist/xterm.desktop
U xsrc/external/mit/xterm/dist/version.h
U xsrc/external/mit/xterm/dist/configure
U xsrc/external/mit/xterm/dist/graphics.c
U xsrc/external/mit/xterm/dist/util.c
U xsrc/external/mit/xterm/dist/doublechr.c
U xsrc/external/mit/xterm/dist/ptydata.c
U xsrc/external/mit/xterm/dist/link_axp.com
U xsrc/external/mit/xterm/dist/terminfo
U xsrc/external/mit/xterm/dist/make.com
U xsrc/external/mit/xterm/dist/data.c
U xsrc/external/mit/xterm/dist/minstall.in
U xsrc/external/mit/xterm/dist/THANKS
U xsrc/external/mit/xterm/dist/charproc.c
U xsrc/external/mit/xterm/dist/fontutils.h
U xsrc/external/mit/xterm/dist/graphics_regis.h
U xsrc/external/mit/xterm/dist/screen.c
U xsrc/external/mit/xterm/dist/config.sub
U xsrc/external/mit/xterm/dist/vms.c
U xsrc/external/mit/xterm/dist/xterm.log.html
N xsrc/external/mit/xterm/dist/COPYING
U xsrc/external/mit/xterm/dist/ctlseqs.ms
U xsrc/external/mit/xterm/dist/html.c
U xsrc/external/mit/xterm/dist/README.os390
U xsrc/external/mit/xterm/dist/scrollbar.c
U xsrc/external/mit/xterm/dist/uxterm.desktop
U xsrc/external/mit/xterm/dist/KOI8RXTerm.ad
U xsrc/external/mit/xterm/dist/precompose.c
U xsrc/external/mit/xterm/dist/AAA_README_VMS.txt
U xsrc/external/mit/xterm/dist/xutf8.h
U xsrc/external/mit/xterm/dist/NEWS
U xsrc/external/mit/xterm/dist/plink.sh
U xsrc/external/mit/xterm/dist/graphics_sixel.h
C xsrc/external/mit/xterm/dist/scrollback.c
U xsrc/external/mit/xterm/dist/INSTALL
U xsrc/external/mit/xterm/dist/resize.c
U xsrc/external/mit/xterm/dist/run-tic.sh
U xsrc/external/mit/xterm/dist/charsets.c
U xsrc/external/mit/xterm/dist/xstrings.h
U xsrc/external/mit/xterm/dist/xtermcap.h
U xsrc/external/mit/xterm/dist/svg.c
U xsrc/external/mit/xterm/dist/charclass.c
U xsrc/external/mit/xterm/dist/Tests
U xsrc/external/mit/xterm/dist/input.c
U xsrc/external/mit/xterm/dist/XTerm-col.ad
U xsrc/external/mit/xterm/dist/xutf8.c
U xsrc/external/mit/xterm/dist/Imakefile
U xsrc/external/mit/xterm/dist/wcwidth.h
U xsrc/external/mit/xterm/dist/koi8rxterm
U xsrc/external/mit/xterm/dist/VTparse.h
U xsrc/external/mit/xterm/dist/menu.h
U xsrc/external/mit/xterm/dist/gen-pc-fkeys.pl
U xsrc/external/mit/xterm/dist/xstrings.c
U xsrc/external/mit/xterm/dist/xtermcap.c
U xsrc/external/mit/xterm/dist/tabs.c
U xsrc/external/mit/xterm/dist/keysym2ucs.c
U xsrc/external/mit/xterm/dist/menu.c
U xsrc/external/mit/xterm/dist/88colres.h
U xsrc/external/mit/xterm/dist/vms.h
U xsrc/external/mit/xterm/dist/ctlseqs.txt
U xsrc/external/mit/xterm/dist/termcap
U xsrc/external/mit/xterm/dist/aclocal.m4
U xsrc/external/mit/xterm/dist/version.c
U xsrc/external/mit/xterm/dist/install-sh
U xsrc/external/mit/xterm/dist/koi8rxterm.man
U xsrc/external/mit/xterm/dist/256colres.pl
U xsrc/external/mit/xterm/dist/Tekparse.def
U xsrc/external/mit/xterm/dist/xterm_axp.opt
U xsrc/external/mit/xterm/dist/uxterm
C xsrc/external/mit/xterm/dist/fontutils.c
U xsrc/external/mit/xterm/dist/README
U xsrc/external/mit/xterm/dist/xterm.appdata.xml
U xsrc/external/mit/xterm/dist/xterm_io.h
U xsrc/external/mit/xterm/dist/xtermcfg.hin
U xsrc/external/mit/xterm/dist/xterm.dat
U xsrc/external/mit/xterm/dist/data.h
U xsrc/external/mit/xterm/dist/uxterm.man
U xsrc/external/mit/xterm/dist/Tekparse.h
U xsrc/external/mit/xterm/dist/Tekproc.c
U xsrc/external/mit/xterm/dist/keysym2ucs.h
U xsrc/external/mit/xterm/dist/VTPrsTbl.c
U 

CVS commit: src/libexec/httpd

2021-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb 11 09:57:53 UTC 2021

Modified Files:
src/libexec/httpd: bozohttpd.c bozohttpd.h main.c
src/libexec/httpd/libbozohttpd: libbozohttpd.3

Log Message:
clean up issues detected by address sanitizer (just some memory
leaks that only apply to the library version.)

XXX: the handling of hr_file and its variants is more crappy
again - the prior clean up is slightly less clean now, but at
least it does not leak memory.

XXX2: cgi-bin test hangs with address sanitizer.  don't know
why yet..


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.66 -r1.67 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.25 -r1.26 src/libexec/httpd/main.c
cvs rdiff -u -r1.4 -r1.5 src/libexec/httpd/libbozohttpd/libbozohttpd.3

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.125 src/libexec/httpd/bozohttpd.c:1.126
--- src/libexec/httpd/bozohttpd.c:1.125	Thu Feb 11 09:23:55 2021
+++ src/libexec/httpd/bozohttpd.c	Thu Feb 11 09:57:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.125 2021/02/11 09:23:55 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.126 2021/02/11 09:57:52 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -239,6 +239,20 @@ bozo_set_pref(bozohttpd_t *httpd, bozopr
 	return 1;
 }
 
+static void
+bozo_clear_prefs(bozohttpd_t *httpd, bozoprefs_t *prefs)
+{
+	size_t	i;
+
+	for (i = 0; i < prefs->count; i++) {
+		free(prefs->name[i]);
+		free(prefs->value[i]);
+	}
+
+	free(prefs->name);
+	free(prefs->value);
+}
+
 /*
  * get a variable's value, or NULL
  */
@@ -339,8 +353,11 @@ bozo_clean_request(bozo_httpreq_t *reque
 	free(request->hr_serverport);
 	free(request->hr_virthostname);
 	free(request->hr_file_free);
+	/* XXX this is gross */
 	if (request->hr_file_free != request->hr_oldfile)
 		free(request->hr_oldfile);
+	else
+		free(request->hr_file);
 	free(request->hr_query);
 	free(request->hr_host);
 	bozo_user_free(request->hr_user);
@@ -2694,6 +2711,23 @@ bozo_setup(bozohttpd_t *httpd, bozoprefs
 	return 1;
 }
 
+void
+bozo_cleanup(bozohttpd_t *httpd, bozoprefs_t *prefs)
+{
+	bozo_clear_prefs(httpd, prefs);
+
+	free(httpd->virthostname);
+	free(httpd->errorbuf);
+	free(httpd->getln_buffer);
+	free(httpd->slashdir);
+#define bozo_unconst(x) ((void *)(uintptr_t)x)
+	free(bozo_unconst(httpd->server_software));
+	free(bozo_unconst(httpd->index_html));
+	free(bozo_unconst(httpd->dir_readme));
+	free(bozo_unconst(httpd->public_html));
+#undef bozo_unconst
+}
+
 int
 bozo_get_version(char *buf, size_t size)
 {

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.66 src/libexec/httpd/bozohttpd.h:1.67
--- src/libexec/httpd/bozohttpd.h:1.66	Thu Feb 11 09:23:55 2021
+++ src/libexec/httpd/bozohttpd.h	Thu Feb 11 09:57:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.66 2021/02/11 09:23:55 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.67 2021/02/11 09:57:52 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -443,6 +443,7 @@ int bozo_init_httpd(bozohttpd_t *);
 int bozo_init_prefs(bozohttpd_t *, bozoprefs_t *);
 int bozo_set_defaults(bozohttpd_t *, bozoprefs_t *);
 int bozo_setup(bozohttpd_t *, bozoprefs_t *, const char *, const char *);
+void bozo_cleanup(bozohttpd_t *, bozoprefs_t *);
 bozo_httpreq_t *bozo_read_request(bozohttpd_t *);
 void bozo_process_request(bozo_httpreq_t *);
 void bozo_clean_request(bozo_httpreq_t *);

Index: src/libexec/httpd/main.c
diff -u src/libexec/httpd/main.c:1.25 src/libexec/httpd/main.c:1.26
--- src/libexec/httpd/main.c:1.25	Thu Oct 15 04:21:53 2020
+++ src/libexec/httpd/main.c	Thu Feb 11 09:57:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.25 2020/10/15 04:21:53 mrg Exp $	*/
+/*	$NetBSD: main.c,v 1.26 2021/02/11 09:57:52 mrg Exp $	*/
 
 /*	$eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $	*/
 /* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp 	*/
@@ -408,5 +408,7 @@ main(int argc, char **argv)
 		}
 	} while (httpd.background);
 
+	bozo_cleanup(, );
+
 	return (0);
 }

Index: src/libexec/httpd/libbozohttpd/libbozohttpd.3
diff -u src/libexec/httpd/libbozohttpd/libbozohttpd.3:1.4 src/libexec/httpd/libbozohttpd/libbozohttpd.3:1.5
--- src/libexec/httpd/libbozohttpd/libbozohttpd.3:1.4	Sat Feb  4 01:32:54 2017
+++ src/libexec/httpd/libbozohttpd/libbozohttpd.3	Thu Feb 11 09:57:53 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: libbozohttpd.3,v 1.4 2017/02/04 01:32:54 mrg Exp $
+.\" $NetBSD: libbozohttpd.3,v 1.5 2021/02/11 09:57:53 mrg Exp $
 .\"
 .\" $eterna: libbozohttpd.3,v 1.2 2010/05/10 02:48:23 mrg Exp $
 .\"
@@ -29,7 +29,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 2, 2017
+.Dd February 11, 2021
 .Dt LIBBOZOHTTPD 3
 .Os
 .Sh 

CVS commit: src/libexec/httpd

2021-02-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb 11 09:23:56 UTC 2021

Modified Files:
src/libexec/httpd: CHANGES bozohttpd.c bozohttpd.h cgi-bozo.c
src/libexec/httpd/testsuite: Makefile
Added Files:
src/libexec/httpd/testsuite: t16.in t16.out t17.in t17.out t18.in
t18.out

Log Message:
changes in bozohttpd 20210210:
o  fix various NULL derefs from malformed headers.  mostly from
   .


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.124 -r1.125 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.65 -r1.66 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.51 -r1.52 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.13 -r1.14 src/libexec/httpd/testsuite/Makefile
cvs rdiff -u -r0 -r1.1 src/libexec/httpd/testsuite/t16.in \
src/libexec/httpd/testsuite/t16.out src/libexec/httpd/testsuite/t17.in \
src/libexec/httpd/testsuite/t17.out src/libexec/httpd/testsuite/t18.in \
src/libexec/httpd/testsuite/t18.out

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.44 src/libexec/httpd/CHANGES:1.45
--- src/libexec/httpd/CHANGES:1.44	Thu Oct 15 04:21:53 2020
+++ src/libexec/httpd/CHANGES	Thu Feb 11 09:23:55 2021
@@ -1,4 +1,8 @@
-$NetBSD: CHANGES,v 1.44 2020/10/15 04:21:53 mrg Exp $
+$NetBSD: CHANGES,v 1.45 2021/02/11 09:23:55 mrg Exp $
+
+changes in bozohttpd 20210210:
+	o  fix various NULL derefs from malformed headers.  mostly from
+	   .
 
 changes in bozohttpd 20201014:
 	o  also set -D_GNU_SOURCE in Makefile.boot.  from

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.124 src/libexec/httpd/bozohttpd.c:1.125
--- src/libexec/httpd/bozohttpd.c:1.124	Thu Nov 19 10:45:36 2020
+++ src/libexec/httpd/bozohttpd.c	Thu Feb 11 09:23:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.124 2020/11/19 10:45:36 hannken Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.125 2021/02/11 09:23:55 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -108,7 +108,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20201014"
+#define SERVER_SOFTWARE		"bozohttpd/20210210"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -338,8 +338,9 @@ bozo_clean_request(bozo_httpreq_t *reque
 	free(request->hr_remoteaddr);
 	free(request->hr_serverport);
 	free(request->hr_virthostname);
-	free(request->hr_file);
-	free(request->hr_oldfile);
+	free(request->hr_file_free);
+	if (request->hr_file_free != request->hr_oldfile)
+		free(request->hr_oldfile);
 	free(request->hr_query);
 	free(request->hr_host);
 	bozo_user_free(request->hr_user);
@@ -619,6 +620,7 @@ bozo_read_request(bozohttpd_t *httpd)
 	request->hr_last_byte_pos = -1;
 	request->hr_if_modified_since = NULL;
 	request->hr_virthostname = NULL;
+	request->hr_file_free = NULL;
 	request->hr_file = NULL;
 	request->hr_oldfile = NULL;
 	SIMPLEQ_INIT(>hr_replheaders);
@@ -735,7 +737,7 @@ bozo_read_request(bozohttpd_t *httpd)
 
 			/* we allocate return space in file and query only */
 			parse_request(httpd, str, , , , );
-			request->hr_file = file;
+			request->hr_file_free = request->hr_file = file;
 			request->hr_query = query;
 			if (method == NULL) {
 bozo_http_error(httpd, 404, NULL, "null method");
@@ -771,11 +773,17 @@ bozo_read_request(bozohttpd_t *httpd)
 
 			val = bozostrnsep(, ":", );
 			debug((httpd, DEBUG_EXPLODING, "read_req2: after "
-			"bozostrnsep: str `%s' val `%s'", str, val ? val : ""));
+			"bozostrnsep: str `%s' val `%s'",
+			str ? str : "", val ? val : ""));
 			if (val == NULL || len == -1) {
 bozo_http_error(httpd, 404, request, "no header");
 goto cleanup;
 			}
+			if (str == NULL) {
+bozo_http_error(httpd, 404, request,
+"malformed header");
+goto cleanup;
+			}
 			while (*str == ' ' || *str == '\t')
 len--, str++;
 			while (*val == ' ' || *val == '\t')
@@ -1284,8 +1292,8 @@ check_remap(bozo_httpreq_t *request)
 		strcpy(newfile+rlen, file + len);
 		debug((httpd, DEBUG_NORMAL, "remapping found '%s'",
 		newfile));
-		free(request->hr_file);
-		request->hr_file = newfile;
+		free(request->hr_file_free);
+		request->hr_file_free = request->hr_file = newfile;
 	}
 
 	munmap(fmap, st.st_size);
@@ -1313,9 +1321,6 @@ check_virtual(bozo_httpreq_t *request)
 	debug((httpd, DEBUG_OBESE,
 	   "checking for http:// virtual host in '%s'", file));
 	if (strncasecmp(file, "http://;, 7) == 0) {
-		/* bozostrdup() might access it. */
-		char *old_file = request->hr_file;
-
 		/* we would do virtual hosting here? */
 		file += 7;
 		/* RFC 2616 (HTTP/1.1), 5.2: URI takes precedence over Host: */
@@ -1324,8 +1329,9 @@ check_virtual(bozo_httpreq_t *request)
 		if ((s = strchr(request->hr_host, '/')) != NULL)
 			*s = '\0';
 		s = strchr(file, 

CVS commit: src/sys/arch/aarch64/aarch64

2021-02-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Feb 11 08:35:12 UTC 2021

Modified Files:
src/sys/arch/aarch64/aarch64: copyinout.S cpufunc_asm_armv8.S fusu.S
idle_machdep.S lock_stubs.S pmap_page.S

Log Message:
include "opt_gprof.h" so that _PROF_PROLOGUE works properly in ENTRY() macro in 
*.S files


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/aarch64/copyinout.S
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/aarch64/fusu.S
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/idle_machdep.S
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/lock_stubs.S
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/aarch64/aarch64/pmap_page.S

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/copyinout.S
diff -u src/sys/arch/aarch64/aarch64/copyinout.S:1.15 src/sys/arch/aarch64/aarch64/copyinout.S:1.16
--- src/sys/arch/aarch64/aarch64/copyinout.S:1.15	Wed Aug 12 13:19:35 2020
+++ src/sys/arch/aarch64/aarch64/copyinout.S	Thu Feb 11 08:35:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: copyinout.S,v 1.15 2020/08/12 13:19:35 skrll Exp $ */
+/* $NetBSD: copyinout.S,v 1.16 2021/02/11 08:35:11 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,11 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_gprof.h"
 #include 
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: copyinout.S,v 1.15 2020/08/12 13:19:35 skrll Exp $");
+RCSID("$NetBSD: copyinout.S,v 1.16 2021/02/11 08:35:11 ryo Exp $");
 
 #ifdef ARMV81_PAN
 #define PAN_ENABLE	\

Index: src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S
diff -u src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.7 src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.8
--- src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S:1.7	Sun Jul 19 07:18:07 2020
+++ src/sys/arch/aarch64/aarch64/cpufunc_asm_armv8.S	Thu Feb 11 08:35:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc_asm_armv8.S,v 1.7 2020/07/19 07:18:07 ryo Exp $	*/
+/*	$NetBSD: cpufunc_asm_armv8.S,v 1.8 2021/02/11 08:35:11 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 Robin Randhawa
@@ -33,6 +33,7 @@
  */
 
 #include "opt_cputypes.h"
+#include "opt_gprof.h"
 #include "opt_multiprocessor.h"
 #include 
 

Index: src/sys/arch/aarch64/aarch64/fusu.S
diff -u src/sys/arch/aarch64/aarch64/fusu.S:1.10 src/sys/arch/aarch64/aarch64/fusu.S:1.11
--- src/sys/arch/aarch64/aarch64/fusu.S:1.10	Wed Aug 12 13:19:35 2020
+++ src/sys/arch/aarch64/aarch64/fusu.S	Thu Feb 11 08:35:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: fusu.S,v 1.10 2020/08/12 13:19:35 skrll Exp $	*/
+/*	$NetBSD: fusu.S,v 1.11 2021/02/11 08:35:11 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2019 The NetBSD Foundation, Inc.
@@ -29,10 +29,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_gprof.h"
 #include 
 #include "assym.h"
 
-RCSID("$NetBSD: fusu.S,v 1.10 2020/08/12 13:19:35 skrll Exp $");
+RCSID("$NetBSD: fusu.S,v 1.11 2021/02/11 08:35:11 ryo Exp $");
 
 #ifdef ARMV81_PAN
 #define PAN_ENABLE	\

Index: src/sys/arch/aarch64/aarch64/idle_machdep.S
diff -u src/sys/arch/aarch64/aarch64/idle_machdep.S:1.6 src/sys/arch/aarch64/aarch64/idle_machdep.S:1.7
--- src/sys/arch/aarch64/aarch64/idle_machdep.S:1.6	Wed Aug 12 13:19:35 2020
+++ src/sys/arch/aarch64/aarch64/idle_machdep.S	Thu Feb 11 08:35:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: idle_machdep.S,v 1.6 2020/08/12 13:19:35 skrll Exp $ */
+/* $NetBSD: idle_machdep.S,v 1.7 2021/02/11 08:35:12 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -29,13 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_arm_intr_impl.h"
+#include "opt_ddb.h"
+#include "opt_gprof.h"
 #include 
 #include 
 #include "assym.h"
-#include "opt_arm_intr_impl.h"
-#include "opt_ddb.h"
 
-RCSID("$NetBSD: idle_machdep.S,v 1.6 2020/08/12 13:19:35 skrll Exp $");
+RCSID("$NetBSD: idle_machdep.S,v 1.7 2021/02/11 08:35:12 ryo Exp $");
 
 #ifdef ARM_INTR_IMPL
 #include ARM_INTR_IMPL

Index: src/sys/arch/aarch64/aarch64/lock_stubs.S
diff -u src/sys/arch/aarch64/aarch64/lock_stubs.S:1.3 src/sys/arch/aarch64/aarch64/lock_stubs.S:1.4
--- src/sys/arch/aarch64/aarch64/lock_stubs.S:1.3	Tue Oct 13 21:27:18 2020
+++ src/sys/arch/aarch64/aarch64/lock_stubs.S	Thu Feb 11 08:35:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.S,v 1.3 2020/10/13 21:27:18 skrll Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.4 2021/02/11 08:35:12 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -29,13 +29,14 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "opt_gprof.h"
 #include "opt_lockdebug.h"
 
 #include 
 
 #include "assym.h"
 
-RCSID("$NetBSD: lock_stubs.S,v 1.3 2020/10/13 21:27:18 skrll Exp $")
+RCSID("$NetBSD: lock_stubs.S,v 1.4 2021/02/11 08:35:12 ryo Exp $")
 
 #ifndef LOCKDEBUG
 /*

Index: src/sys/arch/aarch64/aarch64/pmap_page.S
diff -u