CVS commit: [netbsd-8] src/sys/compat/netbsd32

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 21:19:38 UTC 2023

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_nfssvc.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1840):

sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.7

compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out.


To generate a diff of this commit:
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/sys/compat/netbsd32/netbsd32_nfssvc.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/compat/netbsd32/netbsd32_nfssvc.c
diff -u src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.5.8.1 src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.5.8.2
--- src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.5.8.1	Wed Jun 21 21:04:01 2023
+++ src/sys/compat/netbsd32/netbsd32_nfssvc.c	Wed Jun 21 21:19:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_nfssvc.c,v 1.5.8.1 2023/06/21 21:04:01 martin Exp $	*/
+/*	$NetBSD: netbsd32_nfssvc.c,v 1.5.8.2 2023/06/21 21:19:38 martin Exp $	*/
 
 /*
  * Copyright (c) 2015 Matthew R. Green
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.5.8.1 2023/06/21 21:04:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.5.8.2 2023/06/21 21:19:38 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_nfs.h"
@@ -137,7 +137,7 @@ nfssvc32_nsd_out(void *argp, const struc
 	args32.nsd_key[0] = nsd->nsd_key[0];
 	args32.nsd_key[1] = nsd->nsd_key[1];
 
-	return copyout(nsd, argp, sizeof *nsd);
+	return copyout(, argp, sizeof args32);
 }
 
 static int



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 21:19:38 UTC 2023

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_nfssvc.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1840):

sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.7

compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out.


To generate a diff of this commit:
cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/sys/compat/netbsd32/netbsd32_nfssvc.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/sys/compat/netbsd32

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 20:38:35 UTC 2023

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_conv.h
netbsd32_fs.c netbsd32_netbsd.c netbsd32_socket.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1833):

sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.232
sys/compat/netbsd32/netbsd32_socket.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.45
sys/compat/netbsd32/netbsd32_fs.c: revision 1.92
sys/compat/netbsd32/netbsd32.h: revision 1.137

The read/write/send/recv system calls return ssize_t because -1 is
returned on error.  Therefore we must restrict the lengths of any
buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return
values.

Fixes ATF lib/libc/sys/t_write:write_err.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.3 -r1.114.8.4 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.31.8.3 -r1.31.8.4 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.206.2.2 -r1.206.2.3 \
src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.44.8.1 -r1.44.8.2 src/sys/compat/netbsd32/netbsd32_socket.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/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.114.8.3 src/sys/compat/netbsd32/netbsd32.h:1.114.8.4
--- src/sys/compat/netbsd32/netbsd32.h:1.114.8.3	Sat Aug 25 11:13:05 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Wed Jun 21 20:38:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.114.8.3 2018/08/25 11:13:05 martin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.114.8.4 2023/06/21 20:38:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -54,7 +54,7 @@
 #include 
 
 /*
- * first, define the basic types we need.
+ * first define the basic types we need, and any applicable limits.
  */
 
 typedef int32_t netbsd32_long;
@@ -69,6 +69,9 @@ typedef int32_t netbsd32_key_t;
 typedef int32_t netbsd32_intptr_t;
 typedef uint32_t netbsd32_uintptr_t;
 
+/* Note: 32-bit sparc defines ssize_t as long but still has same size as int. */
+#define	NETBSD32_SSIZE_MAX	INT32_MAX
+
 /* netbsd32_[u]int64 are machine dependent and defined below */
 
 /*

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.31.8.3 src/sys/compat/netbsd32/netbsd32_conv.h:1.31.8.4
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.31.8.3	Sat Feb 23 06:58:14 2019
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Wed Jun 21 20:38:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.31.8.3 2019/02/23 06:58:14 martin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.31.8.4 2023/06/21 20:38:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -251,13 +251,15 @@ netbsd32_to_iovecin(const struct netbsd3
 {
 	int i, error=0;
 	u_int32_t iov_base;
-	u_int32_t iov_len;
+	u_int32_t iov_len, total_iov_len;
+
 	/*
 	 * We could allocate an iov32p, do a copyin, and translate
 	 * each field and then free it all up, or we could copyin
 	 * each field separately.  I'm doing the latter to reduce
 	 * the number of MALLOC()s.
 	 */
