CVS commit: src/sys/dev/pci

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:26:37 UTC 2022

Modified Files:
src/sys/dev/pci: if_ixl.c if_ixlvar.h

Log Message:
ixl: Added support for Intel ethernet X710-T*L


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pci/if_ixl.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ixlvar.h

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

Modified files:

Index: src/sys/dev/pci/if_ixl.c
diff -u src/sys/dev/pci/if_ixl.c:1.77 src/sys/dev/pci/if_ixl.c:1.78
--- src/sys/dev/pci/if_ixl.c:1.77	Wed Jun 16 00:21:18 2021
+++ src/sys/dev/pci/if_ixl.c	Wed Mar 16 05:26:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixl.c,v 1.77 2021/06/16 00:21:18 riastradh Exp $	*/
+/*	$NetBSD: if_ixl.c,v 1.78 2022/03/16 05:26:37 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2013-2015, Intel Corporation
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.77 2021/06/16 00:21:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ixl.c,v 1.78 2022/03/16 05:26:37 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -899,12 +899,18 @@ static const struct ixl_phy_type ixl_phy
 	{ 1ULL << IXL_PHY_TYPE_25GBASE_LR,	IFM_25G_LR },
 	{ 1ULL << IXL_PHY_TYPE_25GBASE_AOC,	IFM_25G_AOC },
 	{ 1ULL << IXL_PHY_TYPE_25GBASE_ACC,	IFM_25G_ACC },
+	{ 1ULL << IXL_PHY_TYPE_2500BASE_T_1,	IFM_2500_T },
+	{ 1ULL << IXL_PHY_TYPE_5000BASE_T_1,	IFM_5000_T },
+	{ 1ULL << IXL_PHY_TYPE_2500BASE_T_2,	IFM_2500_T },
+	{ 1ULL << IXL_PHY_TYPE_5000BASE_T_2,	IFM_5000_T },
 };
 
 static const struct ixl_speed_type ixl_speed_type_map[] = {
 	{ IXL_AQ_LINK_SPEED_40GB,		IF_Gbps(40) },
 	{ IXL_AQ_LINK_SPEED_25GB,		IF_Gbps(25) },
 	{ IXL_AQ_LINK_SPEED_10GB,		IF_Gbps(10) },
+	{ IXL_AQ_LINK_SPEED_5000MB,		IF_Mbps(5000) },
+	{ IXL_AQ_LINK_SPEED_2500MB,		IF_Mbps(2500) },
 	{ IXL_AQ_LINK_SPEED_1000MB,		IF_Mbps(1000) },
 	{ IXL_AQ_LINK_SPEED_100MB,		IF_Mbps(100)},
 };
@@ -949,7 +955,8 @@ static const struct ixl_product ixl_prod
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_XL710_QSFP_A },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_XL710_QSFP_B },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_XL710_QSFP_C },
-	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_10G_T },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_10G_T_1 },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_10G_T_2 },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_XL710_20G_BP_1 },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_XL710_20G_BP_2 },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_T4_10G },
@@ -961,6 +968,8 @@ static const struct ixl_product ixl_prod
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X722_1G_BASET },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X722_10G_BASET },
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X722_I_SFP },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_10G_SFP },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_X710_10G_BP },
 	/* required last entry */
 	{0, 0}
 };
@@ -1836,12 +1845,15 @@ ixl_mactype(pci_product_id_t id)
 	case PCI_PRODUCT_INTEL_XL710_QSFP_A:
 	case PCI_PRODUCT_INTEL_XL710_QSFP_B:
 	case PCI_PRODUCT_INTEL_XL710_QSFP_C:
-	case PCI_PRODUCT_INTEL_X710_10G_T:
+	case PCI_PRODUCT_INTEL_X710_10G_T_1:
+	case PCI_PRODUCT_INTEL_X710_10G_T_2:
 	case PCI_PRODUCT_INTEL_XL710_20G_BP_1:
 	case PCI_PRODUCT_INTEL_XL710_20G_BP_2:
 	case PCI_PRODUCT_INTEL_X710_T4_10G:
 	case PCI_PRODUCT_INTEL_XXV710_25G_BP:
 	case PCI_PRODUCT_INTEL_XXV710_25G_SFP28:
+	case PCI_PRODUCT_INTEL_X710_10G_SFP:
+	case PCI_PRODUCT_INTEL_X710_10G_BP:
 		return I40E_MAC_XL710;
 
 	case PCI_PRODUCT_INTEL_X722_KX:

