CVS commit: src/sys/compat/common

2023-12-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sat Dec  9 20:31:57 UTC 2023

Modified Files:
src/sys/compat/common: compat_90_mod.c net_inet6_nd_90.c

Log Message:
Allow kernels builds which don't define INET6 to compile compat bits too.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_90_mod.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/net_inet6_nd_90.c

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



CVS commit: src/sys/compat/common

2023-12-09 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Sat Dec  9 20:31:57 UTC 2023

Modified Files:
src/sys/compat/common: compat_90_mod.c net_inet6_nd_90.c

Log Message:
Allow kernels builds which don't define INET6 to compile compat bits too.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_90_mod.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/net_inet6_nd_90.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/common/compat_90_mod.c
diff -u src/sys/compat/common/compat_90_mod.c:1.5 src/sys/compat/common/compat_90_mod.c:1.6
--- src/sys/compat/common/compat_90_mod.c:1.5	Sat Dec  9 15:21:01 2023
+++ src/sys/compat/common/compat_90_mod.c	Sat Dec  9 20:31:57 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_90_mod.c,v 1.5 2023/12/09 15:21:01 pgoyette Exp $	*/
+/*	$NetBSD: compat_90_mod.c,v 1.6 2023/12/09 20:31:57 oster Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.5 2023/12/09 15:21:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.6 2023/12/09 20:31:57 oster Exp $");
 
 #include 
 #include 
@@ -50,7 +50,9 @@ int
 compat_90_init(void)
 {
 
+#ifdef INET6
 	net_inet6_nd_90_init();
+#endif
 	return vfs_syscalls_90_init();
 }
 
@@ -63,7 +65,9 @@ compat_90_fini(void)
 	if (error != 0)
 		return error;
 
+#ifdef INET6
 	net_inet6_nd_90_fini();
+#endif
 	return error;
 }
 

Index: src/sys/compat/common/net_inet6_nd_90.c
diff -u src/sys/compat/common/net_inet6_nd_90.c:1.1 src/sys/compat/common/net_inet6_nd_90.c:1.2
--- src/sys/compat/common/net_inet6_nd_90.c:1.1	Sat Dec  9 15:21:01 2023
+++ src/sys/compat/common/net_inet6_nd_90.c	Sat Dec  9 20:31:57 2023
@@ -1,6 +1,6 @@
-/*	$NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $ */
+/*	$NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $ */
 
-/*  $NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $*/
+/*  $NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $*/
 /*  $KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $   */
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: net_inet6_nd_90.c,v 1.1 2023/12/09 15:21:01 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_inet6_nd_90.c,v 1.2 2023/12/09 20:31:57 oster Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -60,6 +60,8 @@ __KERNEL_RCSID(0, "$NetBSD: net_inet6_nd
 
 #include 
 
+#ifdef INET6
+
 static struct sysctllog *nd6_clog;
 
 /*
@@ -128,3 +130,6 @@ net_inet6_nd_90_fini(void)
 	MODULE_HOOK_UNSET(net_inet6_nd_90_hook);
 	return 0;
 }
+
+#endif /* INET6 */
+



CVS commit: src/sys/compat/common

2022-12-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 20 00:11:14 UTC 2022

Removed Files:
src/sys/compat/common: Makefile Makefile.inc Makefile.sysio
Makefile.sysv

Log Message:
Remove sys/compat/common/Makefile.*.

 These files are not used anymore. Files for compat code are listed in
sys/comapt/common/files.common and sys/modules/compat_xxx/Makefile.
OK'd by riastradh@ and pgoyette@.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r0 src/sys/compat/common/Makefile
cvs rdiff -u -r1.26 -r0 src/sys/compat/common/Makefile.inc
cvs rdiff -u -r1.15 -r0 src/sys/compat/common/Makefile.sysio
cvs rdiff -u -r1.1 -r0 src/sys/compat/common/Makefile.sysv

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



CVS commit: src/sys/compat/common

2022-12-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Dec 20 00:11:14 UTC 2022

Removed Files:
src/sys/compat/common: Makefile Makefile.inc Makefile.sysio
Makefile.sysv

Log Message:
Remove sys/compat/common/Makefile.*.

 These files are not used anymore. Files for compat code are listed in
sys/comapt/common/files.common and sys/modules/compat_xxx/Makefile.
OK'd by riastradh@ and pgoyette@.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r0 src/sys/compat/common/Makefile
cvs rdiff -u -r1.26 -r0 src/sys/compat/common/Makefile.inc
cvs rdiff -u -r1.15 -r0 src/sys/compat/common/Makefile.sysio
cvs rdiff -u -r1.1 -r0 src/sys/compat/common/Makefile.sysv

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



CVS commit: src/sys/compat/common

2022-09-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Sep 21 07:15:24 UTC 2022

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
compat_50_quota: reject invalid quota id types.

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


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_quota.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/common/compat_50_quota.c
diff -u src/sys/compat/common/compat_50_quota.c:1.3 src/sys/compat/common/compat_50_quota.c:1.4
--- src/sys/compat/common/compat_50_quota.c:1.3	Mon Mar  9 00:42:36 2020
+++ src/sys/compat/common/compat_50_quota.c	Wed Sep 21 07:15:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $ */
+/*	$NetBSD: compat_50_quota.c,v 1.4 2022/09/21 07:15:24 dholland Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.4 2022/09/21 07:15:24 dholland Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -83,6 +83,9 @@ compat_50_sys_quotactl(struct lwp *l, co
 	mp = vp->v_mount;
 	q1cmd = SCARG(uap, cmd);
 	idtype = quota_idtype_from_ufs(q1cmd & SUBCMDMASK);
+	if (idtype == -1) {
+		return EINVAL;
+	}
 
 	switch ((q1cmd & ~SUBCMDMASK) >> SUBCMDSHIFT) {
 	case Q_QUOTAON:



CVS commit: src/sys/compat/common

2022-09-21 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Wed Sep 21 07:15:24 UTC 2022

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
compat_50_quota: reject invalid quota id types.

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


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_50_quota.c

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



CVS commit: src/sys/compat/common

2022-09-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Sep  3 03:11:56 UTC 2022

Modified Files:
src/sys/compat/common: if_spppsubr50.c

Log Message:
Remove 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/if_spppsubr50.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/common/if_spppsubr50.c
diff -u src/sys/compat/common/if_spppsubr50.c:1.4 src/sys/compat/common/if_spppsubr50.c:1.5
--- src/sys/compat/common/if_spppsubr50.c:1.4	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/common/if_spppsubr50.c	Sat Sep  3 03:11:56 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $	 */
+/*	$NetBSD: if_spppsubr50.c,v 1.5 2022/09/03 03:11:56 thorpej Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr50.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr50.c,v 1.5 2022/09/03 03:11:56 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -71,7 +71,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_spppsubr5
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/compat/common

2022-09-02 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Sep  3 03:11:56 UTC 2022

Modified Files:
src/sys/compat/common: if_spppsubr50.c

Log Message:
Remove 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/if_spppsubr50.c

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



CVS commit: src/sys/compat/common

2022-08-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug  3 01:38:51 UTC 2022

Modified Files:
src/sys/compat/common: if_media_80.c

Log Message:
sys/compat/common/if_media_80.c: Add kernel rcsid.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/if_media_80.c

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



CVS commit: src/sys/compat/common

2022-08-02 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Aug  3 01:38:51 UTC 2022

Modified Files:
src/sys/compat/common: if_media_80.c

Log Message:
sys/compat/common/if_media_80.c: Add kernel rcsid.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/if_media_80.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/common/if_media_80.c
diff -u src/sys/compat/common/if_media_80.c:1.4 src/sys/compat/common/if_media_80.c:1.5
--- src/sys/compat/common/if_media_80.c:1.4	Tue Sep  7 11:43:02 2021
+++ src/sys/compat/common/if_media_80.c	Wed Aug  3 01:38:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media_80.c,v 1.4 2021/09/07 11:43:02 riastradh Exp $	*/
+/*	$NetBSD: if_media_80.c,v 1.5 2022/08/03 01:38:51 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,6 +65,7 @@
  */
 
 #include 
+__KERNEL_RCSID(0, "$NetBSD: if_media_80.c,v 1.5 2022/08/03 01:38:51 riastradh Exp $");
 
 #include 
 #include 



CVS commit: src/sys/compat/common

2022-07-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 10 13:57:14 UTC 2022

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
tty_43: Do unsigned arithmetic to avoid shift into sign bits.

Omit input validation -- it's not a great idea for compatibility with
historical kernels, since they ignored the bits instead of rejecting
them if set.  With unsigned arithmetic, we get the same semantics as
was previously assumed (discarding bits that get shifted into the
sign bit or off into oblivion) without the formal undefined
behaviour.

Reported-by: syzbot+e408764cdd8c0c0ff...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=8318f0039e68187cd8d27b2c520816fff3f7266a


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/compat/common/tty_43.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/common/tty_43.c
diff -u src/sys/compat/common/tty_43.c:1.39 src/sys/compat/common/tty_43.c:1.40
--- src/sys/compat/common/tty_43.c:1.39	Sat Oct 10 15:59:41 2020
+++ src/sys/compat/common/tty_43.c	Sun Jul 10 13:57:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_43.c,v 1.39 2020/10/10 15:59:41 christos Exp $	*/
+/*	$NetBSD: tty_43.c,v 1.40 2022/07/10 13:57:14 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.39 2020/10/10 15:59:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.40 2022/07/10 13:57:14 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -220,11 +220,9 @@ compat_43_ttioctl(struct tty *tp, u_long
 	case TIOCLBIC:
 	case TIOCLSET: {
 		struct termios term;
-		int argbits, flags;
+		unsigned argbits, flags;
 
 		argbits = *(int *)data;
-		if (argbits < 0)
-			return EINVAL;
 
 		mutex_spin_enter(_lock);
 		term = tp->t_termios;



CVS commit: src/sys/compat/common

2022-07-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 10 13:57:14 UTC 2022

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
tty_43: Do unsigned arithmetic to avoid shift into sign bits.

Omit input validation -- it's not a great idea for compatibility with
historical kernels, since they ignored the bits instead of rejecting
them if set.  With unsigned arithmetic, we get the same semantics as
was previously assumed (discarding bits that get shifted into the
sign bit or off into oblivion) without the formal undefined
behaviour.

Reported-by: syzbot+e408764cdd8c0c0ff...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=8318f0039e68187cd8d27b2c520816fff3f7266a


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/compat/common/tty_43.c

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



CVS commit: src/sys/compat/common

2022-03-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 12 20:46:03 UTC 2022

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c

Log Message:
compat_30: Fix thinko in previous.

Let's not go into an infinite loop of stack smashing!


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/common/vfs_syscalls_30.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/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.44 src/sys/compat/common/vfs_syscalls_30.c:1.45
--- src/sys/compat/common/vfs_syscalls_30.c:1.44	Sat Mar 12 15:54:23 2022
+++ src/sys/compat/common/vfs_syscalls_30.c	Sat Mar 12 20:46:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.44 2022/03/12 15:54:23 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.45 2022/03/12 20:46:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.44 2022/03/12 15:54:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.45 2022/03/12 20:46:03 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -310,7 +310,7 @@ again:
 	}
 
 	/* if we squished out the whole block, try again */
-	if (any) {
+	if (!any) {
 		if (cookiebuf)
 			free(cookiebuf, M_TEMP);
 		cookiebuf = NULL;



CVS commit: src/sys/compat/common

2022-03-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 12 20:46:03 UTC 2022

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c

Log Message:
compat_30: Fix thinko in previous.

Let's not go into an infinite loop of stack smashing!


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/common/vfs_syscalls_30.c

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



CVS commit: src/sys/compat/common

2022-03-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 12 15:54:24 UTC 2022

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c

Log Message:
compat_30: Avoid what might be technically undefined behaviour.

Not sure advancing a user pointer by one for the purpose of making an
equality test fail later on is actually likely to be a problem, but
let's just pacify the sanitizer.

Reported-by: syzbot+758b18164c5c444f4...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/common/vfs_syscalls_30.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/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.43 src/sys/compat/common/vfs_syscalls_30.c:1.44
--- src/sys/compat/common/vfs_syscalls_30.c:1.43	Tue Sep  7 11:43:02 2021
+++ src/sys/compat/common/vfs_syscalls_30.c	Sat Mar 12 15:54:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.43 2021/09/07 11:43:02 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.44 2022/03/12 15:54:23 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.43 2021/09/07 11:43:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.44 2022/03/12 15:54:23 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -219,6 +219,7 @@ compat_30_sys_getdents(struct lwp *l,
 	int buflen, error, eofflag;
 	off_t *cookiebuf = NULL, *cookie;
 	int ncookies;
+	bool any = false;
 
 	/* fd_getvnode() will use the descriptor for us */
 	if ((error = fd_getvnode(SCARG(uap, fd), )) != 0)
@@ -285,7 +286,7 @@ again:
 		idb.d_reclen = _DIRENT_SIZE();
 		if (reclen > len || resid < idb.d_reclen) {
 			/* entry too big for buffer, so just stop */
-			outp++;
+			any = true;
 			break;
 		}
 		/*
@@ -305,10 +306,11 @@ again:
 		/* advance output past NetBSD-3.0-shaped entry */
 		outp += idb.d_reclen;
 		resid -= idb.d_reclen;
+		any = true;
 	}
 
 	/* if we squished out the whole block, try again */
-	if (outp == SCARG(uap, buf)) {
+	if (any) {
 		if (cookiebuf)
 			free(cookiebuf, M_TEMP);
 		cookiebuf = NULL;



CVS commit: src/sys/compat/common

2022-03-12 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Mar 12 15:54:24 UTC 2022

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c

Log Message:
compat_30: Avoid what might be technically undefined behaviour.

Not sure advancing a user pointer by one for the purpose of making an
equality test fail later on is actually likely to be a problem, but
let's just pacify the sanitizer.

Reported-by: syzbot+758b18164c5c444f4...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/common/vfs_syscalls_30.c

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



CVS commit: src/sys/compat/common

2021-12-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Dec  2 04:26:10 UTC 2021

Modified Files:
src/sys/compat/common: kern_sig_16.c

Log Message:
don't call MODULE_HOOK_SET(), if exec_sigcode_alloc() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/common/kern_sig_16.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/common/kern_sig_16.c
diff -u src/sys/compat/common/kern_sig_16.c:1.7 src/sys/compat/common/kern_sig_16.c:1.8
--- src/sys/compat/common/kern_sig_16.c:1.7	Fri Nov 26 08:06:11 2021
+++ src/sys/compat/common/kern_sig_16.c	Thu Dec  2 04:26:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_sig_16.c,v 1.7 2021/11/26 08:06:11 ryo Exp $	*/
+/*	$NetBSD: kern_sig_16.c,v 1.8 2021/12/02 04:26:09 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.7 2021/11/26 08:06:11 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig_16.c,v 1.8 2021/12/02 04:26:09 ryo Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -161,10 +161,12 @@ kern_sig_16_init(void)
 		emul_netbsd.e_sigobject = NULL;
 	}
 	rw_exit(_lock);
+	if (error)
+		return error;
 	MODULE_HOOK_SET(sendsig_sigcontext_16_hook, sendsig_sigcontext);
 #endif
 
-	return error;
+	return 0;
 }
 
 int



CVS commit: src/sys/compat/common

2021-12-01 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Dec  2 04:26:10 UTC 2021

Modified Files:
src/sys/compat/common: kern_sig_16.c

Log Message:
don't call MODULE_HOOK_SET(), if exec_sigcode_alloc() fails.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/common/kern_sig_16.c

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



CVS commit: src/sys/compat/common

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 07:57:46 UTC 2021

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/common/vfs_syscalls_50.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/common/vfs_syscalls_30.c
diff -u src/sys/compat/common/vfs_syscalls_30.c:1.41 src/sys/compat/common/vfs_syscalls_30.c:1.42
--- src/sys/compat/common/vfs_syscalls_30.c:1.41	Fri Jan 31 04:01:23 2020
+++ src/sys/compat/common/vfs_syscalls_30.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $	*/
+/*	$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $	*/
 
 /*-
  * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.41 2020/01/31 09:01:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.42 2021/08/15 07:57:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 #include 
 #include 
 
-static void cvtstat(struct stat13 *, const struct stat *);
-
 static const struct syscall_package vfs_syscalls_30_syscalls[] = {
 	{ SYS_compat_30___fhstat30, 0, (sy_call_t *)compat_30_sys___fhstat30 },
 	{ SYS_compat_30___fstat13, 0, (sy_call_t *)compat_30_sys___fstat13 },
@@ -85,6 +83,8 @@ static void
 cvtstat(struct stat13 *ost, const struct stat *st)
 {
 
+	/* Handle any padding. */
+	memset(ost, 0, sizeof(*ost));
 	ost->st_dev = st->st_dev;
 	ost->st_ino = (uint32_t)st->st_ino;
 	ost->st_mode = st->st_mode;
@@ -123,8 +123,7 @@ compat_30_sys___stat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 
@@ -148,8 +147,7 @@ compat_30_sys___lstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, ub), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, ub), sizeof(osb));
 }
 
 /* ARGSUSED */
@@ -164,34 +162,12 @@ compat_30_sys_fhstat(struct lwp *l,
 	struct stat sb;
 	struct stat13 osb;
 	int error;
-	struct compat_30_fhandle fh;
-	struct mount *mp;
-	struct vnode *vp;
-
-	/*
-	 * Must be super user
-	 */
-	if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE,
-	0, NULL, NULL, NULL)))
-		return (error);
 