+	total_iov_len = 0;
 	for (i = 0; i < len; i++, iovp++, iov32p++) {
 		if ((error = copyin(>iov_base, _base, sizeof(iov_base
 		return (error);
@@ -265,6 +267,19 @@ netbsd32_to_iovecin(const struct netbsd3
 		return (error);
 		iovp->iov_base = (void *)(u_long)iov_base;
 		iovp->iov_len = (size_t)iov_len;
+
+		/*
+		 * System calls return ssize_t because -1 is returned
+		 * on error.  Therefore we must restrict the length to
+		 * SSIZE_MAX (NETBSD32_SSIZE_MAX with compat32) to
+		 * avoid garbage return values.
+		 */
+		total_iov_len += iov_len;
+		if (iov_len > NETBSD32_SSIZE_MAX ||
+		total_iov_len > NETBSD32_SSIZE_MAX) {
+			return EINVAL;
+			break;
+		}
 	}
 	return error;
 }

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.80.2.1 src/sys/compat/netbsd32/netbsd32_fs.c:1.80.2.2
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.80.2.1	Sat Aug 25 11:13:05 2018
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Wed Jun 21 20:38:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.80.2.2 2023/06/21 20:38:35 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80.2.2 2023/06/21 20:38:35 martin Exp $");
 
 #include 
 #include 
@@ -175,7 +175,8 @@ dofilereadv32(int fd, struct file *fp, s
 		 * Therefore we must restrict the length to SSIZE_MAX to
 		 * avoid garbage return values.
 		 */
-		if (iov->iov_len > SSIZE_MAX || 

CVS commit: [netbsd-8] src/sys/compat/netbsd32

2023-06-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jun 21 20:38:35 UTC 2023

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_conv.h
netbsd32_fs.c netbsd32_netbsd.c netbsd32_socket.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1833):

sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.232
sys/compat/netbsd32/netbsd32_socket.c: revision 1.56
sys/compat/netbsd32/netbsd32_conv.h: revision 1.45
sys/compat/netbsd32/netbsd32_fs.c: revision 1.92
sys/compat/netbsd32/netbsd32.h: revision 1.137

The read/write/send/recv system calls return ssize_t because -1 is
returned on error.  Therefore we must restrict the lengths of any
buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return
values.

Fixes ATF lib/libc/sys/t_write:write_err.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.3 -r1.114.8.4 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.31.8.3 -r1.31.8.4 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.206.2.2 -r1.206.2.3 \
src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.44.8.1 -r1.44.8.2 src/sys/compat/netbsd32/netbsd32_socket.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/sys/compat/netbsd32

2020-02-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 13 19:34:30 UTC 2020

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1504):

sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.108
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.109

Don't use strlcpy to copy untrusted input, it may not be NUL-terminated.

Where did the +1 came from ?


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.2 -r1.89.8.3 src/sys/compat/netbsd32/netbsd32_ioctl.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/sys/compat/netbsd32

2020-02-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Feb 13 19:34:30 UTC 2020

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1504):

sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.108
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.109

Don't use strlcpy to copy untrusted input, it may not be NUL-terminated.

Where did the +1 came from ?


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.2 -r1.89.8.3 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.3
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.2	Mon Jul 22 16:27:29 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Thu Feb 13 19:34:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.3 2020/02/13 19:34:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.3 2020/02/13 19:34:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -145,7 +145,7 @@ static inline void
 netbsd32_to_if_addrprefreq(const struct netbsd32_if_addrprefreq *ifap32,
 	struct if_addrprefreq *ifap, u_long cmd)
 {
-	strlcpy(ifap->ifap_name, ifap32->ifap_name, sizeof(ifap->ifap_name));
+	memcpy(ifap->ifap_name, ifap32->ifap_name, IFNAMSIZ);
 	ifap->ifap_preference = ifap32->ifap_preference;
 	memcpy(>ifap_addr, >ifap_addr,
 	min(ifap32->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -341,7 +341,7 @@ static inline void
 netbsd32_to_ieee80211req(struct netbsd32_ieee80211req *ireq32,
 			 struct ieee80211req *ireq, u_long cmd)
 {
-	strlcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
+	memcpy(ireq->i_name, ireq32->i_name, IFNAMSIZ);
 	ireq->i_type = ireq32->i_type;
 	ireq->i_val = ireq32->i_val;
 	ireq->i_len = ireq32->i_len;
@@ -355,7 +355,7 @@ netbsd32_to_ieee80211_nwkey(struct netbs
 {
 	int i;
 
-	strlcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
+	memcpy(nwk->i_name, nwk32->i_name, IFNAMSIZ);
 	nwk->i_wepon = nwk32->i_wepon;
 	nwk->i_defkid = nwk32->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {
@@ -569,7 +569,7 @@ static inline void
 netbsd32_from_if_addrprefreq(const struct if_addrprefreq *ifap,
 	struct netbsd32_if_addrprefreq *ifap32, u_long cmd)
 {
-	strlcpy(ifap32->ifap_name, ifap->ifap_name, sizeof(ifap32->ifap_name));
+	memcpy(ifap32->ifap_name, ifap->ifap_name, IFNAMSIZ);
 	ifap32->ifap_preference = ifap->ifap_preference;
 	memcpy(>ifap_addr, >ifap_addr,
 	min(ifap->ifap_addr.ss_len, _SS_MAXSIZE));
@@ -770,7 +770,7 @@ static inline void
 netbsd32_from_ieee80211req(struct ieee80211req *ireq,
 			   struct netbsd32_ieee80211req *ireq32, u_long cmd)
 {
-	strlcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
+	memcpy(ireq32->i_name, ireq->i_name, IFNAMSIZ);
 	ireq32->i_type = ireq->i_type;
 	ireq32->i_val = ireq->i_val;
 	ireq32->i_len = ireq->i_len;
@@ -784,7 +784,7 @@ netbsd32_from_ieee80211_nwkey(struct iee
 {
 	int i;
 
-	strlcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
+	memcpy(nwk32->i_name, nwk->i_name, IFNAMSIZ);
 	nwk32->i_wepon = nwk->i_wepon;
 	nwk32->i_defkid = nwk->i_defkid;
 	for (i = 0; i < IEEE80211_WEP_NKID; i++) {



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov  4 14:44:47 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_syscall.h
netbsd32_syscallargs.h netbsd32_syscalls.c
netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
Regen for ticket #398


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.129.2.1 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.128 -r1.128.2.1 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.11 -r1.11.2.1 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.19 -r1.19.2.1 \
src/sys/compat/netbsd32/netbsd32_systrace_args.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/sys/compat/netbsd32

2019-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov  4 14:44:47 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_syscall.h
netbsd32_syscallargs.h netbsd32_syscalls.c
netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
Regen for ticket #398


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.129.2.1 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.128 -r1.128.2.1 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.11 -r1.11.2.1 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.19 -r1.19.2.1 \
src/sys/compat/netbsd32/netbsd32_systrace_args.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.129 src/sys/compat/netbsd32/netbsd32_syscall.h:1.129.2.1
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.129	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Mon Nov  4 14:44:46 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.129 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.129.2.1 2019/11/04 14:44:46 martin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.115 2016/10/19 09:44:01 skrll Exp
+ * created from	NetBSD: syscalls.master,v 1.115.8.1 2019/11/04 14:39:59 martin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1227,7 +1227,7 @@
 /* syscall: "netbsd32_openat" ret: "int" args: "int" "const netbsd32_charp" "int" "..." */
 #define	NETBSD32_SYS_netbsd32_openat	468
 
-/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "size_t" */
+/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "netbsd32_size_t" */
 #define	NETBSD32_SYS_netbsd32_readlinkat	469
 
 /* syscall: "netbsd32_symlinkat" ret: "int" args: "const netbsd32_charp" "int" "const netbsd32_charp" */
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.129 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.129.2.1
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.129	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Mon Nov  4 14:44:46 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.129 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.129.2.1 2019/11/04 14:44:46 martin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.115 2016/10/19 09:44:01 skrll Exp
+ * created from	NetBSD: syscalls.master,v 1.115.8.1 2019/11/04 14:39:59 martin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2512,7 +2512,7 @@ struct netbsd32_readlinkat_args {
 	syscallarg(int) fd;
 	syscallarg(const netbsd32_charp) path;
 	syscallarg(netbsd32_charp) buf;
-	syscallarg(size_t) bufsize;
+	syscallarg(netbsd32_size_t) bufsize;
 };
 check_syscall_args(netbsd32_readlinkat)
 

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.128 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.128.2.1
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.128	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Mon Nov  4 14:44:46 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.128 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.128.2.1 2019/11/04 14:44:46 martin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.115 2016/10/19 09:44:01 skrll Exp
+ * created from	NetBSD: syscalls.master,v 1.115.8.1 2019/11/04 14:39:59 martin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.128 2017/05/10 06:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.128.2.1 2019/11/04 14:44:46 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.128 src/sys/compat/netbsd32/netbsd32_sysent.c:1.128.2.1
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.128	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Mon Nov  4 14:44:47 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.128 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.128.2.1 2019/11/04 14:44:47 martin Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	

CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov  4 14:39:59 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: syscalls.master

Log Message:
Pull up following revision(s) (requested by rin in ticket #398):

sys/compat/netbsd32/syscalls.master: revision 1.129

For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t.

Since bufsize is the last argument, this affects only LP64EB.

XXX
pullup to netbsd-9, -8, and -7


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.8.1 src/sys/compat/netbsd32/syscalls.master

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



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-11-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov  4 14:39:59 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: syscalls.master

Log Message:
Pull up following revision(s) (requested by rin in ticket #398):

sys/compat/netbsd32/syscalls.master: revision 1.129

For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t.

Since bufsize is the last argument, this affects only LP64EB.

XXX
pullup to netbsd-9, -8, and -7


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.115.8.1 src/sys/compat/netbsd32/syscalls.master

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

Modified files:

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.115 src/sys/compat/netbsd32/syscalls.master:1.115.8.1
--- src/sys/compat/netbsd32/syscalls.master:1.115	Wed Oct 19 09:44:01 2016
+++ src/sys/compat/netbsd32/syscalls.master	Mon Nov  4 14:39:59 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.115 2016/10/19 09:44:01 skrll Exp $
+	$NetBSD: syscalls.master,v 1.115.8.1 2019/11/04 14:39:59 martin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1018,7 +1018,7 @@
 469	STD  		{ netbsd32_ssize_t|netbsd32||readlinkat(int fd, \
 			const netbsd32_charp path, \
 			netbsd32_charp buf, \
-			size_t bufsize); }
+			netbsd32_size_t bufsize); }
 470	STD  		{ int|netbsd32||symlinkat(const netbsd32_charp path1, \
 			int fd, \
 			const netbsd32_charp path2); }



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:27:29 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1054):

sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.65
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.98
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.99

PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.

 -

Correct misleading names of dummy variables. No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.1 -r1.89.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56.8.1 -r1.56.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.2
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.1	Mon Nov 27 14:07:53 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Jul 22 16:27:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.2 2019/07/22 16:27:29 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1303,6 +1303,12 @@ netbsd32_ioctl(struct lwp *l, const stru
 		IOCTL_STRUCT_CONV_TO(BIOCSUDPF, bpf_program);
 	case BIOCGDLTLIST32:
 		IOCTL_STRUCT_CONV_TO(BIOCGDLTLIST, bpf_dltlist);
+	case BIOCSRTIMEOUT32:
+#define netbsd32_to_timeval(s32p, p, cmd) netbsd32_to_timeval(s32p, p)
+#define netbsd32_from_timeval(p, s32p, cmd) netbsd32_from_timeval(p, s32p)
+		IOCTL_STRUCT_CONV_TO(BIOCSRTIMEOUT, timeval);
+#undef netbsd32_to_timeval
+#undef netbsd32_from_timeval
 
 	case WSDISPLAYIO_ADDSCREEN32:
 		IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata);

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.2
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.1	Mon Nov 27 14:07:53 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Mon Jul 22 16:27:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.56.8.1 2017/11/27 14:07:53 martin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.56.8.2 2019/07/22 16:27:29 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -116,6 +116,7 @@ struct netbsd32_bpf_dltlist {
 #define BIOCSTCPF32	_IOW('B',114, struct netbsd32_bpf_program)
 #define BIOCSUDPF32	_IOW('B',115, struct netbsd32_bpf_program)
 #define BIOCGDLTLIST32	_IOWR('B',119, struct netbsd32_bpf_dltlist)
+#define BIOCSRTIMEOUT32	_IOW('B',122, struct netbsd32_timeval)
 
 
 struct netbsd32_wsdisplay_addscreendata {



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-07-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jul 22 16:27:29 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by rin in ticket #1054):

sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.65
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.98
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.99

PR/53666: Rin Okuyama: tcpdump for i386 does not work with COMPAT_NETBSD32
on amd64. Add BIOCSRTIMEOUT32.

 -

Correct misleading names of dummy variables. No binary changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.89.8.1 -r1.89.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56.8.1 -r1.56.8.2 src/sys/compat/netbsd32/netbsd32_ioctl.h

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



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-03-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar 12 17:46:59 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_compat_60.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1211):
sys/compat/netbsd32/netbsd32_compat_60.c: 1.3
don't forget to convert the timespec.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.12.1 src/sys/compat/netbsd32/netbsd32_compat_60.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/compat/netbsd32/netbsd32_compat_60.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_60.c:1.2 src/sys/compat/netbsd32/netbsd32_compat_60.c:1.2.12.1
--- src/sys/compat/netbsd32/netbsd32_compat_60.c:1.2	Thu Aug 21 06:40:35 2014
+++ src/sys/compat/netbsd32/netbsd32_compat_60.c	Tue Mar 12 17:46:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_60.c,v 1.2 2014/08/21 06:40:35 maxv Exp $	*/
+/*	$NetBSD: netbsd32_compat_60.c,v 1.2.12.1 2019/03/12 17:46:59 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_60.c,v 1.2 2014/08/21 06:40:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_60.c,v 1.2.12.1 2019/03/12 17:46:59 snj Exp $");
 
 #include 
 #include 
@@ -71,6 +71,7 @@ compat_60_netbsd32__lwp_park(struct lwp 
 		error = copyin(SCARG_P32(uap, ts), , sizeof ts32);
 		if (error != 0)
 			return error;
+		netbsd32_to_timespec(, );
 		tsp = 
 	}
 



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2019-03-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar 12 17:46:59 UTC 2019

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_compat_60.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1211):
sys/compat/netbsd32/netbsd32_compat_60.c: 1.3
don't forget to convert the timespec.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.12.1 src/sys/compat/netbsd32/netbsd32_compat_60.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/sys/compat/netbsd32

2018-12-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 12:04:09 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1146):

sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.219

pset_create() takes a pointer so it needs special handling.


To generate a diff of this commit:
cvs rdiff -u -r1.206.2.1 -r1.206.2.2 \
src/sys/compat/netbsd32/netbsd32_netbsd.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/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206.2.1 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206.2.2
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206.2.1	Tue Dec 25 11:19:52 2018
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Thu Dec 27 12:04:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.206.2.2 2018/12/27 12:04:09 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206.2.2 2018/12/27 12:04:09 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -2837,8 +2837,11 @@ netbsd32_pset_create(struct lwp *l,
 	/* {
 		syscallarg(netbsd32_psetidp_t) psid;
 	}; */
+	struct sys_pset_create_args ua;
 
-	return sys_pset_create(l, (const void *)uap, retval);
+	NETBSD32TOP_UAP(psid, psetid_t);
+
+	return sys_pset_create(l, , retval);
 }
 
 int



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2018-12-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 12:04:09 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1146):

sys/compat/netbsd32/netbsd32_netbsd.c: revision 1.219

pset_create() takes a pointer so it needs special handling.


To generate a diff of this commit:
cvs rdiff -u -r1.206.2.1 -r1.206.2.2 \
src/sys/compat/netbsd32/netbsd32_netbsd.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/sys/compat/netbsd32

2018-11-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Nov 13 16:55:22 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1093):
sys/compat/netbsd32/netbsd32_socket.c: 1.48
Fix inverted logic, which leads to buffer overflow. Detected by kASan.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/compat/netbsd32/netbsd32_socket.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/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.44 src/sys/compat/netbsd32/netbsd32_socket.c:1.44.8.1
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.44	Tue Sep 13 07:01:07 2016
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Tue Nov 13 16:55:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.44 2016/09/13 07:01:07 martin Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.44.8.1 2018/11/13 16:55:22 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.44 2016/09/13 07:01:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.44.8.1 2018/11/13 16:55:22 snj Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@ copyout32_msg_control_mbuf(struct lwp *l
 		}
 
 		ktrkuser("msgcontrol", cmsg, cmsg->cmsg_len);
-		error = copyout(, *q, MAX(i, sizeof(cmsg32)));
+		error = copyout(, *q, MIN(i, sizeof(cmsg32)));
 		if (error)
 			return (error);
 		if (i > CMSG32_LEN(0)) {



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2018-11-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Nov 13 16:55:22 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_socket.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1093):
sys/compat/netbsd32/netbsd32_socket.c: 1.48
Fix inverted logic, which leads to buffer overflow. Detected by kASan.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.8.1 src/sys/compat/netbsd32/netbsd32_socket.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/sys/compat/netbsd32

2018-08-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 25 11:13:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #977):

sys/compat/netbsd32/netbsd32_fs.c: revision 1.81
sys/compat/netbsd32/netbsd32.h: revision 1.119

support nullfs in netbsd32.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.2 -r1.114.8.3 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/compat/netbsd32/netbsd32_fs.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/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.114.8.2 src/sys/compat/netbsd32/netbsd32.h:1.114.8.3
--- src/sys/compat/netbsd32/netbsd32.h:1.114.8.2	Sat Apr 14 03:04:06 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Aug 25 11:13:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.114.8.2 2018/04/14 03:04:06 snj Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.114.8.3 2018/08/25 11:13:05 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -958,7 +958,7 @@ struct netbsd32_tmpfs_args {
 /* from  */
 struct netbsd32_iso_args {
 	netbsd32_charp fspec;
-	struct export_args30 _pad1;
+	struct netbsd32_export_args30 _pad1;
 	int	flags;
 };
 
@@ -1014,8 +1014,6 @@ struct netbsd32_mountd_exports_list {
 	netbsd32_export_argsp	mel_exports;
 };
 
-/* no struct export_args30 yet */
-
 /* from  */
 struct netbsd32_nfs_args {
 	int32_t		version;	/* args structure version number */
@@ -1053,6 +1051,17 @@ struct netbsd32_msdosfs_args {
 	int	gmtoff;		/* v3: offset from UTC in seconds */
 };
 
+/* from  */
+struct netbsd32_layer_args {
+	netbsd32_charp target;		/* Target of loopback  */
+	struct netbsd32_export_args30 _pad1; /* compat with old userland tools */
+};
+
+/* from  */
+struct netbsd32_null_args {
+	struct	netbsd32_layer_args	la;	/* generic layerfs args */
+};
+
 struct netbsd32_posix_spawn_file_actions_entry {
 	enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action;
 

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.80 src/sys/compat/netbsd32/netbsd32_fs.c:1.80.2.1
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.80	Thu Jun  1 02:45:08 2017
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Aug 25 11:13:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80 2017/06/01 02:45:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.80.2.1 2018/08/25 11:13:05 martin Exp $");
 
 #include 
 #include 
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.
 #include 
 #include 
 #include 
+#include 
 
 #define NFS_ARGS_ONLY
 #include 
@@ -799,6 +800,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct netbsd32_nfs_args nfs_args;
 		struct netbsd32_msdosfs_args msdosfs_args;
 		struct netbsd32_tmpfs_args tmpfs_args;
+		struct netbsd32_null_args null_args;
 	} fs_args32;
 	union {
 		struct ufs_args ufs_args;
@@ -807,6 +809,7 @@ netbsd32___mount50(struct lwp *l, const 
 		struct nfs_args nfs_args;
 		struct msdosfs_args msdosfs_args;
 		struct tmpfs_args tmpfs_args;
+		struct null_args null_args;
 	} fs_args;
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
@@ -953,6 +956,20 @@ netbsd32___mount50(struct lwp *l, const 
 		data_seg = UIO_SYSSPACE;
 		data = _args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
+	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+		if (data_len > sizeof(fs_args32.null_args))
+			return EINVAL;
+		if ((flags & MNT_GETARGS) == 0) {
+			error = copyin(data, _args32.null_args, 
+			sizeof(fs_args32.null_args));
+			if (error)
+return error;
+			fs_args.null_args.la.target =
+			NETBSD32PTR64(fs_args32.null_args.la.target);
+		}
+		data_seg = UIO_SYSSPACE;
+		data = _args.null_args;
+		data_len = sizeof(fs_args.null_args);
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
@@ -1032,6 +1049,13 @@ netbsd32___mount50(struct lwp *l, const 
 			fs_args.nfs_args.hostname);
 			error = copyout(_args32.nfs_args, data,
 			sizeof(fs_args32.nfs_args));
+		} else if (strcmp(mtype, MOUNT_NULL) == 0) {
+			if (data_len != sizeof(fs_args.null_args))
+return EINVAL;
+			NETBSD32PTR32(fs_args32.null_args.la.target,
+			fs_args.null_args.la.target);
+			error = copyout(_args32.null_args, data, 
+			sizeof(fs_args32.null_args));
 		}
 	}
 	return error;



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2018-08-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 25 11:13:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h netbsd32_fs.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #977):

sys/compat/netbsd32/netbsd32_fs.c: revision 1.81
sys/compat/netbsd32/netbsd32.h: revision 1.119

support nullfs in netbsd32.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.2 -r1.114.8.3 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/compat/netbsd32/netbsd32_fs.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/sys/compat/netbsd32

2018-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr 14 03:04:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h

Log Message:
Pull up revision 1.116 of sys/compat/netbsd32/netbsd32.h to fix fallout
from ticket #713:
include  for siginfo32_t.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.1 -r1.114.8.2 src/sys/compat/netbsd32/netbsd32.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/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.114.8.1 src/sys/compat/netbsd32/netbsd32.h:1.114.8.2
--- src/sys/compat/netbsd32/netbsd32.h:1.114.8.1	Thu Apr 12 13:42:49 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Apr 14 03:04:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.114.8.1 2018/04/12 13:42:49 martin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.114.8.2 2018/04/14 03:04:06 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2018-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr 14 03:04:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h

Log Message:
Pull up revision 1.116 of sys/compat/netbsd32/netbsd32.h to fix fallout
from ticket #713:
include  for siginfo32_t.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.1 -r1.114.8.2 src/sys/compat/netbsd32/netbsd32.h

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



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2017-11-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 27 14:07:53 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #396):
sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.57
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.90
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56 -r1.56.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.h

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



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2017-11-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 27 14:07:53 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #396):
sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.57
sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.90
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.89.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56 -r1.56.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.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/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89.8.1
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89	Sat Jan 14 16:34:44 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Nov 27 14:07:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89.8.1 2017/11/27 14:07:53 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -116,8 +116,14 @@ netbsd32_to_ifreq(struct netbsd32_ifreq 
 	 * union member needs to be converted to 64 bits... this
 	 * is very driver specific and so we ignore it for now..
 	 */
-	if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
+	switch (cmd) {
+	case SIOCGIFDATA:
+	case SIOCZIFDATA:
+	case SIOCGIFGENERIC:
+	case SIOCSIFGENERIC:
 		p->ifr_data = (void *)NETBSD32PTR64(s32p->ifr_data);
+		break;
+	}
 }
 
 static inline void
@@ -534,8 +540,14 @@ netbsd32_from_ifreq(struct ifreq *p, str
 	 * is very driver specific and so we ignore it for now..
 	 */
 	memcpy(s32p, p, sizeof *s32p);
-	if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
+	switch (cmd) {
+	case SIOCGIFDATA:
+	case SIOCZIFDATA:
+	case SIOCGIFGENERIC:
+	case SIOCSIFGENERIC:
 		NETBSD32PTR32(s32p->ifr_data, p->ifr_data);
+		break;
+	}
 }
 
 static inline void
@@ -1233,6 +1245,11 @@ netbsd32_ioctl(struct lwp *l, const stru
 	case SIOCGIFMEDIA32:
 		IOCTL_STRUCT_CONV_TO(SIOCGIFMEDIA, ifmediareq);
 
+	case SIOCGIFGENERIC32:
+		IOCTL_STRUCT_CONV_TO(SIOCGIFGENERIC, ifreq);
+	case SIOCSIFGENERIC32:
+		IOCTL_STRUCT_CONV_TO(SIOCSIFGENERIC, ifreq);
+
 	case PPPOESETPARMS32:
 		IOCTL_STRUCT_CONV_TO(PPPOESETPARMS, pppoediscparms);
 	case PPPOEGETPARMS32:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56.8.1
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56	Mon Dec 26 23:05:06 2016
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Mon Nov 27 14:07:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.56 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.56.8.1 2017/11/27 14:07:53 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -374,6 +374,9 @@ struct netbsd32_if_clonereq {
 #define	SIOCSIFMEDIA32	_IOWR('i', 53, struct netbsd32_ifreq)	/* set net media */
 #define	OSIOCSIFMEDIA32	_IOWR('i', 53, struct netbsd32_oifreq)	/* set net media */
 
+#define	SIOCSIFGENERIC32 _IOW('i', 57, struct netbsd32_ifreq)	/* generic IF set op */
+#define	SIOCGIFGENERIC32 _IOWR('i', 58, struct netbsd32_ifreq)	/* generic IF get op */
+
 #define	SIOCIFGCLONERS32 _IOWR('i', 120, struct netbsd32_if_clonereq) /* get cloners */
 
 #define	SIOCSIFMTU32	 _IOW('i', 127, struct netbsd32_ifreq)	/* set ifnet mtu */



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:33:06 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_conv.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #339):
sys/compat/netbsd32/netbsd32_conv.h: revision 1.33
PR kern/52681: fix msghdr conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/compat/netbsd32/netbsd32_conv.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/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.31 src/sys/compat/netbsd32/netbsd32_conv.h:1.31.8.1
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.31	Sun Nov 13 13:59:45 2016
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Mon Nov  6 10:33:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.31 2016/11/13 13:59:45 rin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.31.8.1 2017/11/06 10:33:06 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -287,10 +287,10 @@ static __inline void
 netbsd32_from_msghdr(struct netbsd32_msghdr *mhp32, const struct msghdr *mhp)
 {
 
-	mhp32->msg_name = mhp32->msg_name;
-	mhp32->msg_namelen = mhp32->msg_namelen;
-	mhp32->msg_iovlen = mhp32->msg_iovlen;
-	mhp32->msg_control = mhp32->msg_control;
+	NETBSD32PTR32(mhp32->msg_name, mhp->msg_name);
+	mhp32->msg_namelen = mhp->msg_namelen;
+	mhp32->msg_iovlen = mhp->msg_iovlen;
+	NETBSD32PTR32(mhp32->msg_control, mhp->msg_control);
 	mhp32->msg_controllen = mhp->msg_controllen;
 	mhp32->msg_flags = mhp->msg_flags;
 }



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2017-11-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Mon Nov  6 10:33:06 UTC 2017

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32_conv.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #339):
sys/compat/netbsd32/netbsd32_conv.h: revision 1.33
PR kern/52681: fix msghdr conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.8.1 src/sys/compat/netbsd32/netbsd32_conv.h

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