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

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.



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.
>
>


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

2017-12-17 Thread matthew green
> >> Modified Files:
> >>src/sys/compat/common: Makefile.inc
> >>
> >> Log Message:
> >> Build libcompat as an object, not as a library. We want all of its
> >> functions compiled in, because compat modules loaded from the filesystem
> >> may depend on them.
> > 
> > this breaks mips64 kernels:
> > 
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  kern_ipc_10.o: ABI is incompatible with that of the selected emula
> tion
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  failed to merge target specific data of file kern_ipc_10.o
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  sysv_shm_50.o: ABI is incompatible with that of the selected emula
> tion
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  failed to merge target specific data of file sysv_shm_50.o
> > [ ... ]
> 
> Do you know where exactly this comes from? In kern_ipc_10.c nothing should be
> built since mips64 is _LP64.

i'm not sure what it is -- i assume some bug in a makefile
that adds or misses the right options.  mips64 is fairly
sensitive to this, but i didn't check what the ABI of the
wrong parts was before testing the backout.

i'm not sure i'll get as chance to look at this soon.


.mrg.


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

2017-12-17 Thread Michael
Hello,

On Sun, 17 Dec 2017 10:48:33 +0100
Maxime Villard  wrote:

> >> Modified Files:
> >>src/sys/compat/common: Makefile.inc
> >>
> >> Log Message:
> >> Build libcompat as an object, not as a library. We want all of its
> >> functions compiled in, because compat modules loaded from the filesystem
> >> may depend on them.  
> > 
> > this breaks mips64 kernels:
> > 
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  kern_ipc_10.o: ABI is incompatible with that of the selected emulation
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  failed to merge target specific data of file kern_ipc_10.o
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  sysv_shm_50.o: ABI is incompatible with that of the selected emulation
> > /var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
> >  failed to merge target specific data of file sysv_shm_50.o
> > [ ... ]  
> 
> Do you know where exactly this comes from? In kern_ipc_10.c nothing should be
> built since mips64 is _LP64.

Not necessarily - it's perfectly reasonable to build kernels as n32
( read: ILP32 but with 64bit registers and such ) on certain hardware.

have fun
Michael


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

2017-12-17 Thread Maxime Villard

Le 17/12/2017 à 09:58, matthew green a écrit :

"Maxime Villard" writes:

Module Name:src
Committed By:   maxv
Date:   Sat Dec 16 08:31:36 UTC 2017

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

Log Message:
Build libcompat as an object, not as a library. We want all of its
functions compiled in, because compat modules loaded from the filesystem
may depend on them.


this breaks mips64 kernels:

/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 kern_ipc_10.o: ABI is incompatible with that of the selected emulation
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 failed to merge target specific data of file kern_ipc_10.o
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 sysv_shm_50.o: ABI is incompatible with that of the selected emulation
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 failed to merge target specific data of file sysv_shm_50.o
[ ... ]


Do you know where exactly this comes from? In kern_ipc_10.c nothing should be
built since mips64 is _LP64.


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

2017-12-17 Thread matthew green
"Maxime Villard" writes:
> Module Name:  src
> Committed By: maxv
> Date: Sat Dec 16 08:31:36 UTC 2017
> 
> Modified Files:
>   src/sys/compat/common: Makefile.inc
> 
> Log Message:
> Build libcompat as an object, not as a library. We want all of its
> functions compiled in, because compat modules loaded from the filesystem
> may depend on them.

this breaks mips64 kernels:

/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 kern_ipc_10.o: ABI is incompatible with that of the selected emulation
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 failed to merge target specific data of file kern_ipc_10.o
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 sysv_shm_50.o: ABI is incompatible with that of the selected emulation
/var/obj/evbmips-mips64eb/usr/src/tooldir.NetBSD-7.1_STABLE-amd64/bin/mips64--netbsd-ld:
 failed to merge target specific data of file sysv_shm_50.o
[ ... ]

it also shouldn't be necessary for non-MODULAR kernels.
(same for compat_util.c.)

AFAICT, there is no reason to build this as as object
for non-modular. or to include anything else that isn't
link-time missing.

note that i'm fairly sure that your change only exposed
a latent bug in COMPAT_AS=library on mips64, but it's
also wrong to use it there anyway.

thanks.


.mrg.


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

2017-12-16 Thread Maxime Villard

Le 16/12/2017 à 09:36, Paul Goyette a écrit :

Sounds to me like this could/should be its own module compat_lib and
other modules which require its functions can put compat_lib in their
required-modules list so it can be auto-loaded.


Yes, it should be something like that. Right now however I'm trying to
fix the module dependencies, so I'll come back to compat_lib later.


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

2017-12-16 Thread Paul Goyette
Sounds to me like this could/should be its own module compat_lib and 
other modules which require its functions can put compat_lib in their 
required-modules list so it can be auto-loaded.




On Sat, 16 Dec 2017, Maxime Villard wrote:


Module Name:src
Committed By:   maxv
Date:   Sat Dec 16 08:31:36 UTC 2017

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

Log Message:
Build libcompat as an object, not as a library. We want all of its
functions compiled in, because compat modules loaded from the filesystem
may depend on them.


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

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


!DSPAM:5a34da0d1060213934!




+--+--++
| 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 |
+--+--++


CVS commit: src/sys/compat/common

2010-03-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  2 14:23:40 UTC 2010

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

Log Message:
fs_union.h is not used here anymore ... diudau


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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.51 src/sys/compat/common/vfs_syscalls_43.c:1.52
--- src/sys/compat/common/vfs_syscalls_43.c:1.51	Fri Jan  8 11:35:07 2010
+++ src/sys/compat/common/vfs_syscalls_43.c	Tue Mar  2 14:23:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.51 2010/01/08 11:35:07 pooka Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.52 2010/03/02 14:23:39 pooka Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,11 +37,10 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_syscalls_43.c,v 1.51 2010/01/08 11:35:07 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_syscalls_43.c,v 1.52 2010/03/02 14:23:39 pooka Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
-#include fs_union.h
 #endif
 
 #include sys/param.h



CVS commit: src/sys/compat/common

2010-03-02 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Tue Mar  2 14:23:40 UTC 2010

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

Log Message:
fs_union.h is not used here anymore ... diudau


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