-	if ((error = copyin(SCARG(uap, fhp), , sizeof(fh))) != 0)
-		return (error);
-
-	if ((mp = vfs_getvfs(_fsid)) == NULL)
-		return (ESTALE);
-	if (mp->mnt_op->vfs_fhtovp == NULL)
-		return EOPNOTSUPP;
-	error = VFS_FHTOVP(mp, (struct fid*)_fid, LK_EXCLUSIVE, );
-	if (error != 0)
-		return (error);
-	error = vn_stat(vp, );
-	vput(vp);
+	error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), );
 	if (error)
-		return (error);
+		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof(osb));
-	return (error);
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -214,8 +190,7 @@ compat_30_sys___fstat13(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap, sb), sizeof(osb));
 }
 
 /*
@@ -292,7 +267,7 @@ again:
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
 		if (reclen & _DIRENT_ALIGN(bdp))
-			panic("netbsd30_getdents: bad reclen %d", reclen);
+			panic("%s: bad reclen %d", __func__, reclen);
 		if (cookie)
 			off = *cookie++; /* each entry points to the next */
 		else
@@ -396,9 +371,8 @@ compat_30_sys_getfh(struct lwp *l, const
 		error = EINVAL;
 	}
 	if (error)
-		return (error);
-	error = copyout(, SCARG(uap, fhp), sizeof(struct compat_30_fhandle));
-	return (error);
+		return error;
+	return copyout(, SCARG(uap, fhp), sizeof(fh));
 }
 
 /*
@@ -437,8 +411,7 @@ compat_30_sys___fhstat30(struct lwp *l,
 	if (error)
 		return error;
 	cvtstat(, );
-	error = copyout(, SCARG(uap_30, sb), sizeof (osb));
-	return error;
+	return copyout(, SCARG(uap_30, sb), sizeof(osb));
 }
 
 /* ARGSUSED */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.66 src/sys/compat/common/vfs_syscalls_43.c:1.67
--- src/sys/compat/common/vfs_syscalls_43.c:1.66	Wed Jun 24 06:28:16 2020
+++ src/sys/compat/common/vfs_syscalls_43.c	Sun Aug 15 03:57:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.66 

CVS commit: src/sys/compat/common

2021-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Aug 15 07:57:46 UTC 2021

Modified Files:
src/sys/compat/common: vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c