Index: src/sys/dev/pci/if_ixlvar.h
diff -u src/sys/dev/pci/if_ixlvar.h:1.7 src/sys/dev/pci/if_ixlvar.h:1.8
--- src/sys/dev/pci/if_ixlvar.h:1.7	Tue Sep  8 10:05:47 2020
+++ src/sys/dev/pci/if_ixlvar.h	Wed Mar 16 05:26:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ixlvar.h,v 1.7 2020/09/08 10:05:47 yamaguchi Exp $	*/
+/*	$NetBSD: if_ixlvar.h,v 1.8 2022/03/16 05:26:37 yamaguchi Exp $	*/
 
 /*
  * Copyright (c) 2019 Internet Initiative Japan, Inc.
@@ -326,12 +326,20 @@ struct ixl_aq_switch_config_element {
 #define IXL_PHY_TYPE_25GBASE_AOC	0x23
 #define IXL_PHY_TYPE_25GBASE_ACC	0x24
 
+#define IXL_PHY_TYPE_2500BASE_T_1	0x26
+#define IXL_PHY_TYPE_5000BASE_T_1	0x27
+
+#define IXL_PHY_TYPE_2500BASE_T_2	0x30
+#define IXL_PHY_TYPE_5000BASE_T_2	0x31
+
+#define IXL_PHY_LINK_SPEED_2500MB	(1 << 0)
 #define IXL_PHY_LINK_SPEED_100MB	(1 << 1)
 #define IXL_PHY_LINK_SPEED_1000MB	(1 << 2)
 #define IXL_PHY_LINK_SPEED_10GB		(1 << 3)
 #define IXL_PHY_LINK_SPEED_40GB		(1 << 4)
 #define IXL_PHY_LINK_SPEED_20GB		(1 << 5)
 #define IXL_PHY_LINK_SPEED_25GB		(1 << 6)
+#define IXL_PHY_LINK_SPEED_5000MB	(1 << 7)
 
 #define IXL_PHY_ABILITY_PAUSE_TX	(1 << 0)
 #define IXL_PHY_ABILITY_PAUSE_RX	(1 << 1)
@@ -363,6 +371,10 @@ struct ixl_aq_phy_abilities {
 #define IXL_AQ_PHY_TYPE_EXT_25G_CR	0x02
 #define IXL_AQ_PHY_TYPE_EXT_25G_SR	0x04
 #define IXL_AQ_PHY_TYPE_EXT_25G_LR	0x08
+#define IXL_AQ_PHY_TYPE_EXT_25G_AOC	0x10
+#define IXL_AQ_PHY_TYPE_EXT_25G_ACC	0

CVS commit: src/sys/dev/pci

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:26:37 UTC 2022

Modified Files:
src/sys/dev/pci: if_ixl.c if_ixlvar.h

Log Message:
ixl: Added support for Intel ethernet X710-T*L


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/pci/if_ixl.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ixlvar.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

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:23:52 UTC 2022

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.1433 -r1.1434 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1432 -r1.1433 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.1433 src/sys/dev/pci/pcidevs.h:1.1434
--- src/sys/dev/pci/pcidevs.h:1.1433	Tue Feb 15 12:01:54 2022
+++ src/sys/dev/pci/pcidevs.h	Wed Mar 16 05:23:51 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.1433 2022/02/15 12:01:54 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.1434 2022/03/16 05:23:51 yamaguchi Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1449 2022/02/15 12:01:28 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1450 2022/03/16 05:20:11 yamaguchi Exp
  */
 
 /*
@@ -4007,6 +4007,8 @@
 #define	PCI_PRODUCT_INTEL_82801H_LAN	0x104b		/* i82801H LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801H_IFE_LAN	0x104c		/* i82801H (IFE) LAN Controller */
 #define	PCI_PRODUCT_INTEL_82801H_M_LAN	0x104d		/* i82801H (M) LAN Controller */
+#define	PCI_PRODUCT_INTEL_X710_10G_SFP	0x104e		/* X710 10GbE SFP+ */
+#define	PCI_PRODUCT_INTEL_X710_10G_BP	0x104f		/* X710 10GbE Backplane */
 #define	PCI_PRODUCT_INTEL_PRO_100_VM_6	0x1050		/* PRO/100 VM Network Controller w/ 82562ET/EZ PHY */
 #define	PCI_PRODUCT_INTEL_82801EB_LAN	0x1051		/* 82801EB/ER 10/100 Ethernet */
 #define	PCI_PRODUCT_INTEL_PRO_100_VM_7	0x1052		/* PRO/100 VM Network Connection */
@@ -4217,7 +4219,7 @@
 #define	PCI_PRODUCT_INTEL_XL710_QSFP_A	0x1583		/* XL710 40GbE QSFP+ */
 #define	PCI_PRODUCT_INTEL_XL710_QSFP_B	0x1584		/* XL710 40GbE QSFP+ */
 #define	PCI_PRODUCT_INTEL_XL710_QSFP_C	0x1585		/* XL710 40GbE QSFP+ */
-#define	PCI_PRODUCT_INTEL_X710_10G_T	0x1586		/* X710 10GBaseT Ethernet */
+#define	PCI_PRODUCT_INTEL_X710_10G_T_1	0x1586		/* X710 10GBaseT Ethernet */
 #define	PCI_PRODUCT_INTEL_XL710_20G_BP_1	0x1587		/* XL710 20GbE Backplane */
 #define	PCI_PRODUCT_INTEL_XL710_20G_BP_2	0x1588		/* XL710 20GbE Backplane */
 #define	PCI_PRODUCT_INTEL_X710_T4_10G	0x1589		/* X710-T4 10GbaseT */
@@ -4273,6 +4275,7 @@
 #define	PCI_PRODUCT_INTEL_I219_V14	0x15fa		/* I219-V (14) Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_I219_LM13	0x15fb		/* I219-LM (13) Ethernet Connection */
 #define	PCI_PRODUCT_INTEL_I219_V13	0x15fc		/* I219-V (13) Ethernet Connection */
+#define	PCI_PRODUCT_INTEL_X710_10G_T_2	0x15ff		/* X710 10GbE Ethernet */
 #define	PCI_PRODUCT_INTEL_CORE5G_HB_1	0x1604		/* Core 5G Host Bridge */
 #define	PCI_PRODUCT_INTEL_CORE5G_M_GT1	0x1606		/* HD Graphics (GT1) */
 #define	PCI_PRODUCT_INTEL_CORE5G_HDA_1	0x160c		/* Core 5G HD Audio */