Log Message:
- memset struct stat to avoid kernel memory disclosure of padded fields
  (thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.25 -r1.26 src/sys/compat/common/vfs_syscalls_50.c

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



CVS commit: src/sys/compat/common

2021-05-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 25 16:50:49 UTC 2021

Modified Files:
src/sys/compat/common: Makefile

Log Message:
PR port-xen/53130 was fixed and closed some time ago, so now we can
belatedly re-enable inclusion of the compat_60 x86 microcode code in
the loadable module.  (It was already being included in the built-in
version of the module.)


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/common/Makefile

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/common/Makefile
diff -u src/sys/compat/common/Makefile:1.65 src/sys/compat/common/Makefile:1.66
--- src/sys/compat/common/Makefile:1.65	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/Makefile	Tue May 25 16:50:49 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.65 2019/01/27 02:08:39 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.66 2021/05/25 16:50:49 pgoyette Exp $
 
 LIB=		compat
 NOPIC=		# defined
@@ -27,11 +27,9 @@ lib${LIB}.o:: ${OBJS:O} __buildstdlib
 
 lib${LIB}.po:: ${POBJS:O} __buildproflib
 
-.if NOTYET
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 CPPFLAGS+=	-DCPU_UCODE
 .endif
-.endif
 
 showsources: ${SRCS}
 	@echo ${.ALLSRC}



CVS commit: src/sys/compat/common

2021-05-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue May 25 16:50:49 UTC 2021

Modified Files:
src/sys/compat/common: Makefile

Log Message:
PR port-xen/53130 was fixed and closed some time ago, so now we can
belatedly re-enable inclusion of the compat_60 x86 microcode code in
the loadable module.  (It was already being included in the built-in
version of the module.)


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/common/Makefile

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



CVS commit: src/sys/compat/common

2020-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 22:10:56 UTC 2020

Modified Files:
src/sys/compat/common: bio_30.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/bio_30.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/common/bio_30.c
diff -u src/sys/compat/common/bio_30.c:1.4 src/sys/compat/common/bio_30.c:1.5
--- src/sys/compat/common/bio_30.c:1.4	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/common/bio_30.c	Sat Dec 19 22:10:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $ */
+/*	$NetBSD: bio_30.c,v 1.5 2020/12/19 22:10:56 thorpej Exp $ */
 /*	$OpenBSD: bio.c,v 1.9 2007/03/20 02:35:55 marco Exp $	*/
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.4 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1.5 2020/12/19 22:10:56 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -37,7 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: bio_30.c,v 1
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -58,33 +58,31 @@ compat_30_bio(void *cookie, u_long cmd, 
 
 	switch (cmd) {
 	case OBIOCDISK: {
-		struct bioc_disk *bd =
-		malloc(sizeof(*bd), M_DEVBUF, M_WAITOK|M_ZERO);
+		struct bioc_disk *bd = kmem_zalloc(sizeof(*bd), KM_SLEEP);
 
 		(void)memcpy(bd, addr, sizeof(struct obioc_disk));
 		error = (*delegate)(cookie, BIOCDISK, bd);
 		if (error) {
-			free(bd, M_DEVBUF);
+			kmem_free(bd, sizeof(*bd));
 			return error;
 		}
 
 		(void)memcpy(addr, bd, sizeof(struct obioc_disk));
-		free(bd, M_DEVBUF);
+		kmem_free(bd, sizeof(*bd));
 		return 0;
 	}
 	case OBIOCVOL: {
-		struct bioc_vol *bv =
-		malloc(sizeof(*bv), M_DEVBUF, M_WAITOK|M_ZERO);
+		struct bioc_vol *bv = kmem_zalloc(sizeof(*bv), KM_SLEEP);
 
 		(void)memcpy(bv, addr, sizeof(struct obioc_vol));
 		error = (*delegate)(cookie, BIOCVOL, bv);
 		if (error) {
-			free(bv, M_DEVBUF);
+			kmem_free(bv, sizeof(*bv));
 			return error;
 		}
 
 		(void)memcpy(addr, bv, sizeof(struct obioc_vol));
-		free(bv, M_DEVBUF);
+		kmem_free(bv, sizeof(*bv));
 		return 0;
 	}
 	default:



CVS commit: src/sys/compat/common

2020-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 22:10:56 UTC 2020

Modified Files:
src/sys/compat/common: bio_30.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/bio_30.c

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



CVS commit: src/sys/compat/common

2020-10-09 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Oct  9 10:41:53 UTC 2020

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
tty_43: Check a bitset from userspace is valid before shifting it

Passing a negative value to these legacy compat ioctls results in
left shift on a negative value which is undefined behaviour and results
in the tty (at least, possibly other things) locking up.

The argument to the ioctl should always be > 0. Return EINVAL otherwise.

While here, adjustments to code style to match current guidelines.

Found by UBSan.

Reported-by: syzbot+39cd551a05298b222...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/tty_43.c

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



CVS commit: src/sys/compat/common

2020-10-09 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Oct  9 10:41:53 UTC 2020

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
tty_43: Check a bitset from userspace is valid before shifting it

Passing a negative value to these legacy compat ioctls results in
left shift on a negative value which is undefined behaviour and results
in the tty (at least, possibly other things) locking up.

The argument to the ioctl should always be > 0. Return EINVAL otherwise.

While here, adjustments to code style to match current guidelines.

Found by UBSan.

Reported-by: syzbot+39cd551a05298b222...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/tty_43.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/common/tty_43.c
diff -u src/sys/compat/common/tty_43.c:1.37 src/sys/compat/common/tty_43.c:1.38
--- src/sys/compat/common/tty_43.c:1.37	Sat Aug  8 19:04:58 2020
+++ src/sys/compat/common/tty_43.c	Fri Oct  9 10:41:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $	*/
+/*	$NetBSD: tty_43.c,v 1.38 2020/10/09 10:41:53 nia Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.38 2020/10/09 10:41:53 nia Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -220,20 +220,24 @@ compat_43_ttioctl(struct tty *tp, u_long
 	case TIOCLBIC:
 	case TIOCLSET: {
 		struct termios term;
-		int flags;
+		int argbits, flags;
+
+		argbits = *(int *)data;
+		if (argbits < 0)
+			return EINVAL;
 
 		mutex_spin_enter(_lock);
 		term = tp->t_termios;
 		flags = ttcompatgetflags(tp);
 		switch (com) {
 		case TIOCLSET:
-			tp->t_flags = (flags&0x) | (*(int *)data<<16);
+			tp->t_flags = (flags & 0x) | (argbits << 16);
 			break;
 		case TIOCLBIS:
-			tp->t_flags = flags | (*(int *)data<<16);
+			tp->t_flags = flags | (argbits << 16);
 			break;
 		case TIOCLBIC:
-			tp->t_flags = flags & ~(*(int *)data<<16);
+			tp->t_flags = flags & ~(argbits << 16);
 			break;
 		}
 		ttcompatsetlflags(tp, );



CVS commit: src/sys/compat/common

2020-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug  8 19:04:58 UTC 2020

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
Fix the OTIOCGETD emulation. Line discipline 0 is NTTYDISC.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/common/tty_43.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/common/tty_43.c
diff -u src/sys/compat/common/tty_43.c:1.36 src/sys/compat/common/tty_43.c:1.37
--- src/sys/compat/common/tty_43.c:1.36	Sat May 23 19:42:41 2020
+++ src/sys/compat/common/tty_43.c	Sat Aug  8 15:04:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $	*/
+/*	$NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.36 2020/05/23 23:42:41 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_43.c,v 1.37 2020/08/08 19:04:58 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -250,8 +250,8 @@ compat_43_ttioctl(struct tty *tp, u_long
 
 	case OTIOCGETD:
 		mutex_spin_enter(_lock);
-		*(int *)data = (tp->t_linesw == NULL) ?
-		2 /* XXX old NTTYDISC */ : tp->t_linesw->l_no;
+		*(int *)data = (tp->t_linesw == NULL || tp->t_linesw->l_no == 0)
+		? 2 /* XXX old NTTYDISC */ : tp->t_linesw->l_no;
 		mutex_spin_exit(_lock);
 		break;
 



CVS commit: src/sys/compat/common

2020-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug  8 19:04:58 UTC 2020

Modified Files:
src/sys/compat/common: tty_43.c

Log Message:
Fix the OTIOCGETD emulation. Line discipline 0 is NTTYDISC.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/common/tty_43.c

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



CVS commit: src/sys/compat/common

2020-06-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 28 14:37:53 UTC 2020

Modified Files:
src/sys/compat/common: vfs_syscalls_20.c

Log Message:
Fix struct entry size (thanks kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/common/vfs_syscalls_20.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/common/vfs_syscalls_20.c
diff -u src/sys/compat/common/vfs_syscalls_20.c:1.45 src/sys/compat/common/vfs_syscalls_20.c:1.46
--- src/sys/compat/common/vfs_syscalls_20.c:1.45	Fri Jan 17 15:08:06 2020
+++ src/sys/compat/common/vfs_syscalls_20.c	Sun Jun 28 10:37:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_20.c,v 1.45 2020/01/17 20:08:06 ad Exp $	*/
+/*	$NetBSD: vfs_syscalls_20.c,v 1.46 2020/06/28 14:37:53 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.45 2020/01/17 20:08:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.46 2020/06/28 14:37:53 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -153,7 +153,7 @@ compat_20_sys_getfsstat(struct lwp *l, c
 	} */
 	return do_sys_getvfsstat(l, SCARG(uap, buf), SCARG(uap, bufsize),
 	SCARG(uap, flags), statvfs_to_statfs12_copy,
-	sizeof(struct statvfs90), retval);
+	sizeof(struct statfs12), retval);
 }
 
 int



CVS commit: src/sys/compat/common

2020-06-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 28 14:37:53 UTC 2020

Modified Files:
src/sys/compat/common: vfs_syscalls_20.c

Log Message:
Fix struct entry size (thanks kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/common/vfs_syscalls_20.c

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



CVS commit: src/sys/compat/common

2020-06-24 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jun 24 17:47:52 UTC 2020

Modified Files:
src/sys/compat/common: tty_60.c

Log Message:
reduce stack usage in compat_60_ptmget_ioctl() - allocate struct ptmget
via kmem_alloc()


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/tty_60.c

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



CVS commit: src/sys/compat/common

2020-06-24 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Jun 24 17:47:52 UTC 2020

Modified Files:
src/sys/compat/common: tty_60.c

Log Message:
reduce stack usage in compat_60_ptmget_ioctl() - allocate struct ptmget
via kmem_alloc()


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/tty_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/common/tty_60.c
diff -u src/sys/compat/common/tty_60.c:1.9 src/sys/compat/common/tty_60.c:1.10
--- src/sys/compat/common/tty_60.c:1.9	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/common/tty_60.c	Wed Jun 24 17:47:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty_60.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $	*/
+/*	$NetBSD: tty_60.c,v 1.10 2020/06/24 17:47:52 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.10 2020/06/24 17:47:52 jdolecek Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -70,7 +71,7 @@ compat_60_ptmget_ioctl(dev_t dev, u_long
 {
 	int ret;
 	u_long newcmd;
-	struct ptmget pg;
+	struct ptmget *pg;
 	const struct cdevsw *cd = cdevsw_lookup(dev);
 
 	if (cd == NULL || cd->d_ioctl == NULL)
@@ -82,10 +83,16 @@ compat_60_ptmget_ioctl(dev_t dev, u_long
 	default: return ENOTTY;
 	}
 
-	ret = (cd->d_ioctl)(dev, newcmd, , flag, l);
+	pg = kmem_alloc(sizeof(*pg), KM_SLEEP);
+
+	ret = (cd->d_ioctl)(dev, newcmd, pg, flag, l);
 	if (ret != 0)
-		return ret;
-	ret = ptmget_to_ptmget60(, data);
+		goto out;
+
+	ret = ptmget_to_ptmget60(pg, data);
+
+out:
+	kmem_free(pg, sizeof(*pg));
 	return ret;
 }
 



CVS commit: src/sys/compat/common

2020-03-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar 26 13:39:29 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c

Log Message:
When using SYSCTL_SETUP there is no guarantee of the order in which
the set-up functions will be called, so it is perfectly acceptable
for a compat code's routine to be called ahead of the code in other
parts of the kernel.

So make sure that the 2nd level sysctl node ``vfs.generic'' exists
before trying to add the 3rd level entries.

XXX Rather than creating the 2nd level node in two places, we could
XXX add the shared ``vfs.generic'' node to sysctl_init_base.c but
XXX this is left for another day.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_sysctl_09_43.c

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



CVS commit: src/sys/compat/common

2020-03-26 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar 26 13:39:29 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c

Log Message:
When using SYSCTL_SETUP there is no guarantee of the order in which
the set-up functions will be called, so it is perfectly acceptable
for a compat code's routine to be called ahead of the code in other
parts of the kernel.

So make sure that the 2nd level sysctl node ``vfs.generic'' exists
before trying to add the 3rd level entries.

XXX Rather than creating the 2nd level node in two places, we could
XXX add the shared ``vfs.generic'' node to sysctl_init_base.c but
XXX this is left for another day.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/compat_sysctl_09_43.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/common/compat_sysctl_09_43.c
diff -u src/sys/compat/common/compat_sysctl_09_43.c:1.5 src/sys/compat/common/compat_sysctl_09_43.c:1.6
--- src/sys/compat/common/compat_sysctl_09_43.c:1.5	Thu Feb 27 17:42:33 2020
+++ src/sys/compat/common/compat_sysctl_09_43.c	Thu Mar 26 13:39:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysctl_09_43.c,v 1.5 2020/02/27 17:42:33 pgoyette Exp $	*/
+/*	$NetBSD: compat_sysctl_09_43.c,v 1.6 2020/03/26 13:39:29 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.5 2020/02/27 17:42:33 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.6 2020/03/26 13:39:29 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -106,6 +106,17 @@ SYSCTL_SETUP(compat_sysctl_vfs, "Top-lev
 	int error;
 
 	error = sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT, 
+			CTLTYPE_NODE, "generic",
+			SYSCTL_DESCR("Non-specific vfs related information"),
+			NULL, 0, NULL, 0,
+			CTL_VFS, VFS_GENERIC, CTL_EOL);
+	if (error == EEXIST)
+		error = 0;
+	if (error != 0)
+		return;
+
+	error = sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT|CTLFLAG_IMMEDIATE,
 		   CTLTYPE_INT, "maxtypenum",
 		   SYSCTL_DESCR("Highest valid filesystem type number"),



CVS commit: src/sys/compat/common

2020-03-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar  9 00:42:36 UTC 2020

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
The compat_50_quota code needs quota support from ufs.  Add dependency.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_50_quota.c

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



CVS commit: src/sys/compat/common

2020-03-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Mar  9 00:42:36 UTC 2020

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
The compat_50_quota code needs quota support from ufs.  Add dependency.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_50_quota.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/common/compat_50_quota.c
diff -u src/sys/compat/common/compat_50_quota.c:1.2 src/sys/compat/common/compat_50_quota.c:1.3
--- src/sys/compat/common/compat_50_quota.c:1.2	Wed Jan 22 23:41:29 2020
+++ src/sys/compat/common/compat_50_quota.c	Mon Mar  9 00:42:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $ */
+/*	$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.3 2020/03/09 00:42:36 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -164,7 +164,7 @@ compat_50_sys_quotactl(struct lwp *l, co
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_50");
+MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_50,ufs");
 
 static int
 compat_50_quota_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 18:19:16 UTC 2020

Modified Files:
src/sys/compat/common: vfs_syscalls_43.c

Log Message:
Include all of the vfs syscalls in the syscall_package, not just oquota.

Should fix PR kern/55025

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/common/vfs_syscalls_43.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/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.64 src/sys/compat/common/vfs_syscalls_43.c:1.65
--- src/sys/compat/common/vfs_syscalls_43.c:1.64	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/vfs_syscalls_43.c	Thu Feb 27 18:19:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.64 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.65 2020/02/27 18:19:16 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.64 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.65 2020/02/27 18:19:16 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -79,7 +79,16 @@ static void cvttimespec(struct timespec 
 static void cvtstat(struct stat *, struct stat43 *);
 
 static struct syscall_package vfs_syscalls_43_syscalls[] = {
-	{ SYS_compat_43_oquota, 0, (sy_call_t *)compat_43_sys_quota },
+	{ SYS_compat_43_oquota, 0, (sy_call_t *)compat_43_sys_quota },
+	{ SYS_compat_43_stat43, 0, (sy_call_t *)compat_43_sys_stat },
+	{ SYS_compat_43_lstat43,0, (sy_call_t *)compat_43_sys_lstat },
+	{ SYS_compat_43_fstat43,0, (sy_call_t *)compat_43_sys_fstat },
+	{ SYS_compat_43_otruncate,  0, (sy_call_t *)compat_43_sys_ftruncate },
+	{ SYS_compat_43_oftruncate, 0, (sy_call_t *)compat_43_sys_ftruncate },
+	{ SYS_compat_43_olseek, 0, (sy_call_t *)compat_43_sys_lseek },
+	{ SYS_compat_43_ocreat, 0, (sy_call_t *)compat_43_sys_creat },
+	{ SYS_compat_43_ogetdirentries, 0,
+	(sy_call_t *)compat_43_sys_getdirentries },
 	{ 0, 0, NULL }
 };
 



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 18:19:16 UTC 2020

Modified Files:
src/sys/compat/common: vfs_syscalls_43.c

Log Message:
Include all of the vfs syscalls in the syscall_package, not just oquota.

Should fix PR kern/55025

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/compat/common/vfs_syscalls_43.c

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



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 17:42:33 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c

Log Message:
Ooppss - SYSCTL_SETUP() functions return void.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/compat_sysctl_09_43.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/common/compat_sysctl_09_43.c
diff -u src/sys/compat/common/compat_sysctl_09_43.c:1.4 src/sys/compat/common/compat_sysctl_09_43.c:1.5
--- src/sys/compat/common/compat_sysctl_09_43.c:1.4	Thu Feb 27 16:41:59 2020
+++ src/sys/compat/common/compat_sysctl_09_43.c	Thu Feb 27 17:42:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysctl_09_43.c,v 1.4 2020/02/27 16:41:59 pgoyette Exp $	*/
+/*	$NetBSD: compat_sysctl_09_43.c,v 1.5 2020/02/27 17:42:33 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.4 2020/02/27 16:41:59 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.5 2020/02/27 17:42:33 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -114,7 +114,7 @@ SYSCTL_SETUP(compat_sysctl_vfs, "Top-lev
 	if (error == EEXIST)
 		error = 0;
 	if (error != 0)
-		return error;
+		return;
 
 	error = sysctl_createv(clog, 0, NULL, NULL,
 		   CTLFLAG_PERMANENT,
@@ -123,8 +123,6 @@ SYSCTL_SETUP(compat_sysctl_vfs, "Top-lev
 		   sysctl_vfs_generic_conf, 0, NULL,
 		   sizeof(struct vfsconf),
 		   CTL_VFS, VFS_GENERIC, VFS_CONF, CTL_EOL);
-
-	return error;
 }
 #endif
 



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 17:42:33 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c

Log Message:
Ooppss - SYSCTL_SETUP() functions return void.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/compat_sysctl_09_43.c

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



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 16:41:59 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c kern_time_50.c

Log Message:
Remove explicit calls to the sysctl setup routines, since this is now
handled by the module infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_sysctl_09_43.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/common/kern_time_50.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/common/compat_sysctl_09_43.c
diff -u src/sys/compat/common/compat_sysctl_09_43.c:1.3 src/sys/compat/common/compat_sysctl_09_43.c:1.4
--- src/sys/compat/common/compat_sysctl_09_43.c:1.3	Fri Dec  6 08:35:21 2019
+++ src/sys/compat/common/compat_sysctl_09_43.c	Thu Feb 27 16:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysctl_09_43.c,v 1.3 2019/12/06 08:35:21 maxv Exp $	*/
+/*	$NetBSD: compat_sysctl_09_43.c,v 1.4 2020/02/27 16:41:59 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.3 2019/12/06 08:35:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysctl_09_43.c,v 1.4 2020/02/27 16:41:59 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -101,8 +101,7 @@ sysctl_vfs_generic_conf(SYSCTLFN_ARGS)
 /*
  * Top level filesystem related information gathering.
  */
-static int
-compat_sysctl_vfs(struct sysctllog **clog)
+SYSCTL_SETUP(compat_sysctl_vfs, "Top-level filesystem info")
 {
 	int error;
 
@@ -129,20 +128,17 @@ compat_sysctl_vfs(struct sysctllog **clo
 }
 #endif
 
-static struct sysctllog *compat_09_43_clog = NULL;
-
 int
 compat_sysctl_09_43_init(void)
 {
 
-	return compat_sysctl_vfs(_09_43_clog);
+	return 0;
 }
 
 int
 compat_sysctl_09_43_fini(void)
 {
 
-	sysctl_teardown(_09_43_clog);
 	return 0;
 }
 

Index: src/sys/compat/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.34 src/sys/compat/common/kern_time_50.c:1.35
--- src/sys/compat/common/kern_time_50.c:1.34	Thu Jan  2 15:42:26 2020
+++ src/sys/compat/common/kern_time_50.c	Thu Feb 27 16:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.34 2020/01/02 15:42:26 thorpej Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.35 2020/02/27 16:41:59 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.34 2020/01/02 15:42:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.35 2020/02/27 16:41:59 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -73,8 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: kern_time_50
 
 struct timeval50 boottime50; 
 
-static struct sysctllog *kern_time_50_clog = NULL;
-
 static const struct syscall_package kern_time_50_syscalls[] = {
 	{ SYS_compat_50_clock_gettime, 0,
 	(sy_call_t *)compat_50_sys_clock_gettime },  
@@ -580,8 +578,7 @@ compat_50_sys___ntp_gettime30(struct lwp
 	return 0;
 }
 
-static void
-compat_sysctl_time(struct sysctllog **clog)
+SYSCTL_SETUP(compat_sysctl_time, "Old system boottime")
 {
 	struct timeval tv;
 
@@ -601,11 +598,7 @@ kern_time_50_init(void)
 {   
 	int error;
 
-	compat_sysctl_time(_time_50_clog);
-
 	error = syscall_establish(NULL, kern_time_50_syscalls);
-	if (error != 0)
-		sysctl_teardown(_time_50_clog);
 
 	return error;
 }   
@@ -616,8 +609,6 @@ kern_time_50_fini(void)
 	int error;
 
 	error = syscall_disestablish(NULL, kern_time_50_syscalls);
-	if (error == 0)
-		sysctl_teardown(_time_50_clog);
 
 	return error;
 } 



CVS commit: src/sys/compat/common

2020-02-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Feb 27 16:41:59 UTC 2020

Modified Files:
src/sys/compat/common: compat_sysctl_09_43.c kern_time_50.c

Log Message:
Remove explicit calls to the sysctl setup routines, since this is now
handled by the module infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/compat_sysctl_09_43.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/common/kern_time_50.c

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



CVS commit: src/sys/compat/common

2020-02-23 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Feb 23 15:57:09 UTC 2020

Modified Files:
src/sys/compat/common: kern_xxx_12.c

Log Message:
Don't bother with kernel_lock for kern_reboot().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/common/kern_xxx_12.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/common/kern_xxx_12.c
diff -u src/sys/compat/common/kern_xxx_12.c:1.17 src/sys/compat/common/kern_xxx_12.c:1.18
--- src/sys/compat/common/kern_xxx_12.c:1.17	Wed Jan  1 22:57:17 2020
+++ src/sys/compat/common/kern_xxx_12.c	Sun Feb 23 15:57:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_xxx_12.c,v 1.17 2020/01/01 22:57:17 thorpej Exp $	*/
+/*	$NetBSD: kern_xxx_12.c,v 1.18 2020/02/23 15:57:09 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.17 2020/01/01 22:57:17 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_xxx_12.c,v 1.18 2020/02/23 15:57:09 ad Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -68,9 +68,7 @@ compat_12_sys_reboot(struct lwp *l,
 	if ((error = kauth_authorize_system(l->l_cred,
 	KAUTH_SYSTEM_REBOOT, 0, NULL, NULL, NULL)) != 0)
 		return (error);
-	KERNEL_LOCK(1, NULL);
 	kern_reboot(SCARG(uap, opt), NULL);
-	KERNEL_UNLOCK_ONE(NULL);
 	return (0);
 }
 



CVS commit: src/sys/compat/common

2020-02-23 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sun Feb 23 15:57:09 UTC 2020

Modified Files:
src/sys/compat/common: kern_xxx_12.c

Log Message:
Don't bother with kernel_lock for kern_reboot().


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/common/kern_xxx_12.c

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



CVS commit: src/sys/compat/common

2020-02-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Feb 22 09:42:20 UTC 2020

Modified Files:
src/sys/compat/common: uipc_syscalls_40.c

Log Message:
pass the address of the field, instead of relying on it being the first
field of the structure, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/uipc_syscalls_40.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/common/uipc_syscalls_40.c
diff -u src/sys/compat/common/uipc_syscalls_40.c:1.21 src/sys/compat/common/uipc_syscalls_40.c:1.22
--- src/sys/compat/common/uipc_syscalls_40.c:1.21	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/common/uipc_syscalls_40.c	Sat Feb 22 09:42:20 2020
@@ -1,9 +1,9 @@
-/*	$NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $	*/
+/*	$NetBSD: uipc_syscalls_40.c,v 1.22 2020/02/22 09:42:20 maxv Exp $	*/
 
 /* written by Pavel Cahyna, 2006. Public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.21 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.22 2020/02/22 09:42:20 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -119,7 +119,7 @@ compat_ifconf(u_long cmd, void *data)
 			} else {
 space -= sa->sa_len - sizeof(*sa);
 if (space >= sz) {
-	error = copyout(, ifrp,
+	error = copyout(_name, ifrp,
 	sizeof(ifr.ifr_name));
 	if (error == 0) {
 		error = copyout(sa,



CVS commit: src/sys/compat/common

2020-02-22 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Feb 22 09:42:20 UTC 2020

Modified Files:
src/sys/compat/common: uipc_syscalls_40.c

Log Message:
pass the address of the field, instead of relying on it being the first
field of the structure, no functional change


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/uipc_syscalls_40.c

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



CVS commit: src/sys/compat/common

2020-01-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 30 14:07:40 UTC 2020

Modified Files:
src/sys/compat/common: kern_info_43.c

Log Message:
- make sure size is not used uninitialized
- limit size range
- fix type botch for "size"
from maxv@


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/common/kern_info_43.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/common/kern_info_43.c
diff -u src/sys/compat/common/kern_info_43.c:1.38 src/sys/compat/common/kern_info_43.c:1.39
--- src/sys/compat/common/kern_info_43.c:1.38	Thu Jan  2 10:42:26 2020
+++ src/sys/compat/common/kern_info_43.c	Thu Jan 30 09:07:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_info_43.c,v 1.38 2020/01/02 15:42:26 thorpej Exp $	*/
+/*	$NetBSD: kern_info_43.c,v 1.39 2020/01/30 14:07:40 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.38 2020/01/02 15:42:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_info_43.c,v 1.39 2020/01/30 14:07:40 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -172,11 +172,19 @@ compat_43_sys_getkerninfo(struct lwp *l,
 		syscallarg(int) arg;
 	} */
 	int error, name[6];
+	int isize;
 	size_t size;
 
-	if (SCARG(uap, size) && (error = copyin((void *)SCARG(uap, size),
-	(void *), sizeof(size
-		return (error);
+	if (!SCARG(uap, size))
+		return EINVAL;
+
+	if ((error = copyin(SCARG(uap, size), , sizeof(isize))) != 0)
+		return error;
+
+	if (isize < 0 || isize > 4096)
+		return EINVAL;
+
+	size = isize;
 
 	switch (SCARG(uap, op) & 0xff00) {
 



CVS commit: src/sys/compat/common

2020-01-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 30 14:07:40 UTC 2020

Modified Files:
src/sys/compat/common: kern_info_43.c

Log Message:
- make sure size is not used uninitialized
- limit size range
- fix type botch for "size"
from maxv@


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

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



CVS commit: src/sys/compat/common

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:48:22 UTC 2020

Modified Files:
src/sys/compat/common: uipc_syscalls_50.c

Log Message:
Don't reference ifp->if_data directly; use if_export_if_data().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/common/uipc_syscalls_50.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/common/uipc_syscalls_50.c
diff -u src/sys/compat/common/uipc_syscalls_50.c:1.10 src/sys/compat/common/uipc_syscalls_50.c:1.11
--- src/sys/compat/common/uipc_syscalls_50.c:1.10	Sun Dec 15 16:48:26 2019
+++ src/sys/compat/common/uipc_syscalls_50.c	Wed Jan 29 05:48:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls_50.c,v 1.10 2019/12/15 16:48:26 tsutsui Exp $	*/
+/*	$NetBSD: uipc_syscalls_50.c,v 1.11 2020/01/29 05:48:22 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,6 +58,7 @@
 static int
 compat_ifdatareq(struct lwp *l, u_long cmd, void *data)
 {
+	struct if_data ifi;
 	struct oifdatareq *ifdr = data;
 	struct ifnet *ifp;
 	int error;
@@ -78,7 +79,8 @@ compat_ifdatareq(struct lwp *l, u_long c
 	/* Do work. */
 	switch (cmd) {
 	case OSIOCGIFDATA:
-		ifdatan2o(>ifdr_data, >if_data);
+		if_export_if_data(ifp, , false);
+		ifdatan2o(>ifdr_data, );
 		return 0;
 
 	case OSIOCZIFDATA:
@@ -90,13 +92,9 @@ compat_ifdatareq(struct lwp *l, u_long c
 			if (error != 0)
 return error;
 		}
-		ifdatan2o(>ifdr_data, >if_data);
-		/*
-		 * Assumes that the volatile counters that can be
-		 * zero'ed are at the end of if_data.
-		 */
-		memset(>if_data.ifi_ipackets, 0, sizeof(ifp->if_data) -
-		offsetof(struct if_data, ifi_ipackets));
+		if_export_if_data(ifp, , true);
+		ifdatan2o(>ifdr_data, );
+		/* XXX if_lastchange? */
 		return 0;
 
 	default:



CVS commit: src/sys/compat/common

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:48:22 UTC 2020

Modified Files:
src/sys/compat/common: uipc_syscalls_50.c

Log Message:
Don't reference ifp->if_data directly; use if_export_if_data().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/common/uipc_syscalls_50.c

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



CVS commit: src/sys/compat/common

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:47:12 UTC 2020

Modified Files:
src/sys/compat/common: rtsock_14.c rtsock_50.c

Log Message:
Don't reference ifp->if_data directly; use if_export_if_data().


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/rtsock_14.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/common/rtsock_50.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/common/rtsock_14.c
diff -u src/sys/compat/common/rtsock_14.c:1.9 src/sys/compat/common/rtsock_14.c:1.10
--- src/sys/compat/common/rtsock_14.c:1.9	Thu Dec 12 02:15:42 2019
+++ src/sys/compat/common/rtsock_14.c	Wed Jan 29 05:47:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_14.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $	*/
+/*	$NetBSD: rtsock_14.c,v 1.10 2020/01/29 05:47:12 thorpej Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.9 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_14.c,v 1.10 2020/01/29 05:47:12 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -99,6 +99,7 @@ void
 compat_14_rt_oifmsg(struct ifnet *ifp)
 {
 	struct if_msghdr14 oifm;
+	struct if_data ifi;
 	struct mbuf *m;
 	struct rt_addrinfo info;
 	struct timeval tv;
@@ -107,26 +108,27 @@ compat_14_rt_oifmsg(struct ifnet *ifp)
 		return;
 	(void)memset(, 0, sizeof(info));
 	(void)memset(, 0, sizeof(oifm));
+	if_export_if_data(ifp, , false);
 	oifm.ifm_index = ifp->if_index;
 	oifm.ifm_flags = ifp->if_flags;
-	oifm.ifm_data.ifi_type = ifp->if_data.ifi_type;
-	oifm.ifm_data.ifi_addrlen = ifp->if_data.ifi_addrlen;
-	oifm.ifm_data.ifi_hdrlen = ifp->if_data.ifi_hdrlen;
-	oifm.ifm_data.ifi_mtu = ifp->if_data.ifi_mtu;
-	oifm.ifm_data.ifi_metric = ifp->if_data.ifi_metric;
-	oifm.ifm_data.ifi_baudrate = ifp->if_data.ifi_baudrate;
-	oifm.ifm_data.ifi_ipackets = ifp->if_data.ifi_ipackets;
-	oifm.ifm_data.ifi_ierrors = ifp->if_data.ifi_ierrors;
-	oifm.ifm_data.ifi_opackets = ifp->if_data.ifi_opackets;
-	oifm.ifm_data.ifi_oerrors = ifp->if_data.ifi_oerrors;
-	oifm.ifm_data.ifi_collisions = ifp->if_data.ifi_collisions;
-	oifm.ifm_data.ifi_ibytes = ifp->if_data.ifi_ibytes;
-	oifm.ifm_data.ifi_obytes = ifp->if_data.ifi_obytes;
-	oifm.ifm_data.ifi_imcasts = ifp->if_data.ifi_imcasts;
-	oifm.ifm_data.ifi_omcasts = ifp->if_data.ifi_omcasts;
-	oifm.ifm_data.ifi_iqdrops = ifp->if_data.ifi_iqdrops;
-	oifm.ifm_data.ifi_noproto = ifp->if_data.ifi_noproto;
-	TIMESPEC_TO_TIMEVAL(, >if_data.ifi_lastchange);
+	oifm.ifm_data.ifi_type = ifi.ifi_type;
+	oifm.ifm_data.ifi_addrlen = ifi.ifi_addrlen;
+	oifm.ifm_data.ifi_hdrlen = ifi.ifi_hdrlen;
+	oifm.ifm_data.ifi_mtu = ifi.ifi_mtu;
+	oifm.ifm_data.ifi_metric = ifi.ifi_metric;
+	oifm.ifm_data.ifi_baudrate = ifi.ifi_baudrate;
+	oifm.ifm_data.ifi_ipackets = ifi.ifi_ipackets;
+	oifm.ifm_data.ifi_ierrors = ifi.ifi_ierrors;
+	oifm.ifm_data.ifi_opackets = ifi.ifi_opackets;
+	oifm.ifm_data.ifi_oerrors = ifi.ifi_oerrors;
+	oifm.ifm_data.ifi_collisions = ifi.ifi_collisions;
+	oifm.ifm_data.ifi_ibytes = ifi.ifi_ibytes;
+	oifm.ifm_data.ifi_obytes = ifi.ifi_obytes;
+	oifm.ifm_data.ifi_imcasts = ifi.ifi_imcasts;
+	oifm.ifm_data.ifi_omcasts = ifi.ifi_omcasts;
+	oifm.ifm_data.ifi_iqdrops = ifi.ifi_iqdrops;
+	oifm.ifm_data.ifi_noproto = ifi.ifi_noproto;
+	TIMESPEC_TO_TIMEVAL(, _lastchange);
 	timeval_to_timeval50(, _data.ifi_lastchange);
 	oifm.ifm_addrs = 0;
 	m = compat_50_rt_msg1(RTM_OOIFINFO, , (void *), sizeof(oifm));
@@ -140,30 +142,32 @@ compat_14_iflist(struct ifnet *ifp, stru
 struct rt_addrinfo *info, size_t len)
 {
 	struct if_msghdr14 *ifm;
+	struct if_data ifi;
 	struct timeval tv;
 	int error;
 
 	ifm = (struct if_msghdr14 *)w->w_tmem;
+	if_export_if_data(ifp, , false);
 	ifm->ifm_index = ifp->if_index;
 	ifm->ifm_flags = ifp->if_flags;
-	ifm->ifm_data.ifi_type = ifp->if_data.ifi_type;
-	ifm->ifm_data.ifi_addrlen = ifp->if_data.ifi_addrlen;
-	ifm->ifm_data.ifi_hdrlen = ifp->if_data.ifi_hdrlen;
-	ifm->ifm_data.ifi_mtu = ifp->if_data.ifi_mtu;
-	ifm->ifm_data.ifi_metric = ifp->if_data.ifi_metric;
-	ifm->ifm_data.ifi_baudrate = ifp->if_data.ifi_baudrate;
-	ifm->ifm_data.ifi_ipackets = ifp->if_data.ifi_ipackets;
-	ifm->ifm_data.ifi_ierrors = ifp->if_data.ifi_ierrors;
-	ifm->ifm_data.ifi_opackets = ifp->if_data.ifi_opackets;
-	ifm->ifm_data.ifi_oerrors = ifp->if_data.ifi_oerrors;
-	ifm->ifm_data.ifi_collisions = ifp->if_data.ifi_collisions;
-	ifm->ifm_data.ifi_ibytes = ifp->if_data.ifi_ibytes;
-	ifm->ifm_data.ifi_obytes = ifp->if_data.ifi_obytes;
-	ifm->ifm_data.ifi_imcasts = ifp->if_data.ifi_imcasts;
-	ifm->ifm_data.ifi_omcasts = ifp->if_data.ifi_omcasts;
-	ifm->ifm_data.ifi_iqdrops = ifp->if_data.ifi_iqdrops;
-	ifm->ifm_data.ifi_noproto = ifp->if_data.ifi_noproto;
-	TIMESPEC_TO_TIMEVAL(, >if_data.ifi_lastchange);
+	

CVS commit: src/sys/compat/common

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:47:12 UTC 2020

Modified Files:
src/sys/compat/common: rtsock_14.c rtsock_50.c

Log Message:
Don't reference ifp->if_data directly; use if_export_if_data().


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/common/rtsock_14.c
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/common/rtsock_50.c

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



CVS commit: src/sys/compat/common

2020-01-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 22 23:41:29 UTC 2020

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
Since this used to be part of the compat_50 module, make it depend on
compat_50 rather than compat_60 module.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_50_quota.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/common/compat_50_quota.c
diff -u src/sys/compat/common/compat_50_quota.c:1.1 src/sys/compat/common/compat_50_quota.c:1.2
--- src/sys/compat/common/compat_50_quota.c:1.1	Tue Jan 21 02:37:16 2020
+++ src/sys/compat/common/compat_50_quota.c	Wed Jan 22 23:41:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_50_quota.c,v 1.1 2020/01/21 02:37:16 pgoyette Exp $ */
+/*	$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.1 2020/01/21 02:37:16 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_50_quota.c,v 1.2 2020/01/22 23:41:29 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -164,7 +164,7 @@ compat_50_sys_quotactl(struct lwp *l, co
 	return error;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_60");
+MODULE(MODULE_CLASS_EXEC, compat_50_quota, "compat_50");
 
 static int
 compat_50_quota_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/common

2020-01-22 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 22 23:41:29 UTC 2020

Modified Files:
src/sys/compat/common: compat_50_quota.c

Log Message:
Since this used to be part of the compat_50 module, make it depend on
compat_50 rather than compat_60 module.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_50_quota.c

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



CVS commit: src/sys/compat/common

2020-01-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan  4 02:40:22 UTC 2020

Modified Files:
src/sys/compat/common: compat_90_mod.c

Log Message:
Resurrect boottime, but only in the compat_90 module (whether built-in
or separately loaded).  This will enable running of old vmstat(1) images
on newer kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_90_mod.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/common/compat_90_mod.c
diff -u src/sys/compat/common/compat_90_mod.c:1.2 src/sys/compat/common/compat_90_mod.c:1.3
--- src/sys/compat/common/compat_90_mod.c:1.2	Mon Oct 28 23:32:15 2019
+++ src/sys/compat/common/compat_90_mod.c	Sat Jan  4 02:40:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $	*/
+/*	$NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.3 2020/01/04 02:40:22 pgoyette Exp $");
 
 #include 
 #include 
@@ -77,3 +77,5 @@ compat_90_modcmd(modcmd_t cmd, void *arg
 		return ENOTTY;
 	}
 }
+
+struct timespec boottime;	/* For access by older vmstat */



CVS commit: src/sys/compat/common

2020-01-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jan  4 02:40:22 UTC 2020

Modified Files:
src/sys/compat/common: compat_90_mod.c

Log Message:
Resurrect boottime, but only in the compat_90 module (whether built-in
or separately loaded).  This will enable running of old vmstat(1) images
on newer kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_90_mod.c

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



CVS commit: src/sys/compat/common

2020-01-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan  1 19:35:21 UTC 2020

Removed Files:
src/sys/compat/common: compat_mod.c

Log Message:
Emove vestigial remains of the monolithic compat module.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r0 src/sys/compat/common/compat_mod.c

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



CVS commit: src/sys/compat/common

2020-01-01 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan  1 19:35:21 UTC 2020

Removed Files:
src/sys/compat/common: compat_mod.c

Log Message:
Emove vestigial remains of the monolithic compat module.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r0 src/sys/compat/common/compat_mod.c

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



CVS commit: src/sys/compat/common

2019-12-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Dec 28 15:39:52 UTC 2019

Modified Files:
src/sys/compat/common: compat_30_mod.c

Log Message:
For the built-in COMPAT_30 module code, make sure to initialize the
uipc_syscalls_30 stuff, notably to include compat_30_socket().

PR kern/54804

XXX Pullup-9 XXX


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_30_mod.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/common/compat_30_mod.c
diff -u src/sys/compat/common/compat_30_mod.c:1.2 src/sys/compat/common/compat_30_mod.c:1.3
--- src/sys/compat/common/compat_30_mod.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/compat_30_mod.c	Sat Dec 28 15:39:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_30_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: compat_30_mod.c,v 1.3 2019/12/28 15:39:52 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_30_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_30_mod.c,v 1.3 2019/12/28 15:39:52 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -66,6 +66,12 @@ compat_30_init(void)
 		vfs_syscalls_30_fini();
 		return error;
 	}
+	error = uipc_syscalls_30_init();
+	if (error != 0) {
+		kern_time_30_fini();
+		vfs_syscalls_30_fini();
+		return error;
+	}
 	bio_30_init();
 	vnd_30_init();
 	usb_30_init();
@@ -82,18 +88,24 @@ compat_30_fini(void)
 	vnd_30_fini();
 	bio_30_fini();
 
-	error = kern_time_30_fini();
+	error = uipc_syscalls_30_fini();
 	if (error != 0)
 		goto err1;
 
-	error = vfs_syscalls_30_fini();
+	error = kern_time_30_fini();
 	if (error != 0)
 		goto err2;
 
+	error = vfs_syscalls_30_fini();
+	if (error != 0)
+		goto err3;
+
 	return 0;
 
- err2:
+ err3:
 	kern_time_30_init();
+ err2:
+	uipc_syscalls_30_init();
  err1:
 	bio_30_init();
 	vnd_30_init();



CVS commit: src/sys/compat/common

2019-12-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Dec 28 15:39:52 UTC 2019

Modified Files:
src/sys/compat/common: compat_30_mod.c

Log Message:
For the built-in COMPAT_30 module code, make sure to initialize the
uipc_syscalls_30 stuff, notably to include compat_30_socket().

PR kern/54804

XXX Pullup-9 XXX


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_30_mod.c

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



CVS commit: src/sys/compat/common

2019-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 28 23:32:15 UTC 2019

Modified Files:
src/sys/compat/common: compat_90_mod.c

Log Message:
Don't ignore EBUSY from disestablish or we can crash by unloading busy
syscalls.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_90_mod.c

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



CVS commit: src/sys/compat/common

2019-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 28 23:32:15 UTC 2019

Modified Files:
src/sys/compat/common: compat_90_mod.c

Log Message:
Don't ignore EBUSY from disestablish or we can crash by unloading busy
syscalls.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/compat_90_mod.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/common/compat_90_mod.c
diff -u src/sys/compat/common/compat_90_mod.c:1.1 src/sys/compat/common/compat_90_mod.c:1.2
--- src/sys/compat/common/compat_90_mod.c:1.1	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/common/compat_90_mod.c	Mon Oct 28 19:32:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_90_mod.c,v 1.1 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.1 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_90_mod.c,v 1.2 2019/10/28 23:32:15 christos Exp $");
 
 #include 
 #include 
@@ -50,18 +50,14 @@ int
 compat_90_init(void)
 {
 
-	vfs_syscalls_90_init();
-
-	return 0;
+	return vfs_syscalls_90_init();
 }
 
 int
 compat_90_fini(void)
 {
 
-	vfs_syscalls_90_fini();
-
-	return 0;
+	return vfs_syscalls_90_fini();
 }
 
 MODULE(MODULE_CLASS_EXEC, compat_90, NULL);



CVS commit: src/sys/compat/common

2019-10-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct  4 05:48:11 UTC 2019

Modified Files:
src/sys/compat/common: rtsock_50.c

Log Message:
 Make clog static. Found by lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/common/rtsock_50.c

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



CVS commit: src/sys/compat/common

2019-10-03 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct  4 05:48:11 UTC 2019

Modified Files:
src/sys/compat/common: rtsock_50.c

Log Message:
 Make clog static. Found by lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/common/rtsock_50.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/common/rtsock_50.c
diff -u src/sys/compat/common/rtsock_50.c:1.13 src/sys/compat/common/rtsock_50.c:1.14
--- src/sys/compat/common/rtsock_50.c:1.13	Mon Apr 29 16:12:30 2019
+++ src/sys/compat/common/rtsock_50.c	Fri Oct  4 05:48:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.13 2019/04/29 16:12:30 roy Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.14 2019/10/04 05:48:11 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.13 2019/04/29 16:12:30 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.14 2019/10/04 05:48:11 msaitoh Exp $");
 
 #define	COMPAT_RTSOCK	/* Use the COMPATNAME/COMPATCALL macros and the
 			 * various other compat definitions - see
@@ -71,7 +71,7 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,
 #include 
 #include 
 
-struct sysctllog *clog;
+static struct sysctllog *clog;
 
 void
 compat_50_rt_oifmsg(struct ifnet *ifp)



CVS commit: src/sys/compat/common

2019-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  3 19:56:16 UTC 2019

Modified Files:
src/sys/compat/common: compat_80_mod.c

Log Message:
Since we now have a compat_90 module, the compat_80 module should depend
on it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/compat_80_mod.c

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



CVS commit: src/sys/compat/common

2019-10-03 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Oct  3 19:56:16 UTC 2019

Modified Files:
src/sys/compat/common: compat_80_mod.c

Log Message:
Since we now have a compat_90 module, the compat_80 module should depend
on it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/compat_80_mod.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/common/compat_80_mod.c
diff -u src/sys/compat/common/compat_80_mod.c:1.4 src/sys/compat/common/compat_80_mod.c:1.5
--- src/sys/compat/common/compat_80_mod.c:1.4	Fri May 17 07:37:11 2019
+++ src/sys/compat/common/compat_80_mod.c	Thu Oct  3 19:56:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_80_mod.c,v 1.4 2019/05/17 07:37:11 msaitoh Exp $	*/
+/*	$NetBSD: compat_80_mod.c,v 1.5 2019/10/03 19:56:16 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.4 2019/05/17 07:37:11 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.5 2019/10/03 19:56:16 pgoyette Exp $");
 
 #include 
 #include 
@@ -66,7 +66,7 @@ compat_80_fini(void)
 	return 0;
 }
 
-MODULE(MODULE_CLASS_EXEC, compat_80, NULL);
+MODULE(MODULE_CLASS_EXEC, compat_80, "compat_90");
 
 static int
 compat_80_modcmd(modcmd_t cmd, void *arg)



CVS commit: src/sys/compat/common

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:28:27 UTC 2019

Modified Files:
src/sys/compat/common: if_media_80.c rndpseudo_50.c usb_subr_30.c
vfs_syscalls_20.c

Log Message:
fix sign-compare issues.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/if_media_80.c
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/rndpseudo_50.c \
src/sys/compat/common/usb_subr_30.c
cvs rdiff -u -r1.42 -r1.43 src/sys/compat/common/vfs_syscalls_20.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/common/if_media_80.c
diff -u src/sys/compat/common/if_media_80.c:1.1 src/sys/compat/common/if_media_80.c:1.2
--- src/sys/compat/common/if_media_80.c:1.1	Fri May 17 03:37:11 2019
+++ src/sys/compat/common/if_media_80.c	Wed Sep 25 21:28:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media_80.c,v 1.1 2019/05/17 07:37:11 msaitoh Exp $	*/
+/*	$NetBSD: if_media_80.c,v 1.2 2019/09/26 01:28:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -126,8 +126,8 @@ compat_ifmediareq_post(struct ifreq *ifr
 {
 	struct ifmediareq *ifmr = (struct ifmediareq *)ifr;
 	size_t minwords;
-	int count, *kptr;
-	int error;
+	size_t count;
+	int error, *kptr;
 
 	switch (cmd) {
 	case SIOCSIFMEDIA:

Index: src/sys/compat/common/rndpseudo_50.c
diff -u src/sys/compat/common/rndpseudo_50.c:1.4 src/sys/compat/common/rndpseudo_50.c:1.5
--- src/sys/compat/common/rndpseudo_50.c:1.4	Fri Mar  1 06:06:56 2019
+++ src/sys/compat/common/rndpseudo_50.c	Wed Sep 25 21:28:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpseudo_50.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -76,7 +76,7 @@ compat_50_rnd_ioctl(struct file *fp, u_l
 	{
 		rndstat_t rstbuf = {.start = 0};
 		rndstat50_t *rst50 = (rndstat50_t *)addr;
-		int count;
+		size_t count;
 
 		if (rst50->count > RND_MAXSTATCOUNT50)
 			return EINVAL;
Index: src/sys/compat/common/usb_subr_30.c
diff -u src/sys/compat/common/usb_subr_30.c:1.4 src/sys/compat/common/usb_subr_30.c:1.5
--- src/sys/compat/common/usb_subr_30.c:1.4	Fri Mar  1 06:06:56 2019
+++ src/sys/compat/common/usb_subr_30.c	Wed Sep 25 21:28:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr_30.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -131,7 +131,8 @@ usbd_fill_deviceinfo_old(struct usbd_dev
 int (*do_printBCD)(char *cp, size_t l, int bcd))
 {
 	struct usbd_port *p;
-	int i, j, err;
+	size_t i, j;
+	int err;
 
 	di->udi_bus = device_unit(dev->ud_bus->ub_usbctl);
 	di->udi_addr = dev->ud_addr;
@@ -171,7 +172,7 @@ usbd_fill_deviceinfo_old(struct usbd_dev
 		return 0;
 	}
 
-	const int nports = dev->ud_hub->uh_hubdesc.bNbrPorts;
+	const u_int nports = dev->ud_hub->uh_hubdesc.bNbrPorts;
 	for (i = 1; i <= __arraycount(di->udi_ports) && i <= nports;
 	 i++) {
 		p = >ud_hub->uh_ports[i - 1];

Index: src/sys/compat/common/vfs_syscalls_20.c
diff -u src/sys/compat/common/vfs_syscalls_20.c:1.42 src/sys/compat/common/vfs_syscalls_20.c:1.43
--- src/sys/compat/common/vfs_syscalls_20.c:1.42	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/common/vfs_syscalls_20.c	Wed Sep 25 21:28:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_20.c,v 1.42 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_20.c,v 1.43 2019/09/26 01:28:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.42 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.43 2019/09/26 01:28:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -104,7 +104,7 @@ statvfs_to_statfs12(const void *vfs, voi
 {
 	struct statfs12 ofs, *bfs = vbfs;
 	const struct statvfs *fs = vfs;
-	int i;
+	size_t i;
 	ofs.f_type = 0;
 	ofs.f_oflags = (short)fs->f_flag;
 



CVS commit: src/sys/compat/common

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:28:27 UTC 2019

Modified Files:
src/sys/compat/common: if_media_80.c rndpseudo_50.c usb_subr_30.c
vfs_syscalls_20.c

Log Message:
fix sign-compare issues.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/common/if_media_80.c
cvs rdiff -u -r1.4 -r1.5 src/sys/compat/common/rndpseudo_50.c \
src/sys/compat/common/usb_subr_30.c
cvs rdiff -u -r1.42 -r1.43 src/sys/compat/common/vfs_syscalls_20.c

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



CVS commit: src/sys/compat/common

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:53:09 UTC 2019

Modified Files:
src/sys/compat/common: if_43.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/common/if_43.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/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.22 src/sys/compat/common/if_43.c:1.23
--- src/sys/compat/common/if_43.c:1.22	Fri May 17 07:37:11 2019
+++ src/sys/compat/common/if_43.c	Mon Sep 23 06:53:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.22 2019/05/17 07:37:11 msaitoh Exp $	*/
+/*	$NetBSD: if_43.c,v 1.23 2019/09/23 06:53:09 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.22 2019/05/17 07:37:11 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.23 2019/09/23 06:53:09 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -253,7 +253,7 @@ compat_ifioctl(struct socket *so, u_long
 	}
 	if (cmd != ocmd) {
 		oifr = data;
-		data = ifr = 
+		ifr = 
 		IFREQO2N_43(oifr, ifr);
 	}
 



CVS commit: src/sys/compat/common

2019-09-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Sep 23 06:53:09 UTC 2019

Modified Files:
src/sys/compat/common: if_43.c

Log Message:
Remove unused assignment. Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/common/if_43.c

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



CVS commit: src/sys/compat/common

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:05:22 UTC 2019

Modified Files:
src/sys/compat/common: kern_select_50.c

Log Message:
Validate usec ranges in compat_50_sys_select()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/kern_select_50.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/common/kern_select_50.c
diff -u src/sys/compat/common/kern_select_50.c:1.2 src/sys/compat/common/kern_select_50.c:1.3
--- src/sys/compat/common/kern_select_50.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/kern_select_50.c	Fri Sep 20 15:05:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_select_50.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: kern_select_50.c,v 1.3 2019/09/20 15:05:22 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_select_50.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_select_50.c,v 1.3 2019/09/20 15:05:22 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -114,6 +114,10 @@ compat_50_sys_select(struct lwp *l,
 		error = copyin(SCARG(uap, tv), (void *), sizeof(atv50));
 		if (error)
 			return error;
+
+		if (atv50.tv_usec < 0 || atv50.tv_usec >= 100)
+			return EINVAL;
+
 		ats.tv_sec = atv50.tv_sec;
 		ats.tv_nsec = atv50.tv_usec * 1000;
 		ts = 



CVS commit: src/sys/compat/common

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:05:22 UTC 2019

Modified Files:
src/sys/compat/common: kern_select_50.c

Log Message:
Validate usec ranges in compat_50_sys_select()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/kern_select_50.c

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



CVS commit: src/sys/compat/common

2019-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 14:59:15 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
Add QUOTA ifdef (Paul Goyette)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/vfs_syscalls_50.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/common/vfs_syscalls_50.c
diff -u src/sys/compat/common/vfs_syscalls_50.c:1.21 src/sys/compat/common/vfs_syscalls_50.c:1.22
--- src/sys/compat/common/vfs_syscalls_50.c:1.21	Mon Jun 17 10:13:13 2019
+++ src/sys/compat/common/vfs_syscalls_50.c	Mon Jun 17 10:59:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_50.c,v 1.21 2019/06/17 14:13:13 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls_50.c,v 1.22 2019/06/17 14:59:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.21 2019/06/17 14:13:13 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.22 2019/06/17 14:59:15 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -95,7 +95,9 @@ static const struct syscall_package vfs_
 	{ SYS_compat_50_futimes, 0, (sy_call_t *)compat_50_sys_futimes },
 	{ SYS_compat_50_lutimes, 0, (sy_call_t *)compat_50_sys_lutimes },
 	{ SYS_compat_50_mknod, 0, (sy_call_t *)compat_50_sys_mknod },
+#ifdef QUOTA
 	{ SYS_compat_50_quotactl, 0, (sy_call_t *)compat_50_sys_quotactl },
+#endif
 	{ 0, 0, NULL }
 };
 



CVS commit: src/sys/compat/common

2019-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 14:59:15 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
Add QUOTA ifdef (Paul Goyette)


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/common/vfs_syscalls_50.c

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



CVS commit: src/sys/compat/common

2019-06-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jun 17 14:13:13 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
Use tabs, not spaces, for indentation.  NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/common/vfs_syscalls_50.c

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



CVS commit: src/sys/compat/common

2019-06-17 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Jun 17 14:13:13 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
Use tabs, not spaces, for indentation.  NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/common/vfs_syscalls_50.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/common/vfs_syscalls_50.c
diff -u src/sys/compat/common/vfs_syscalls_50.c:1.20 src/sys/compat/common/vfs_syscalls_50.c:1.21
--- src/sys/compat/common/vfs_syscalls_50.c:1.20	Mon Jun 17 12:27:40 2019
+++ src/sys/compat/common/vfs_syscalls_50.c	Mon Jun 17 14:13:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_50.c,v 1.20 2019/06/17 12:27:40 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_50.c,v 1.21 2019/06/17 14:13:13 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.20 2019/06/17 12:27:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.21 2019/06/17 14:13:13 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -86,16 +86,16 @@ static void cvtstat(struct stat30 *, con
 
 static const struct syscall_package vfs_syscalls_50_syscalls[] = {
 	{ SYS_compat_50___stat30, 0, (sy_call_t *)compat_50_sys___stat30 },
-{ SYS_compat_50___fstat30, 0, (sy_call_t *)compat_50_sys___fstat30 },
-{ SYS_compat_50___lstat30, 0, (sy_call_t *)compat_50_sys___lstat30 },
-{ SYS_compat_50___fhstat40, 0, (sy_call_t *)compat_50_sys___fhstat40 },
+	{ SYS_compat_50___fstat30, 0, (sy_call_t *)compat_50_sys___fstat30 },
+	{ SYS_compat_50___lstat30, 0, (sy_call_t *)compat_50_sys___lstat30 },
+	{ SYS_compat_50___fhstat40, 0, (sy_call_t *)compat_50_sys___fhstat40 },
 	{ SYS_compat_50_utimes, 0, (sy_call_t *)compat_50_sys_utimes },
-{ SYS_compat_50_lfs_segwait, 0,
+	{ SYS_compat_50_lfs_segwait, 0,
 	(sy_call_t *)compat_50_sys_lfs_segwait } ,
-{ SYS_compat_50_futimes, 0, (sy_call_t *)compat_50_sys_futimes },
-{ SYS_compat_50_lutimes, 0, (sy_call_t *)compat_50_sys_lutimes },
+	{ SYS_compat_50_futimes, 0, (sy_call_t *)compat_50_sys_futimes },
+	{ SYS_compat_50_lutimes, 0, (sy_call_t *)compat_50_sys_lutimes },
 	{ SYS_compat_50_mknod, 0, (sy_call_t *)compat_50_sys_mknod },
-{ SYS_compat_50_quotactl, 0, (sy_call_t *)compat_50_sys_quotactl },
+	{ SYS_compat_50_quotactl, 0, (sy_call_t *)compat_50_sys_quotactl },
 	{ 0, 0, NULL }
 };
 



CVS commit: src/sys/compat/common

2019-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 12:27:40 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
If we don't compile a kernel with QUOTA, we don't support the compat quota
syscalls. XXX: need to fix the modules build.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/common/vfs_syscalls_50.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/common/vfs_syscalls_50.c
diff -u src/sys/compat/common/vfs_syscalls_50.c:1.19 src/sys/compat/common/vfs_syscalls_50.c:1.20
--- src/sys/compat/common/vfs_syscalls_50.c:1.19	Sat Jan 26 21:08:39 2019
+++ src/sys/compat/common/vfs_syscalls_50.c	Mon Jun 17 08:27:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_50.c,v 1.19 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: vfs_syscalls_50.c,v 1.20 2019/06/17 12:27:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,10 +36,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.19 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_50.c,v 1.20 2019/06/17 12:27:40 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
+#include "opt_quota.h"
 #endif
 
 #include 
@@ -68,9 +69,11 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls
 
 #include 
 
+#ifdef QUOTA
 #include 
 #include 
 #include 
+#endif
 
 #include 
 #include 
@@ -341,6 +344,7 @@ compat_50_sys_mknod(struct lwp *l,
 	SCARG(uap, dev), retval, UIO_USERSPACE);
 }
 
+#ifdef QUOTA
 /* ARGSUSED */
 int   
 compat_50_sys_quotactl(struct lwp *l, const struct compat_50_sys_quotactl_args *uap, register_t *retval)
@@ -450,6 +454,7 @@ compat_50_sys_quotactl(struct lwp *l, co
 	vrele(vp);
 	return error;
 }
+#endif
 
 int 
 vfs_syscalls_50_init(void)



CVS commit: src/sys/compat/common

2019-06-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jun 17 12:27:40 UTC 2019

Modified Files:
src/sys/compat/common: vfs_syscalls_50.c

Log Message:
If we don't compile a kernel with QUOTA, we don't support the compat quota
syscalls. XXX: need to fix the modules build.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/common/vfs_syscalls_50.c

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



CVS commit: src/sys/compat/common

2019-04-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 29 08:31:29 UTC 2019

Modified Files:
src/sys/compat/common: rtsock_50.c rtsock_70.c

Log Message:
Move the set-up of the net.oroute... sysctl tree to compat_50 since
the new AF_ROUTE was introduced in NetBSD-6.0


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/rtsock_70.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/common/rtsock_50.c
diff -u src/sys/compat/common/rtsock_50.c:1.10 src/sys/compat/common/rtsock_50.c:1.11
--- src/sys/compat/common/rtsock_50.c:1.10	Fri Mar  1 11:06:56 2019
+++ src/sys/compat/common/rtsock_50.c	Mon Apr 29 08:31:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.11 2019/04/29 08:31:29 pgoyette Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.10 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.11 2019/04/29 08:31:29 pgoyette Exp $");
 
 #define	COMPAT_RTSOCK	/* Use the COMPATNAME/COMPATCALL macros and the
 			 * various other compat definitions - see
@@ -71,6 +71,8 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,
 #include 
 #include 
 
+struct sysctllog *clog;
+
 void
 compat_50_rt_oifmsg(struct ifnet *ifp)
 {
@@ -164,12 +166,14 @@ rtsock_50_init(void)
 	compat_50_rt_ifannouncemsg);
 	MODULE_HOOK_SET(rtsock_rt_ieee80211msg_50_hook, "rts_50",
 	compat_50_rt_ieee80211msg);
+	sysctl_net_route_setup(, PF_OROUTE, "ortable");
 }
  
 void
 rtsock_50_fini(void)
 {  
 
+	sysctl_teardown();
 	MODULE_HOOK_UNSET(rtsock_iflist_50_hook); 
 	MODULE_HOOK_UNSET(rtsock_oifmsg_50_hook); 
 	MODULE_HOOK_UNSET(rtsock_rt_missmsg_50_hook); 

Index: src/sys/compat/common/rtsock_70.c
diff -u src/sys/compat/common/rtsock_70.c:1.6 src/sys/compat/common/rtsock_70.c:1.7
--- src/sys/compat/common/rtsock_70.c:1.6	Mon Apr 29 05:42:09 2019
+++ src/sys/compat/common/rtsock_70.c	Mon Apr 29 08:31:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_70.c,v 1.6 2019/04/29 05:42:09 pgoyette Exp $	*/
+/*	$NetBSD: rtsock_70.c,v 1.7 2019/04/29 08:31:29 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.6 2019/04/29 05:42:09 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.7 2019/04/29 08:31:29 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -46,8 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,
 #include 
 #include 
 
-struct sysctllog *clog;
-
 void
 compat_70_rt_newaddrmsg1(int cmd, struct ifaddr *ifa)
 {
@@ -124,14 +122,12 @@ rtsock_70_init(void)
 	MODULE_HOOK_SET(rtsock_newaddr_70_hook, "rts_70",
 	compat_70_rt_newaddrmsg1);
 	MODULE_HOOK_SET(rtsock_iflist_70_hook, "rts_70", compat_70_iflist_addr);
-	sysctl_net_route_setup(, PF_OROUTE, "ortable");
 }
 
 void
 rtsock_70_fini(void)
 {
 
-	sysctl_teardown();
 	MODULE_HOOK_UNSET(rtsock_newaddr_70_hook);
 	MODULE_HOOK_UNSET(rtsock_iflist_70_hook);
 }



CVS commit: src/sys/compat/common

2019-04-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 29 08:31:29 UTC 2019

Modified Files:
src/sys/compat/common: rtsock_50.c rtsock_70.c

Log Message:
Move the set-up of the net.oroute... sysctl tree to compat_50 since
the new AF_ROUTE was introduced in NetBSD-6.0


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/rtsock_70.c

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



CVS commit: src/sys/compat/common

2019-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 17 09:21:57 UTC 2019

Modified Files:
src/sys/compat/common: compat_70_mod.c compat_80_mod.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_70_mod.c \
src/sys/compat/common/compat_80_mod.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/common/compat_70_mod.c
diff -u src/sys/compat/common/compat_70_mod.c:1.2 src/sys/compat/common/compat_70_mod.c:1.3
--- src/sys/compat/common/compat_70_mod.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/compat_70_mod.c	Wed Apr 17 09:21:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_70_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: compat_70_mod.c,v 1.3 2019/04/17 09:21:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_70_mod.c,v 1.3 2019/04/17 09:21:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -54,7 +54,8 @@ __KERNEL_RCSID(0, "$NetBSD: compat_70_mo
 #include 
 #include 
 
-int compat_70_init(void)
+int
+compat_70_init(void)
 {
 
 	compat70_ocreds_valid = true;
@@ -64,7 +65,8 @@ int compat_70_init(void)
 	return 0;
 }
 
-int compat_70_fini(void)
+int
+compat_70_fini(void)
 {
 
 	uipc_usrreq_70_fini();
Index: src/sys/compat/common/compat_80_mod.c
diff -u src/sys/compat/common/compat_80_mod.c:1.2 src/sys/compat/common/compat_80_mod.c:1.3
--- src/sys/compat/common/compat_80_mod.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/compat_80_mod.c	Wed Apr 17 09:21:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_80_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: compat_80_mod.c,v 1.3 2019/04/17 09:21:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_80_mod.c,v 1.3 2019/04/17 09:21:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -46,7 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: compat_80_mo
 #include 
 #include 
 
-int compat_80_init(void)
+int
+compat_80_init(void)
 {
 
 	kern_mod_80_init();
@@ -54,7 +55,8 @@ int compat_80_init(void)
 	return 0;
 }
 
-int compat_80_fini(void)
+int
+compat_80_fini(void)
 {
 
 	kern_mod_80_fini();



CVS commit: src/sys/compat/common

2019-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Apr 17 09:21:57 UTC 2019

Modified Files:
src/sys/compat/common: compat_70_mod.c compat_80_mod.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_70_mod.c \
src/sys/compat/common/compat_80_mod.c

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



CVS commit: src/sys/compat/common

2019-04-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 14 11:35:54 UTC 2019

Modified Files:
src/sys/compat/common: vnd_50.c

Log Message:
Only need to #include sys/vnode.h once


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/vnd_50.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/common/vnd_50.c
diff -u src/sys/compat/common/vnd_50.c:1.3 src/sys/compat/common/vnd_50.c:1.4
--- src/sys/compat/common/vnd_50.c:1.3	Fri Mar  1 11:06:56 2019
+++ src/sys/compat/common/vnd_50.c	Sun Apr 14 11:35:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $	*/
+/*	$NetBSD: vnd_50.c,v 1.4 2019/04/14 11:35:54 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vnd_50.c,v 1.3 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd_50.c,v 1.4 2019/04/14 11:35:54 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -87,7 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: vnd_50.c,v 1
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 



CVS commit: src/sys/compat/common

2019-04-14 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Apr 14 11:35:54 UTC 2019

Modified Files:
src/sys/compat/common: vnd_50.c

Log Message:
Only need to #include sys/vnode.h once


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/vnd_50.c

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



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

2019-01-28 Thread Paul Goyette

On Mon, 28 Jan 2019, bch wrote:


I take it back. Your email seemed to beat the repo commit, but my latest
update built a working kernel. Thx.


Oh, thank goodness!  I was just about to ask you to run the failing 
command under ktrace...


I'm so very glad it is (or appears to be) fixed.




-bch

On Mon, Jan 28, 2019 at 8:57 PM bch  wrote:


This still doesn???t seem to be working... up-to-the-minute src here.

-bch

On Mon, Jan 28, 2019 at 8:01 PM Paul Goyette  wrote:


Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 29 04:01:45 UTC 2019

Modified Files:
src/sys/compat/common: if_43.c

Log Message:
The if43_20_hook function returns an errno; use it to determine whether
to allow conversion of the ioctl cmd --> ncmd

Should address issue reported by msaitoh@ on irc as well as via e-mail
from Patrick Welche and Ryo ONODERA.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/common/if_43.c

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





!DSPAM:5c4ff6669191445413715!



+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++

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

2019-01-28 Thread bch
I take it back. Your email seemed to beat the repo commit, but my latest
update built a working kernel. Thx.

-bch

On Mon, Jan 28, 2019 at 8:57 PM bch  wrote:

> This still doesn’t seem to be working... up-to-the-minute src here.
>
> -bch
>
> On Mon, Jan 28, 2019 at 8:01 PM Paul Goyette  wrote:
>
>> Module Name:src
>> Committed By:   pgoyette
>> Date:   Tue Jan 29 04:01:45 UTC 2019
>>
>> Modified Files:
>> src/sys/compat/common: if_43.c
>>
>> Log Message:
>> The if43_20_hook function returns an errno; use it to determine whether
>> to allow conversion of the ioctl cmd --> ncmd
>>
>> Should address issue reported by msaitoh@ on irc as well as via e-mail
>> from Patrick Welche and Ryo ONODERA.
>>
>>
>> To generate a diff of this commit:
>> cvs rdiff -u -r1.16 -r1.17 src/sys/compat/common/if_43.c
>>
>> Please note that diffs are not public domain; they are subject to the
>> copyright notices on the relevant files.
>>
>>


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

2019-01-28 Thread bch
This still doesn’t seem to be working... up-to-the-minute src here.

-bch

On Mon, Jan 28, 2019 at 8:01 PM Paul Goyette  wrote:

> Module Name:src
> Committed By:   pgoyette
> Date:   Tue Jan 29 04:01:45 UTC 2019
>
> Modified Files:
> src/sys/compat/common: if_43.c
>
> Log Message:
> The if43_20_hook function returns an errno; use it to determine whether
> to allow conversion of the ioctl cmd --> ncmd
>
> Should address issue reported by msaitoh@ on irc as well as via e-mail
> from Patrick Welche and Ryo ONODERA.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.16 -r1.17 src/sys/compat/common/if_43.c
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
>


CVS commit: src/sys/compat/common

2019-01-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 29 04:01:45 UTC 2019

Modified Files:
src/sys/compat/common: if_43.c

Log Message:
The if43_20_hook function returns an errno; use it to determine whether
to allow conversion of the ioctl cmd --> ncmd

Should address issue reported by msaitoh@ on irc as well as via e-mail
from Patrick Welche and Ryo ONODERA.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/common/if_43.c

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



CVS commit: src/sys/compat/common

2019-01-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 29 04:01:45 UTC 2019

Modified Files:
src/sys/compat/common: if_43.c

Log Message:
The if43_20_hook function returns an errno; use it to determine whether
to allow conversion of the ioctl cmd --> ncmd

Should address issue reported by msaitoh@ on irc as well as via e-mail
from Patrick Welche and Ryo ONODERA.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/compat/common/if_43.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/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.16 src/sys/compat/common/if_43.c:1.17
--- src/sys/compat/common/if_43.c:1.16	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/if_43.c	Tue Jan 29 04:01:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.16 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: if_43.c,v 1.17 2019/01/29 04:01:45 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.16 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.17 2019/01/29 04:01:45 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -212,8 +212,13 @@ compat_cvtcmd(u_long cmd)
 		case TAPGIFNAME:
 			return ncmd;
 		default:
-			MODULE_CALL_HOOK(if43_20_hook, (ncmd), enosys(), ncmd);
-			return ncmd;
+		{	int rv;
+
+			MODULE_CALL_HOOK(if43_20_hook, (ncmd), enosys(), rv);
+			if (rv == 0)
+return ncmd;
+			return cmd;
+		}
 		}
 	}
 }



CVS commit: src/sys/compat/common

2019-01-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 27 21:25:24 UTC 2019

Modified Files:
src/sys/compat/common: kern_mod_80.c

Log Message:
Include new header from correct directory


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/kern_mod_80.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/common/kern_mod_80.c
diff -u src/sys/compat/common/kern_mod_80.c:1.3 src/sys/compat/common/kern_mod_80.c:1.4
--- src/sys/compat/common/kern_mod_80.c:1.3	Sun Jan 27 18:29:10 2019
+++ src/sys/compat/common/kern_mod_80.c	Sun Jan 27 21:25:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_mod_80.c,v 1.3 2019/01/27 18:29:10 christos Exp $	*/
+/*	$NetBSD: kern_mod_80.c,v 1.4 2019/01/27 21:25:24 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.3 2019/01/27 18:29:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_mod_80.c,v 1.4 2019/01/27 21:25:24 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -49,7 +49,8 @@ __KERNEL_RCSID(0, "$NetBSD: kern_mod_80.
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 #include 
 



CVS commit: src/sys/compat/common

2019-01-27 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Jan 27 21:25:24 UTC 2019

Modified Files:
src/sys/compat/common: kern_mod_80.c

Log Message:
Include new header from correct directory


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/kern_mod_80.c

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



CVS commit: src/sys/compat/common

2019-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 03:00:48 UTC 2019

Modified Files:
src/sys/compat/common: ccd_60.c

Log Message:
make this compile again (enable #if 0 code)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/ccd_60.c

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



CVS commit: src/sys/compat/common

2019-01-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 27 03:00:48 UTC 2019

Modified Files:
src/sys/compat/common: ccd_60.c

Log Message:
make this compile again (enable #if 0 code)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/ccd_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/common/ccd_60.c
diff -u src/sys/compat/common/ccd_60.c:1.8 src/sys/compat/common/ccd_60.c:1.9
--- src/sys/compat/common/ccd_60.c:1.8	Sat Jan 26 21:08:39 2019
+++ src/sys/compat/common/ccd_60.c	Sat Jan 26 22:00:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ccd_60.c,v 1.8 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: ccd_60.c,v 1.9 2019/01/27 03:00:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.8 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.9 2019/01/27 03:00:48 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -46,7 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1
  * sizeof (size_t) == sizeof (uint64_t) as CCDIOCSET will
  * be the same as CCDIOCSET_60
  */
-#if 0
 static int
 compat_60_ccdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l,
 int (*f)(dev_t, u_long, void *, int, struct lwp *))
@@ -91,7 +90,6 @@ compat_60_ccdioctl(dev_t dev, u_long cmd
 		return ENOSYS;
 	}
 }
-#endif
 
 void
 ccd_60_init(void)



CVS commit: src/sys/compat/common

2018-10-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 30 14:35:16 UTC 2018

Modified Files:
src/sys/compat/common: kern_time_50.c

Log Message:
Zero ntptimeval50 too to prevent 4-byte kernel stack disclosure.

>From Thomas Barabosch of Fraunhofer FKIE.

XXX pullup-7, pullup-8 (along with rev. 1.60 of kern_ntptime.c)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/common/kern_time_50.c

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



CVS commit: src/sys/compat/common

2018-10-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Oct 30 14:35:16 UTC 2018

Modified Files:
src/sys/compat/common: kern_time_50.c

Log Message:
Zero ntptimeval50 too to prevent 4-byte kernel stack disclosure.

>From Thomas Barabosch of Fraunhofer FKIE.

XXX pullup-7, pullup-8 (along with rev. 1.60 of kern_ntptime.c)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/common/kern_time_50.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/common/kern_time_50.c
diff -u src/sys/compat/common/kern_time_50.c:1.31 src/sys/compat/common/kern_time_50.c:1.32
--- src/sys/compat/common/kern_time_50.c:1.31	Fri Mar 11 18:32:29 2016
+++ src/sys/compat/common/kern_time_50.c	Tue Oct 30 14:35:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time_50.c,v 1.31 2016/03/11 18:32:29 christos Exp $	*/
+/*	$NetBSD: kern_time_50.c,v 1.32 2018/10/30 14:35:16 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.31 2016/03/11 18:32:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time_50.c,v 1.32 2018/10/30 14:35:16 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_aio.h"
@@ -526,6 +526,7 @@ compat_50_sys___ntp_gettime30(struct lwp
 
 	if (SCARG(uap, ntvp)) {
 		ntp_gettime();
+		memset(, 0, sizeof(ntv50));
 		timespec_to_timespec50(, );
 		ntv50.maxerror = ntv.maxerror;
 		ntv50.esterror = ntv.esterror;



CVS commit: src/sys/compat/common

2018-09-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 12 02:24:25 UTC 2018

Modified Files:
src/sys/compat/common: uipc_syscalls_50.c

Log Message:
 Fix a bug that SIOC[GZ]IFDATA returned old ifreq structure.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/uipc_syscalls_50.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/common/uipc_syscalls_50.c
diff -u src/sys/compat/common/uipc_syscalls_50.c:1.5 src/sys/compat/common/uipc_syscalls_50.c:1.6
--- src/sys/compat/common/uipc_syscalls_50.c:1.5	Thu Apr 26 08:11:18 2018
+++ src/sys/compat/common/uipc_syscalls_50.c	Wed Sep 12 02:24:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls_50.c,v 1.5 2018/04/26 08:11:18 roy Exp $	*/
+/*	$NetBSD: uipc_syscalls_50.c,v 1.6 2018/09/12 02:24:25 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.5 2018/04/26 08:11:18 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.6 2018/09/12 02:24:25 msaitoh Exp $");
 
 #include 
 #include 
@@ -65,23 +65,24 @@ compat_ifdatareq(struct lwp *l, u_long c
 
 	/* Validate arguments. */
 	switch (cmd) {
-	case SIOCGIFDATA:
-	case SIOCZIFDATA:
-		ifp = ifunit(ifdr->ifdr_name);
-		if (ifp == NULL)
-			return ENXIO;
+	case OSIOCGIFDATA:
+	case OSIOCZIFDATA:
 		break;
 	default:
 		return ENOSYS;
 	}
 
+	ifp = ifunit(ifdr->ifdr_name);
+	if (ifp == NULL)
+		return ENXIO;
+
 	/* Do work. */
 	switch (cmd) {
-	case SIOCGIFDATA:
+	case OSIOCGIFDATA:
 		ifdatan2o(>ifdr_data, >if_data);
 		return 0;
 
-	case SIOCZIFDATA:
+	case OSIOCZIFDATA:
 		if (l != NULL) {
 			error = kauth_authorize_network(l->l_cred,
 			KAUTH_NETWORK_INTERFACE,



CVS commit: src/sys/compat/common

2018-09-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep 12 02:24:25 UTC 2018

Modified Files:
src/sys/compat/common: uipc_syscalls_50.c

Log Message:
 Fix a bug that SIOC[GZ]IFDATA returned old ifreq structure.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/uipc_syscalls_50.c

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



CVS commit: src/sys/compat/common

2018-06-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  5 00:58:17 UTC 2018

Modified Files:
src/sys/compat/common: Makefile

Log Message:
use the standard rules, instead of rolling our own.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/compat/common/Makefile

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



CVS commit: src/sys/compat/common

2018-06-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun  5 00:58:17 UTC 2018

Modified Files:
src/sys/compat/common: Makefile

Log Message:
use the standard rules, instead of rolling our own.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/compat/common/Makefile

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/common/Makefile
diff -u src/sys/compat/common/Makefile:1.63 src/sys/compat/common/Makefile:1.64
--- src/sys/compat/common/Makefile:1.63	Tue Dec 19 23:46:19 2017
+++ src/sys/compat/common/Makefile	Mon Jun  4 20:58:17 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.63 2017/12/20 04:46:19 maya Exp $
+#	$NetBSD: Makefile,v 1.64 2018/06/05 00:58:17 christos Exp $
 
 LIB=		compat
 NOPIC=		# defined
@@ -23,15 +23,9 @@ libinstall::
 .undef DESTDIR
 .include 
 
-lib${LIB}.o:: ${OBJS:O}
-	@echo building standard ${LIB} library
-	@rm -f lib${LIB}.o
-	@${LD} -r -o lib${LIB}.o ${LDFLAGS} `NM=${NM} ${LORDER} ${OBJS} | ${TSORT}`
-
-lib${LIB}.po:: ${POBJS:O}
-	@echo building profiled ${LIB} library
-	@rm -f lib${LIB}.po
-	@${LD} -r -o lib${LIB}.po ${LDFLAGS} `NM=${NM} ${LORDER} ${POBJS} | ${TSORT}`
+lib${LIB}.o:: ${OBJS:O} __buildstdlib
+
+lib${LIB}.po:: ${POBJS:O} __buildproflib
 
 showsources: ${SRCS}
 	@echo ${.ALLSRC}



CVS commit: src/sys/compat/common

2018-05-10 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu May 10 09:33:46 UTC 2018

Modified Files:
src/sys/compat/common: rtsock_50.c

Log Message:
Added missing ifi_link_state at compat_50_rt_oifmsg() and compat_50_iflist().


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/rtsock_50.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/common/rtsock_50.c
diff -u src/sys/compat/common/rtsock_50.c:1.6 src/sys/compat/common/rtsock_50.c:1.7
--- src/sys/compat/common/rtsock_50.c:1.6	Sat Dec 16 09:10:30 2017
+++ src/sys/compat/common/rtsock_50.c	Thu May 10 09:33:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.6 2017/12/16 09:10:30 maxv Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.7 2018/05/10 09:33:46 nonaka Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.6 2017/12/16 09:10:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.7 2018/05/10 09:33:46 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -95,6 +95,7 @@ compat_50_rt_oifmsg(struct ifnet *ifp)
 	oifm.ifm_data.ifi_type = ifp->if_data.ifi_type;
 	oifm.ifm_data.ifi_addrlen = ifp->if_data.ifi_addrlen;
 	oifm.ifm_data.ifi_hdrlen = ifp->if_data.ifi_hdrlen;
+	oifm.ifm_data.ifi_link_state = ifp->if_data.ifi_link_state;
 	oifm.ifm_data.ifi_mtu = ifp->if_data.ifi_mtu;
 	oifm.ifm_data.ifi_metric = ifp->if_data.ifi_metric;
 	oifm.ifm_data.ifi_baudrate = ifp->if_data.ifi_baudrate;
@@ -131,6 +132,7 @@ compat_50_iflist(struct ifnet *ifp, stru
 	ifm->ifm_data.ifi_type = ifp->if_data.ifi_type;
 	ifm->ifm_data.ifi_addrlen = ifp->if_data.ifi_addrlen;
 	ifm->ifm_data.ifi_hdrlen = ifp->if_data.ifi_hdrlen;
+	ifm->ifm_data.ifi_link_state = ifp->if_data.ifi_link_state;
 	ifm->ifm_data.ifi_mtu = ifp->if_data.ifi_mtu;
 	ifm->ifm_data.ifi_metric = ifp->if_data.ifi_metric;
 	ifm->ifm_data.ifi_baudrate = ifp->if_data.ifi_baudrate;



  1   2   3   >