Index: src/sys/dev/pci/pcidevs_data.h
diff -u src/sys/dev/pci/pcidevs_data.h:1.1432 src/sys/dev/pci/pcidevs_data.h:1.1433
--- src/sys/dev/pci/pcidevs_data.h:1.1432	Tue Feb 15 12:01:54 2022
+++ src/sys/dev/pci/pcidevs_data.h	Wed Mar 16 05:23:51 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs_data.h,v 1.1432 2022/02/15 12:01:54 msaitoh Exp $	*/
+/*	$NetBSD: pcidevs_data.h,v 1.1433 2022/03/16 05:23:51 yamaguchi Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: pcidevs,v 1.1449 2022/02/15 12:01:28 msaitoh Exp
+ *	NetBSD: pcidevs,v 1.1450 2022/03/16 05:20:11 yamaguchi Exp
  */
 
 /*
@@ -6711,10 +6711,14 @@ static const uint32_t pci_products[] = {
 	24478, 24500, 4525, 6413, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801H_M_LAN, 
 	24478, 1773, 4525, 6413, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_X710_10G_SFP, 
+	24506, 17174, 24511, 0,
+	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_X710_10G_BP, 
+	24506, 17174, 24516, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_100_VM_6, 
 	24378, 24400, 3879, 6413, 6114, 24411, 24422, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801EB_LAN, 
-	24506, 5777, 5675, 0,
+	24526, 5777, 5675, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_100_VM_7, 
 	24378, 24400, 3879, 23860, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_100_VM_8, 
@@ -6730,13 +6734,13 @@ static const uint32_t pci_products[] = {
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_100_M, 
 	24378, 12639, 3879, 6413, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82571EB_COPPER, 
-	24517, 7845, 5675, 0,
+	24537, 7845, 5675, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82571EB_FIBER, 
-	24517, 24254, 5675, 0,
+	24537, 24254, 5675, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82571EB_SERDES, 
-	24517, 5667, 5675, 24369, 0,
+	24537, 5667, 5675, 24369, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_82801FB_LAN_2, 
-	24526, 5777, 5675, 0,
+	24546, 5777, 5675, 0,
 	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_PRO_100_VE_9, 
 	24378, 24397, 

CVS commit: src/sys/dev/pci

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:23:52 UTC 2022

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.1433 -r1.1434 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1432 -r1.1433 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

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:20:11 UTC 2022

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

Log Message:
Added Intel X710 devices and rename X710_10G_T to X710_10G_T_1


To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 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

2022-03-15 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Wed Mar 16 05:20:11 UTC 2022

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

Log Message:
Added Intel X710 devices and rename X710_10G_T to X710_10G_T_1


To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 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.1449 src/sys/dev/pci/pcidevs:1.1450
--- src/sys/dev/pci/pcidevs:1.1449	Tue Feb 15 12:01:28 2022
+++ src/sys/dev/pci/pcidevs	Wed Mar 16 05:20:11 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1449 2022/02/15 12:01:28 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1450 2022/03/16 05:20:11 yamaguchi Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4000,6 +4000,8 @@ product INTEL 82801H_AMT	0x104a	i82801H 
 product INTEL 82801H_LAN	0x104b	i82801H LAN Controller
 product INTEL 82801H_IFE_LAN	0x104c	i82801H (IFE) LAN Controller
 product INTEL 82801H_M_LAN	0x104d	i82801H (M) LAN Controller
+product INTEL X710_10G_SFP	0x104e	X710 10GbE SFP+
+product INTEL X710_10G_BP	0x104f	X710 10GbE Backplane
 product INTEL PRO_100_VM_6	0x1050	PRO/100 VM Network Controller w/ 82562ET/EZ PHY
 product INTEL 82801EB_LAN	0x1051	82801EB/ER 10/100 Ethernet
 product INTEL PRO_100_VM_7	0x1052	PRO/100 VM Network Connection
@@ -4210,7 +4212,7 @@ product INTEL XL710_KX_C	0x1581	XL710 KX
 product INTEL XL710_QSFP_A	0x1583	XL710 40GbE QSFP+
 product INTEL XL710_QSFP_B	0x1584	XL710 40GbE QSFP+
 product INTEL XL710_QSFP_C	0x1585	XL710 40GbE QSFP+
-product INTEL X710_10G_T	0x1586	X710 10GBaseT Ethernet
+product INTEL X710_10G_T_1	0x1586	X710 10GBaseT Ethernet
 product INTEL XL710_20G_BP_1	0x1587	XL710 20GbE Backplane
 product INTEL XL710_20G_BP_2	0x1588	XL710 20GbE Backplane
 product INTEL X710_T4_10G	0x1589	X710-T4 10GbaseT
@@ -4266,6 +4268,7 @@ product INTEL I219_LM14		0x15f9	I219-LM 
 product INTEL I219_V14		0x15fa	I219-V (14) Ethernet Connection
 product INTEL I219_LM13		0x15fb	I219-LM (13) Ethernet Connection
 product INTEL I219_V13		0x15fc	I219-V (13) Ethernet Connection
+product INTEL X710_10G_T_2	0x15ff	X710 10GbE Ethernet
 product INTEL CORE5G_HB_1	0x1604	Core 5G Host Bridge
 product INTEL CORE5G_M_GT1	0x1606	HD Graphics (GT1)
 product INTEL CORE5G_HDA_1	0x160c	Core 5G HD Audio



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

2022-03-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Mar 16 04:31:54 UTC 2022

Modified Files:
src/sys/arch/evbmips/include: param.h

Log Message:
Add the increasingly spreading __HIDE_DELAY kludge to evbmips.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbmips/include/param.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/evbmips/include/param.h
diff -u src/sys/arch/evbmips/include/param.h:1.11 src/sys/arch/evbmips/include/param.h:1.12
--- src/sys/arch/evbmips/include/param.h:1.11	Mon Jan  7 22:00:31 2019
+++ src/sys/arch/evbmips/include/param.h	Wed Mar 16 04:31:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.11 2019/01/07 22:00:31 jdolecek Exp $	*/
+/*	$NetBSD: param.h,v 1.12 2022/03/16 04:31:54 simonb Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,8 +49,10 @@
 #ifdef _KERNEL
 #ifndef _LOCORE
 
+#ifndef __HIDE_DELAY
 void	delay(int n);
 #define	DELAY(x)	 	delay(x)
+#endif	/* __HIDE_DELAY */
 
 #include 
 



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

2022-03-15 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Wed Mar 16 04:31:54 UTC 2022

Modified Files:
src/sys/arch/evbmips/include: param.h

Log Message:
Add the increasingly spreading __HIDE_DELAY kludge to evbmips.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/evbmips/include/param.h

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



CVS commit: src/lib/libc/sys

2022-03-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar 16 00:50:41 UTC 2022

Modified Files:
src/lib/libc/sys: setpgid.2

Log Message:
setpgid.2: Mention that both child and parent need to call it.

Absence of this standard info was noticed by riastradh@.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/sys/setpgid.2

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



CVS commit: src/lib/libc/sys

2022-03-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar 16 00:50:41 UTC 2022

Modified Files:
src/lib/libc/sys: setpgid.2

Log Message:
setpgid.2: Mention that both child and parent need to call it.

Absence of this standard info was noticed by riastradh@.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/sys/setpgid.2

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/sys/setpgid.2
diff -u src/lib/libc/sys/setpgid.2:1.23 src/lib/libc/sys/setpgid.2:1.24
--- src/lib/libc/sys/setpgid.2:1.23	Fri Sep 19 16:02:58 2014
+++ src/lib/libc/sys/setpgid.2	Wed Mar 16 00:50:40 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: setpgid.2,v 1.23 2014/09/19 16:02:58 wiz Exp $
+.\"	$NetBSD: setpgid.2,v 1.24 2022/03/16 00:50:40 dholland Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)setpgid.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd December 18, 2003
+.Dd March 15, 2022
 .Dt SETPGID 2
 .Os
 .Sh NAME
@@ -62,6 +62,14 @@ is used instead.
 If the invoker is not the super-user, then the affected process
 must have the same effective user-id as the invoker or be a descendant
 of the invoking process.
+.Pp
+In general to set the process group of a newly forked subprocess, both
+the child and parent processes should call
+.Fn setpgid
+to ensure that the process group change takes effect in a timely
+fashion.
+One call will succeed and the other will fail, depending on process
+scheduling.
 .Sh RETURN VALUES
 .Fn setpgid
 returns 0 when the operation was successful.



CVS commit: src/share/dict

2022-03-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar 16 00:01:03 UTC 2022

Modified Files:
src/share/dict: web2

Log Message:
web2: +enqueue


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/share/dict/web2

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



CVS commit: src/share/dict

2022-03-15 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Mar 16 00:01:03 UTC 2022

Modified Files:
src/share/dict: web2

Log Message:
web2: +enqueue


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/share/dict/web2

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

Modified files:

Index: src/share/dict/web2
diff -u src/share/dict/web2:1.56 src/share/dict/web2:1.57
--- src/share/dict/web2:1.56	Fri Jan 21 08:58:10 2022
+++ src/share/dict/web2	Wed Mar 16 00:01:03 2022
@@ -62554,6 +62554,7 @@ enouncement
 enow
 enphytotic
 enplane
+enqueue
 enquicken
 enquire
 enquirer



CVS commit: src/sys/netinet

2022-03-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 15 21:40:00 UTC 2022

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
s/heaader/header/


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/netinet/ip_mroute.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/netinet/ip_mroute.c
diff -u src/sys/netinet/ip_mroute.c:1.164 src/sys/netinet/ip_mroute.c:1.165
--- src/sys/netinet/ip_mroute.c:1.164	Thu Nov 12 13:13:45 2020
+++ src/sys/netinet/ip_mroute.c	Tue Mar 15 21:39:59 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $	*/
+/*	$NetBSD: ip_mroute.c,v 1.165 2022/03/15 21:39:59 andvar Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.165 2022/03/15 21:39:59 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1846,7 +1846,7 @@ vif_encapcheck(struct mbuf *m, int off, 
 #endif
 
 	/*
-	 * Accept the packet only if the inner heaader is multicast
+	 * Accept the packet only if the inner header is multicast
 	 * and the outer header matches a tunnel-mode vif.  Order
 	 * checks in the hope that common non-matching packets will be
 	 * rejected quickly.  Assume that unicast IPv4 traffic in a



CVS commit: src/sys/netinet

2022-03-15 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Tue Mar 15 21:40:00 UTC 2022

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
s/heaader/header/


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/netinet/ip_mroute.c

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



CVS commit: src/doc

2022-03-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 15 21:02:11 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1844 -r1.1845 src/doc/3RDPARTY
cvs rdiff -u -r1.2864 -r1.2865 src/doc/CHANGES

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



CVS commit: src/doc

2022-03-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 15 21:02:11 UTC 2022

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1844 -r1.1845 src/doc/3RDPARTY
cvs rdiff -u -r1.2864 -r1.2865 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1844 src/doc/3RDPARTY:1.1845
--- src/doc/3RDPARTY:1.1844	Tue Mar 15 14:18:27 2022
+++ src/doc/3RDPARTY	Tue Mar 15 17:02:11 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1844 2022/03/15 18:18:27 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1845 2022/03/15 21:02:11 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1114,12 +1114,12 @@ markus is very cooperative about it):
 - adjust the DEFAULT_PKCS11_WHITELIST for ssh-agent
 
 Package:	OpenSSL
-Version:	1.0.2o/1.1.1m
+Version:	1.0.2o/1.1.1n
 Current Vers:	1.0.2zd/1.1.1n
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/
-Date:		2022-01-07
+Date:		2022-03-15
 Mailing List:	openssl-annou...@openssl.org
 Responsible:	christos, mjf, tls, riastradh, spz
 License:	OpenSSL and SSLeay license (both BSD-like)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2864 src/doc/CHANGES:1.2865
--- src/doc/CHANGES:1.2864	Wed Mar  9 17:55:32 2022
+++ src/doc/CHANGES	Tue Mar 15 17:02:11 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2864 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2865 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -481,4 +481,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		updated recordable media. [reinoud 20220309]
 	udf: Fix locking up CD/DVD burner issue that would lockup the FS.
 		[reinoud 20220309]
-
+	OpenSSL: Imported 1.1.1n. [christos 20220315]



CVS commit: src/crypto/external/bsd/openssl/dist

2022-03-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 15 20:51:13 UTC 2022

Modified Files:
src/crypto/external/bsd/openssl/dist: CHANGES Configure NEWS README
src/crypto/external/bsd/openssl/dist/apps: openssl.c s_client.c
src/crypto/external/bsd/openssl/dist/crypto/bn: bn_print.c
src/crypto/external/bsd/openssl/dist/crypto/engine: eng_all.c
src/crypto/external/bsd/openssl/dist/crypto/lhash: lhash.c
src/crypto/external/bsd/openssl/dist/crypto/ui: ui_openssl.c
src/crypto/external/bsd/openssl/dist/crypto/x509: x509_vfy.c
src/crypto/external/bsd/openssl/dist/ssl: s3_lib.c
src/crypto/external/bsd/openssl/dist/test: bntest.c evp_extra_test.c
src/crypto/external/bsd/openssl/dist/test/recipes/30-test_evp_data:
evpkdf.txt

Log Message:
merge OpenSSL-1.1.1m and OpenSSL-1.1.1n


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssl/dist/CHANGES \
src/crypto/external/bsd/openssl/dist/NEWS \
src/crypto/external/bsd/openssl/dist/README
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssl/dist/Configure
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssl/dist/apps/openssl.c
cvs rdiff -u -r1.24 -r1.25 \
src/crypto/external/bsd/openssl/dist/apps/s_client.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssl/dist/crypto/engine/eng_all.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/lhash/lhash.c
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/dist/crypto/ui/ui_openssl.c
cvs rdiff -u -r1.24 -r1.25 \
src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssl/dist/test/bntest.c
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/openssl/dist/test/evp_extra_test.c
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/dist/test/recipes/30-test_evp_data/evpkdf.txt

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/bsd/openssl/dist/CHANGES
diff -u src/crypto/external/bsd/openssl/dist/CHANGES:1.28 src/crypto/external/bsd/openssl/dist/CHANGES:1.29
--- src/crypto/external/bsd/openssl/dist/CHANGES:1.28	Fri Jan  7 10:50:10 2022
+++ src/crypto/external/bsd/openssl/dist/CHANGES	Tue Mar 15 16:51:12 2022
@@ -7,6 +7,43 @@
  https://github.com/openssl/openssl/commits/ and pick the appropriate
  release branch.
 
+ Changes between 1.1.1m and 1.1.1n [15 Mar 2022]
+
+  *) Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever
+ for non-prime moduli.
+
+ Internally this function is used when parsing certificates that contain
+ elliptic curve public keys in compressed form or explicit elliptic curve
+ parameters with a base point encoded in compressed form.
+
+ It is possible to trigger the infinite loop by crafting a certificate that
+ has invalid explicit curve parameters.
+
+ Since certificate parsing happens prior to verification of the certificate
+ signature, any process that parses an externally supplied certificate may
+ thus be subject to a denial of service attack. The infinite loop can also
+ be reached when parsing crafted private keys as they can contain explicit
+ elliptic curve parameters.
+
+ Thus vulnerable situations include:
+
+  - TLS clients consuming server certificates
+  - TLS servers consuming client certificates
+  - Hosting providers taking certificates or private keys from customers
+  - Certificate authorities parsing certification requests from subscribers
+  - Anything else which parses ASN.1 elliptic curve parameters
+
+ Also any other applications that use the BN_mod_sqrt() where the attacker
+ can control the parameter values are vulnerable to this DoS issue.
+ (CVE-2022-0778)
+ [Tomáš Mráz]
+
+  *) Add ciphersuites based on DHE_PSK (RFC 4279) and ECDHE_PSK (RFC 5489)
+ to the list of ciphersuites providing Perfect Forward Secrecy as
+ required by SECLEVEL >= 3.
+
+ [Dmitry Belyavskiy, Nicola Tuveri]
+
  Changes between 1.1.1l and 1.1.1m [14 Dec 2021]
 
   *) Avoid loading of a dynamic engine twice.
Index: src/crypto/external/bsd/openssl/dist/NEWS
diff -u src/crypto/external/bsd/openssl/dist/NEWS:1.28 src/crypto/external/bsd/openssl/dist/NEWS:1.29
--- src/crypto/external/bsd/openssl/dist/NEWS:1.28	Fri Jan  7 10:50:10 2022
+++ src/crypto/external/bsd/openssl/dist/NEWS	Tue Mar 15 16:51:12 2022
@@ -5,6 +5,11 @@
   This file gives a brief overview of the major changes between each OpenSSL
   release. For more details please read the CHANGES file.
 
+  Major changes between OpenSSL 1.1.1m and OpenSSL 1.1.1n [15 Mar 2022]
+
+  o 

CVS commit: src/crypto/external/bsd/openssl/dist

2022-03-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Mar 15 20:51:13 UTC 2022

Modified Files:
src/crypto/external/bsd/openssl/dist: CHANGES Configure NEWS README
src/crypto/external/bsd/openssl/dist/apps: openssl.c s_client.c
src/crypto/external/bsd/openssl/dist/crypto/bn: bn_print.c
src/crypto/external/bsd/openssl/dist/crypto/engine: eng_all.c
src/crypto/external/bsd/openssl/dist/crypto/lhash: lhash.c
src/crypto/external/bsd/openssl/dist/crypto/ui: ui_openssl.c
src/crypto/external/bsd/openssl/dist/crypto/x509: x509_vfy.c
src/crypto/external/bsd/openssl/dist/ssl: s3_lib.c
src/crypto/external/bsd/openssl/dist/test: bntest.c evp_extra_test.c
src/crypto/external/bsd/openssl/dist/test/recipes/30-test_evp_data:
evpkdf.txt

Log Message:
merge OpenSSL-1.1.1m and OpenSSL-1.1.1n


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssl/dist/CHANGES \
src/crypto/external/bsd/openssl/dist/NEWS \
src/crypto/external/bsd/openssl/dist/README
cvs rdiff -u -r1.29 -r1.30 src/crypto/external/bsd/openssl/dist/Configure
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssl/dist/apps/openssl.c
cvs rdiff -u -r1.24 -r1.25 \
src/crypto/external/bsd/openssl/dist/apps/s_client.c
cvs rdiff -u -r1.3 -r1.4 \
src/crypto/external/bsd/openssl/dist/crypto/bn/bn_print.c
cvs rdiff -u -r1.13 -r1.14 \
src/crypto/external/bsd/openssl/dist/crypto/engine/eng_all.c
cvs rdiff -u -r1.9 -r1.10 \
src/crypto/external/bsd/openssl/dist/crypto/lhash/lhash.c
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/dist/crypto/ui/ui_openssl.c
cvs rdiff -u -r1.24 -r1.25 \
src/crypto/external/bsd/openssl/dist/crypto/x509/x509_vfy.c
cvs rdiff -u -r1.28 -r1.29 src/crypto/external/bsd/openssl/dist/ssl/s3_lib.c
cvs rdiff -u -r1.9 -r1.10 src/crypto/external/bsd/openssl/dist/test/bntest.c
cvs rdiff -u -r1.10 -r1.11 \
src/crypto/external/bsd/openssl/dist/test/evp_extra_test.c
cvs rdiff -u -r1.2 -r1.3 \

src/crypto/external/bsd/openssl/dist/test/recipes/30-test_evp_data/evpkdf.txt

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



CVS commit: src/doc

2022-03-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Mar 15 18:18:27 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
new openssl out


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1843 src/doc/3RDPARTY:1.1844
--- src/doc/3RDPARTY:1.1843	Sun Mar 13 15:23:38 2022
+++ src/doc/3RDPARTY	Tue Mar 15 18:18:27 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1843 2022/03/13 15:23:38 taca Exp $
+#	$NetBSD: 3RDPARTY,v 1.1844 2022/03/15 18:18:27 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1115,7 +1115,7 @@ markus is very cooperative about it):
 
 Package:	OpenSSL
 Version:	1.0.2o/1.1.1m
-Current Vers:	1.0.2t/1.1.1m
+Current Vers:	1.0.2zd/1.1.1n
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/



CVS commit: src/doc

2022-03-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Mar 15 18:18:27 UTC 2022

Modified Files:
src/doc: 3RDPARTY

Log Message:
new openssl out


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

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



CVS commit: [netbsd-9] src/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 18:02:12 UTC 2022

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

Log Message:
Ticket #1435


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.81 -r1.1.2.82 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 18:02:12 UTC 2022

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

Log Message:
Ticket #1435


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.81 -r1.1.2.82 src/doc/CHANGES-9.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-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.81 src/doc/CHANGES-9.3:1.1.2.82
--- src/doc/CHANGES-9.3:1.1.2.81	Tue Mar 15 09:59:28 2022
+++ src/doc/CHANGES-9.3	Tue Mar 15 18:02:12 2022
@@ -1,4 +1,4 @@
-29~# $NetBSD: CHANGES-9.3,v 1.1.2.81 2022/03/15 09:59:28 martin Exp $
+29~# $NetBSD: CHANGES-9.3,v 1.1.2.82 2022/03/15 18:02:12 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -1524,3 +1524,8 @@ usr.sbin/puffs/mount_9p/node.c			1.30,1.
 	check returned type from T_READ request.
 	[ozaki-r, ticket #1434]
 
+sys/dev/ata/ata.c1.167
+
+	PR 56745: avoid an unaccounted extra ATA channel freeze.
+	[perseant, ticket #1435]
+



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

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 18:00:27 UTC 2022

Modified Files:
src/sys/dev/ata [netbsd-9]: ata.c

Log Message:
Pull up following revision(s) (requested by perseant in ticket #1435):

sys/dev/ata/ata.c: revision 1.167

Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request. Closes PR#56745.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.149.2.1 src/sys/dev/ata/ata.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.149 src/sys/dev/ata/ata.c:1.149.2.1
--- src/sys/dev/ata/ata.c:1.149	Sat May 25 16:30:18 2019
+++ src/sys/dev/ata/ata.c	Tue Mar 15 18:00:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.149 2019/05/25 16:30:18 christos Exp $	*/
+/*	$NetBSD: ata.c,v 1.149.2.1 2022/03/15 18:00:26 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.149 2019/05/25 16:30:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.149.2.1 2022/03/15 18:00:26 martin Exp $");
 
 #include "opt_ata.h"
 
@@ -1584,12 +1584,14 @@ ata_thread_run(struct ata_channel *chp, 
 			/* NOTREACHED */
 		}
 
-		/*
-		 * Block execution of other commands while reset is scheduled
-		 * to a thread.
-		 */
-		ata_channel_freeze_locked(chp);
-		chp->ch_flags |= type;
+		if (!(chp->ch_flags & type)) {
+			/*
+			 * Block execution of other commands while
+			 * reset is scheduled to a thread.
+			 */
+			ata_channel_freeze_locked(chp);
+			chp->ch_flags |= type;
+		}
 
 		cv_signal(&chp->ch_thr_idle);
 		return;



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

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 18:00:27 UTC 2022

Modified Files:
src/sys/dev/ata [netbsd-9]: ata.c

Log Message:
Pull up following revision(s) (requested by perseant in ticket #1435):

sys/dev/ata/ata.c: revision 1.167

Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request. Closes PR#56745.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.149.2.1 src/sys/dev/ata/ata.c

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



CVS commit: src/sys/kern

2022-03-15 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Mar 15 15:27:43 UTC 2022

Modified Files:
src/sys/kern: vfs_vnode.c

Log Message:
vrelel(): No need to test usecount if VGET marker is clear.
Assert "usecount == 1" instead.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/kern/vfs_vnode.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/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.136 src/sys/kern/vfs_vnode.c:1.137
--- src/sys/kern/vfs_vnode.c:1.136	Sat Mar 12 15:32:32 2022
+++ src/sys/kern/vfs_vnode.c	Tue Mar 15 15:27:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.136 2022/03/12 15:32:32 riastradh Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.137 2022/03/15 15:27:43 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019, 2020 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.136 2022/03/12 15:32:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.137 2022/03/15 15:27:43 hannken Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pax.h"
@@ -914,9 +914,10 @@ retry:
 
 	/* If the node gained another reference, retry. */
 	use = atomic_load_relaxed(&vp->v_usecount);
-	if ((use & VUSECOUNT_VGET) != 0 || (use & VUSECOUNT_MASK) != 1) {
+	if ((use & VUSECOUNT_VGET) != 0) {
 		goto retry;
 	}
+	KASSERT((use & VUSECOUNT_MASK) == 1);
 
 	if ((vp->v_iflag & (VI_TEXT|VI_EXECMAP|VI_WRMAP)) != 0 ||
 	(vp->v_vflag & VV_MAPPED) != 0) {
@@ -967,11 +968,11 @@ retry:
 	if (recycle) {
 		VSTATE_CHANGE(vp, VS_LOADED, VS_BLOCKED);
 		use = atomic_load_relaxed(&vp->v_usecount);
-		if ((use & VUSECOUNT_VGET) != 0 ||
-		(use & VUSECOUNT_MASK) != 1) {
+		if ((use & VUSECOUNT_VGET) != 0) {
 			VSTATE_CHANGE(vp, VS_BLOCKED, VS_LOADED);
 			goto retry;
 		}
+		KASSERT((use & VUSECOUNT_MASK) == 1);
 	}
 
 	/*



CVS commit: src/sys/kern

2022-03-15 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Tue Mar 15 15:27:43 UTC 2022

Modified Files:
src/sys/kern: vfs_vnode.c

Log Message:
vrelel(): No need to test usecount if VGET marker is clear.
Assert "usecount == 1" instead.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/kern/vfs_vnode.c

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



CVS commit: src/sys/net

2022-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 15 13:00:44 UTC 2022

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

Log Message:
bpf(4): Handle null bf_insn on free.

This is not guaranteed by bpf_setf to be nonnull.

Reported-by: syzbot+de1ec9471dfc2f283...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/sys/net/bpf.c

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



CVS commit: src/sys/net

2022-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 15 13:00:44 UTC 2022

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

Log Message:
bpf(4): Handle null bf_insn on free.

This is not guaranteed by bpf_setf to be nonnull.

Reported-by: syzbot+de1ec9471dfc2f283...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/sys/net/bpf.c

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

Modified files:

Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.245 src/sys/net/bpf.c:1.246
--- src/sys/net/bpf.c:1.245	Sat Mar 12 17:23:32 2022
+++ src/sys/net/bpf.c	Tue Mar 15 13:00:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.245 2022/03/12 17:23:32 riastradh Exp $	*/
+/*	$NetBSD: bpf.c,v 1.246 2022/03/15 13:00:44 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.245 2022/03/12 17:23:32 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.246 2022/03/15 13:00:44 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -2089,9 +2089,9 @@ bpf_free_filter(struct bpf_filter *filte
 {
 
 	KASSERT(filter != NULL);
-	KASSERT(filter->bf_insn != NULL);
 
-	kmem_free(filter->bf_insn, filter->bf_size);
+	if (filter->bf_insn != NULL)
+		kmem_free(filter->bf_insn, filter->bf_size);
 	if (filter->bf_jitcode != NULL)
 		bpf_jit_freecode(filter->bf_jitcode);
 	kmem_free(filter, sizeof(*filter));



CVS commit: src/sys/kern

2022-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 15 10:37:42 UTC 2022

Modified Files:
src/sys/kern: sys_descrip.c

Log Message:
posix_fadvise(2): Detect arithmetic overflow without UB.

Reported-by: syzbot+18f01abff11bd527c...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/sys_descrip.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/kern/sys_descrip.c
diff -u src/sys/kern/sys_descrip.c:1.38 src/sys/kern/sys_descrip.c:1.39
--- src/sys/kern/sys_descrip.c:1.38	Sat Sep 11 10:09:13 2021
+++ src/sys/kern/sys_descrip.c	Tue Mar 15 10:37:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_descrip.c,v 1.38 2021/09/11 10:09:13 riastradh Exp $	*/
+/*	$NetBSD: sys_descrip.c,v 1.39 2022/03/15 10:37:42 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.38 2021/09/11 10:09:13 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_descrip.c,v 1.39 2022/03/15 10:37:42 riastradh Exp $");
 
 #include 
 #include 
@@ -672,6 +672,7 @@ sys_flock(struct lwp *l, const struct sy
 int
 do_posix_fadvise(int fd, off_t offset, off_t len, int advice)
 {
+	const off_t OFF_MAX = __type_max(off_t);
 	file_t *fp;
 	vnode_t *vp;
 	off_t endoffset;
@@ -685,8 +686,8 @@ do_posix_fadvise(int fd, off_t offset, o
 		return EINVAL;
 	}
 	if (len == 0) {
-		endoffset = INT64_MAX;
-	} else if (len > 0 && (INT64_MAX - offset) >= len) {
+		endoffset = OFF_MAX;
+	} else if (len > 0 && (OFF_MAX - offset) >= len) {
 		endoffset = offset + len;
 	} else {
 		return EINVAL;
@@ -743,8 +744,8 @@ do_posix_fadvise(int fd, off_t offset, o
 		 * region.  It means that if the specified region is smaller
 		 * than PAGE_SIZE, we do nothing.
 		 */
-		if (round_page(offset) < trunc_page(endoffset) &&
-		offset <= round_page(offset)) {
+		if (offset <= trunc_page(OFF_MAX) &&
+		round_page(offset) < trunc_page(endoffset)) {
 			rw_enter(vp->v_uobj.vmobjlock, RW_WRITER);
 			error = VOP_PUTPAGES(vp,
 			round_page(offset), trunc_page(endoffset),



CVS commit: src/sys/kern

2022-03-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Mar 15 10:37:42 UTC 2022

Modified Files:
src/sys/kern: sys_descrip.c

Log Message:
posix_fadvise(2): Detect arithmetic overflow without UB.

Reported-by: syzbot+18f01abff11bd527c...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/sys_descrip.c

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



CVS commit: [netbsd-8] src/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 10:01:03 UTC 2022

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

Log Message:
Ticket #1738


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.123 -r1.1.2.124 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.123 src/doc/CHANGES-8.3:1.1.2.124
--- src/doc/CHANGES-8.3:1.1.2.123	Sun Mar 13 09:54:47 2022
+++ src/doc/CHANGES-8.3	Tue Mar 15 10:01:03 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.123 2022/03/13 09:54:47 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.124 2022/03/15 10:01:03 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2553,3 +2553,9 @@ usr.bin/man/man.c1.69,1.70,1.72
 	man(1): fix -m option so it works as documented.
 	[gutteridge, ticket #1737]
 
+usr.sbin/puffs/mount_9p/node.c			1.30,1.31
+
+	mount_9p(8): fix writing to a file opened with write-only mode,
+	check returned type from T_READ request.
+	[ozaki-r, ticket #1738]
+



CVS commit: [netbsd-8] src/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 10:01:03 UTC 2022

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

Log Message:
Ticket #1738


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

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



CVS commit: [netbsd-8] src/usr.sbin/puffs/mount_9p

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 10:00:14 UTC 2022

Modified Files:
src/usr.sbin/puffs/mount_9p [netbsd-8]: node.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1738):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

 -

mount_9p: check returned type for Tread


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.40.1 src/usr.sbin/puffs/mount_9p/node.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.sbin/puffs/mount_9p/node.c
diff -u src/usr.sbin/puffs/mount_9p/node.c:1.21 src/usr.sbin/puffs/mount_9p/node.c:1.21.40.1
--- src/usr.sbin/puffs/mount_9p/node.c:1.21	Sun Jan 18 10:10:47 2009
+++ src/usr.sbin/puffs/mount_9p/node.c	Tue Mar 15 10:00:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: node.c,v 1.21 2009/01/18 10:10:47 lukem Exp $	*/
+/*	$NetBSD: node.c,v 1.21.40.1 2022/03/15 10:00:14 martin Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: node.c,v 1.21 2009/01/18 10:10:47 lukem Exp $");
+__RCSID("$NetBSD: node.c,v 1.21.40.1 2022/03/15 10:00:14 martin Exp $");
 #endif /* !lint */
 
 #include 
@@ -181,6 +181,11 @@ puffs9p_node_readdir(struct puffs_usermo
 	p9pbuf_put_4(pb, *reslen); /* XXX */
 	GETRESPONSE(pb);
 
+	if (p9pbuf_get_type(pb) != P9PROTO_R_READ) {
+		rv = proto_handle_rerror(pu, pb);
+		goto out;
+	}
+
 	p9pbuf_get_4(pb, &count);
 
 	/*
@@ -266,6 +271,8 @@ puffs9p_node_open(struct puffs_usermount
 
 	puffs_setback(pcc, PUFFS_SETBACK_INACT_N1);
 	if (pn->pn_va.va_type != VDIR) {
+		/* Always require read access for page cache */
+		mode |= FREAD;
 		if (mode & FREAD && p9n->fid_read == P9P_INVALFID) {
 			nfid = NEXTFID(p9p);
 			error = proto_cc_open(pu, p9n->fid_base, nfid,



CVS commit: [netbsd-8] src/usr.sbin/puffs/mount_9p

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 10:00:14 UTC 2022

Modified Files:
src/usr.sbin/puffs/mount_9p [netbsd-8]: node.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1738):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

 -

mount_9p: check returned type for Tread


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.40.1 src/usr.sbin/puffs/mount_9p/node.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/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 09:59:28 UTC 2022

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

Log Message:
Ticket #1434


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.80 -r1.1.2.81 src/doc/CHANGES-9.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-9.3
diff -u src/doc/CHANGES-9.3:1.1.2.80 src/doc/CHANGES-9.3:1.1.2.81
--- src/doc/CHANGES-9.3:1.1.2.80	Sun Mar 13 09:53:11 2022
+++ src/doc/CHANGES-9.3	Tue Mar 15 09:59:28 2022
@@ -1,4 +1,4 @@
-29~# $NetBSD: CHANGES-9.3,v 1.1.2.80 2022/03/13 09:53:11 martin Exp $
+29~# $NetBSD: CHANGES-9.3,v 1.1.2.81 2022/03/15 09:59:28 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -1518,3 +1518,9 @@ usr.bin/man/man.c1.69,1.70,1.72
 	man(1): fix -m option so it works as documented.
 	[gutteridge, ticket #1433]
 
+usr.sbin/puffs/mount_9p/node.c			1.30,1.31
+
+	mount_9p(8): fix writing to a file opened with write-only mode,
+	check returned type from T_READ request.
+	[ozaki-r, ticket #1434]
+



CVS commit: [netbsd-9] src/doc

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 09:59:28 UTC 2022

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

Log Message:
Ticket #1434


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.80 -r1.1.2.81 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/usr.sbin/puffs/mount_9p

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 09:58:39 UTC 2022

Modified Files:
src/usr.sbin/puffs/mount_9p [netbsd-9]: node.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1434):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

 -

mount_9p: check returned type for Tread


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.sbin/puffs/mount_9p/node.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/usr.sbin/puffs/mount_9p

2022-03-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar 15 09:58:39 UTC 2022

Modified Files:
src/usr.sbin/puffs/mount_9p [netbsd-9]: node.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1434):

usr.sbin/puffs/mount_9p/node.c: revision 1.30
usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

 -

mount_9p: check returned type for Tread


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.2.1 src/usr.sbin/puffs/mount_9p/node.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.sbin/puffs/mount_9p/node.c
diff -u src/usr.sbin/puffs/mount_9p/node.c:1.23 src/usr.sbin/puffs/mount_9p/node.c:1.23.2.1
--- src/usr.sbin/puffs/mount_9p/node.c:1.23	Fri Jun  7 05:34:34 2019
+++ src/usr.sbin/puffs/mount_9p/node.c	Tue Mar 15 09:58:38 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: node.c,v 1.23 2019/06/07 05:34:34 ozaki-r Exp $	*/
+/*	$NetBSD: node.c,v 1.23.2.1 2022/03/15 09:58:38 martin Exp $	*/
 
 /*
  * Copyright (c) 2007  Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: node.c,v 1.23 2019/06/07 05:34:34 ozaki-r Exp $");
+__RCSID("$NetBSD: node.c,v 1.23.2.1 2022/03/15 09:58:38 martin Exp $");
 #endif /* !lint */
 
 #include 
@@ -185,6 +185,11 @@ puffs9p_node_readdir(struct puffs_usermo
 	p9pbuf_put_4(pb, *reslen); /* XXX */
 	GETRESPONSE(pb);
 
+	if (p9pbuf_get_type(pb) != P9PROTO_R_READ) {
+		rv = proto_handle_rerror(pu, pb);
+		goto out;
+	}
+
 	p9pbuf_get_4(pb, &count);
 
 	/*
@@ -271,6 +276,8 @@ puffs9p_node_open(struct puffs_usermount
 
 	puffs_setback(pcc, PUFFS_SETBACK_INACT_N1);
 	if (pn->pn_va.va_type != VDIR) {
+		/* Always require read access for page cache */
+		mode |= FREAD;
 		if (mode & FREAD && p9n->fid_read == P9P_INVALFID) {
 			nfid = NEXTFID(p9p);
 			error = proto_cc_open(pu, p9n->fid_base, nfid,