CVS commit: src/sys/compat/sunos32

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:24:41 UTC 2017

Modified Files:
src/sys/compat/sunos32: sunos32_syscall.h sunos32_syscallargs.h
sunos32_syscalls.c sunos32_sysent.c syscalls.master

Log Message:
compat sunos32: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/sunos32/sunos32_syscall.h
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/sunos32/sunos32_syscallargs.h \
src/sys/compat/sunos32/sunos32_syscalls.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/sunos32/sunos32_sysent.c
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/sunos32/syscalls.master

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



CVS commit: src/sys/compat/sunos32

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:24:41 UTC 2017

Modified Files:
src/sys/compat/sunos32: sunos32_syscall.h sunos32_syscallargs.h
sunos32_syscalls.c sunos32_sysent.c syscalls.master

Log Message:
compat sunos32: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/sunos32/sunos32_syscall.h
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/sunos32/sunos32_syscallargs.h \
src/sys/compat/sunos32/sunos32_syscalls.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/sunos32/sunos32_sysent.c
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/sunos32/syscalls.master

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

Modified files:

Index: src/sys/compat/sunos32/sunos32_syscall.h
diff -u src/sys/compat/sunos32/sunos32_syscall.h:1.33 src/sys/compat/sunos32/sunos32_syscall.h:1.34
--- src/sys/compat/sunos32/sunos32_syscall.h:1.33	Wed May 10 06:19:49 2017
+++ src/sys/compat/sunos32/sunos32_syscall.h	Tue Dec 19 08:24:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_syscall.h,v 1.33 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: sunos32_syscall.h,v 1.34 2017/12/19 08:24:41 kamil Exp $ */
 
 /*
  * System call numbers.
@@ -159,9 +159,7 @@
 /* syscall: "netbsd32_sbrk" ret: "int" args: "netbsd32_intptr_t" */
 #define	SUNOS32_SYS_netbsd32_sbrk	69
 
-/* syscall: "netbsd32_sstk" ret: "int" args: "int" */
-#define	SUNOS32_SYS_netbsd32_sstk	70
-
+/* 70 is obsolete sstk */
 /* syscall: "mmap" ret: "netbsd32_voidp" args: "netbsd32_voidp" "netbsd32_size_t" "int" "int" "int" "netbsd32_long" */
 #define	SUNOS32_SYS_mmap	71
 

Index: src/sys/compat/sunos32/sunos32_syscallargs.h
diff -u src/sys/compat/sunos32/sunos32_syscallargs.h:1.32 src/sys/compat/sunos32/sunos32_syscallargs.h:1.33
--- src/sys/compat/sunos32/sunos32_syscallargs.h:1.32	Wed May 10 06:19:49 2017
+++ src/sys/compat/sunos32/sunos32_syscallargs.h	Tue Dec 19 08:24:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_syscallargs.h,v 1.32 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: sunos32_syscallargs.h,v 1.33 2017/12/19 08:24:41 kamil Exp $ */
 
 /*
  * System call argument lists.
@@ -181,8 +181,6 @@ check_syscall_args(sunos32_sys_omsync)
 
 struct netbsd32_sbrk_args;
 
-struct netbsd32_sstk_args;
-
 struct sunos32_sys_mmap_args {
 	syscallarg(netbsd32_voidp) addr;
 	syscallarg(netbsd32_size_t) len;
@@ -568,8 +566,6 @@ int	sys_vfork(struct lwp *, const void *
 
 int	netbsd32_sbrk(struct lwp *, const struct netbsd32_sbrk_args *, register_t *);
 
-int	netbsd32_sstk(struct lwp *, const struct netbsd32_sstk_args *, register_t *);
-
 int	sunos32_sys_mmap(struct lwp *, const struct sunos32_sys_mmap_args *, register_t *);
 
 int	netbsd32_ovadvise(struct lwp *, const struct netbsd32_ovadvise_args *, register_t *);
Index: src/sys/compat/sunos32/sunos32_syscalls.c
diff -u src/sys/compat/sunos32/sunos32_syscalls.c:1.32 src/sys/compat/sunos32/sunos32_syscalls.c:1.33
--- src/sys/compat/sunos32/sunos32_syscalls.c:1.32	Wed May 10 06:19:49 2017
+++ src/sys/compat/sunos32/sunos32_syscalls.c	Tue Dec 19 08:24:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_syscalls.c,v 1.32 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: sunos32_syscalls.c,v 1.33 2017/12/19 08:24:41 kamil Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_syscalls.c,v 1.32 2017/05/10 06:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_syscalls.c,v 1.33 2017/12/19 08:24:41 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -102,7 +102,7 @@ const char *const sunos32_syscallnames[]
 	/*  67 */	"#67 (obsolete vread)",
 	/*  68 */	"#68 (obsolete vwrite)",
 	/*  69 */	"netbsd32_sbrk",
-	/*  70 */	"netbsd32_sstk",
+	/*  70 */	"#70 (obsolete sstk)",
 	/*  71 */	"mmap",
 	/*  72 */	"vadvise",
 	/*  73 */	"netbsd32_munmap",
@@ -375,7 +375,7 @@ const char *const altsunos32_syscallname
 	/*  67 */	NULL, /* obsolete vread */
 	/*  68 */	NULL, /* obsolete vwrite */
 	/*  69 */	"sbrk",
-	/*  70 */	"sstk",
+	/*  70 */	NULL, /* obsolete sstk */
 	/*  71 */	NULL, /* mmap */
 	/*  72 */	"ovadvise",
 	/*  73 */	"munmap",

Index: src/sys/compat/sunos32/sunos32_sysent.c
diff -u src/sys/compat/sunos32/sunos32_sysent.c:1.34 src/sys/compat/sunos32/sunos32_sysent.c:1.35
--- src/sys/compat/sunos32/sunos32_sysent.c:1.34	Wed May 10 06:19:49 2017
+++ src/sys/compat/sunos32/sunos32_sysent.c	Tue Dec 19 08:24:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos32_sysent.c,v 1.34 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: sunos32_sysent.c,v 1.35 2017/12/19 08:24:41 kamil Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_sysent.c,v 1.34 2017/05/10 06:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_sysent.c,v 1.35 2017/12/19 08:24:41 kamil Exp $");
 
 #if 

CVS commit: src/sys/compat/ultrix

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:23:23 UTC 2017

Modified Files:
src/sys/compat/ultrix: syscalls.master ultrix_syscall.h
ultrix_syscallargs.h ultrix_syscalls.c ultrix_sysent.c

Log Message:
compat ultrix: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/ultrix/syscalls.master
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/ultrix/ultrix_syscall.h
cvs rdiff -u -r1.63 -r1.64 src/sys/compat/ultrix/ultrix_syscallargs.h
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/ultrix/ultrix_syscalls.c
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/ultrix/ultrix_sysent.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/ultrix/syscalls.master
diff -u src/sys/compat/ultrix/syscalls.master:1.52 src/sys/compat/ultrix/syscalls.master:1.53
--- src/sys/compat/ultrix/syscalls.master:1.52	Thu Nov  7 19:37:19 2013
+++ src/sys/compat/ultrix/syscalls.master	Tue Dec 19 08:23:22 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.52 2013/11/07 19:37:19 njoly Exp $
+	$NetBSD: syscalls.master,v 1.53 2017/12/19 08:23:22 kamil Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -119,7 +119,7 @@
 67	OBSOL		vread
 68	OBSOL		vwrite
 69	NOARGS		{ int|sys||sbrk(intptr_t incr); }
-70	NOARGS		{ int|sys||sstk(int incr); }
+70	OBSOL		sstk
 71	STD		{ int|ultrix_sys||mmap(void *addr, size_t len, \
 			int prot, u_int flags, int fd, long pos); }
 72	NOARGS		{ int|sys||ovadvise(int anom); } vadvise
@@ -358,4 +358,3 @@
 			unsigned nbytes, int *start, char *arg); }
 257	STD		{ int|ultrix_sys||setsysinfo(unsigned op, char *buffer, \
 			unsigned nbytes, unsigned arg, unsigned flag); }
-

Index: src/sys/compat/ultrix/ultrix_syscall.h
diff -u src/sys/compat/ultrix/ultrix_syscall.h:1.68 src/sys/compat/ultrix/ultrix_syscall.h:1.69
--- src/sys/compat/ultrix/ultrix_syscall.h:1.68	Wed May 10 06:19:49 2017
+++ src/sys/compat/ultrix/ultrix_syscall.h	Tue Dec 19 08:23:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ultrix_syscall.h,v 1.68 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: ultrix_syscall.h,v 1.69 2017/12/19 08:23:22 kamil Exp $ */
 
 /*
  * System call numbers.
@@ -159,9 +159,7 @@
 /* syscall: "sbrk" ret: "int" args: "intptr_t" */
 #define	ULTRIX_SYS_sbrk	69
 
-/* syscall: "sstk" ret: "int" args: "int" */
-#define	ULTRIX_SYS_sstk	70
-
+/* 70 is obsolete sstk */
 /* syscall: "mmap" ret: "int" args: "void *" "size_t" "int" "u_int" "int" "long" */
 #define	ULTRIX_SYS_mmap	71
 

Index: src/sys/compat/ultrix/ultrix_syscallargs.h
diff -u src/sys/compat/ultrix/ultrix_syscallargs.h:1.63 src/sys/compat/ultrix/ultrix_syscallargs.h:1.64
--- src/sys/compat/ultrix/ultrix_syscallargs.h:1.63	Wed May 10 06:19:49 2017
+++ src/sys/compat/ultrix/ultrix_syscallargs.h	Tue Dec 19 08:23:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ultrix_syscallargs.h,v 1.63 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: ultrix_syscallargs.h,v 1.64 2017/12/19 08:23:22 kamil Exp $ */
 
 /*
  * System call argument lists.
@@ -147,8 +147,6 @@ struct compat_43_sys_fstat_args;
 
 struct sys_sbrk_args;
 
-struct sys_sstk_args;
-
 struct ultrix_sys_mmap_args {
 	syscallarg(void *) addr;
 	syscallarg(size_t) len;
@@ -528,8 +526,6 @@ int	sys_vfork(struct lwp *, const void *
 
 int	sys_sbrk(struct lwp *, const struct sys_sbrk_args *, register_t *);
 
-int	sys_sstk(struct lwp *, const struct sys_sstk_args *, register_t *);
-
 int	ultrix_sys_mmap(struct lwp *, const struct ultrix_sys_mmap_args *, register_t *);
 
 int	sys_ovadvise(struct lwp *, const struct sys_ovadvise_args *, register_t *);

Index: src/sys/compat/ultrix/ultrix_syscalls.c
diff -u src/sys/compat/ultrix/ultrix_syscalls.c:1.67 src/sys/compat/ultrix/ultrix_syscalls.c:1.68
--- src/sys/compat/ultrix/ultrix_syscalls.c:1.67	Wed May 10 06:19:49 2017
+++ src/sys/compat/ultrix/ultrix_syscalls.c	Tue Dec 19 08:23:22 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ultrix_syscalls.c,v 1.67 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: ultrix_syscalls.c,v 1.68 2017/12/19 08:23:22 kamil Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ultrix_syscalls.c,v 1.67 2017/05/10 06:19:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ultrix_syscalls.c,v 1.68 2017/12/19 08:23:22 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include 
@@ -93,7 +93,7 @@ const char *const ultrix_syscallnames[] 
 	/*  67 */	"#67 (obsolete vread)",
 	/*  68 */	"#68 (obsolete vwrite)",
 	/*  69 */	"sbrk",
-	/*  70 */	"sstk",
+	/*  70 */	"#70 (obsolete sstk)",
 	/*  71 */	"mmap",
 	/*  72 */	"vadvise",
 	/*  73 */	"munmap",
@@ -615,7 +615,7 @@ const char *const altultrix_syscallnames
 	/*  67 */	NULL, /* obsolete vread */
 	/*  68 */	NULL, /* obsolete vwrite */
 	/*  69 */	NULL, /* sbrk */
-	/*  70 */	NULL, /* sstk */
+	/*  70 */	NULL, /* obsolete sstk */
 	/*  

CVS commit: src/sys/compat/ultrix

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:23:23 UTC 2017

Modified Files:
src/sys/compat/ultrix: syscalls.master ultrix_syscall.h
ultrix_syscallargs.h ultrix_syscalls.c ultrix_sysent.c

Log Message:
compat ultrix: Drop the sstk(2) syscall

sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/ultrix/syscalls.master
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/ultrix/ultrix_syscall.h
cvs rdiff -u -r1.63 -r1.64 src/sys/compat/ultrix/ultrix_syscallargs.h
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/ultrix/ultrix_syscalls.c
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/ultrix/ultrix_sysent.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/aoutm68k

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:09:36 UTC 2017

Modified Files:
src/sys/compat/aoutm68k: aoutm68k_syscall.h aoutm68k_syscallargs.h
aoutm68k_syscalls.c aoutm68k_sysent.c syscalls.master

Log Message:
compat aoutm68k: Mark sstk(2) as OBSOL

Remove the sstk(2) syscall support and mark it as obsolete.
It has never been implemented in the kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/aoutm68k/aoutm68k_syscall.h
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/aoutm68k/aoutm68k_syscallargs.h
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/aoutm68k/aoutm68k_syscalls.c
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/aoutm68k/aoutm68k_sysent.c
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/aoutm68k/syscalls.master

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

Modified files:

Index: src/sys/compat/aoutm68k/aoutm68k_syscall.h
diff -u src/sys/compat/aoutm68k/aoutm68k_syscall.h:1.48 src/sys/compat/aoutm68k/aoutm68k_syscall.h:1.49
--- src/sys/compat/aoutm68k/aoutm68k_syscall.h:1.48	Wed May 10 06:19:48 2017
+++ src/sys/compat/aoutm68k/aoutm68k_syscall.h	Tue Dec 19 08:09:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscall.h,v 1.48 2017/05/10 06:19:48 riastradh Exp $ */
+/* $NetBSD: aoutm68k_syscall.h,v 1.49 2017/12/19 08:09:36 kamil Exp $ */
 
 /*
  * System call numbers.
@@ -267,9 +267,7 @@
 /* syscall: "sbrk" ret: "int" args: "intptr_t" */
 #define	AOUTM68K_SYS_sbrk	69
 
-/* syscall: "sstk" ret: "int" args: "int" */
-#define	AOUTM68K_SYS_sstk	70
-
+/* 70 is obsolete sstk */
 #if defined(COMPAT_43) || !defined(_KERNEL)
 /* syscall: "ommap" ret: "int" args: "void *" "size_t" "int" "int" "int" "long" */
 #define	AOUTM68K_SYS_ommap	71

Index: src/sys/compat/aoutm68k/aoutm68k_syscallargs.h
diff -u src/sys/compat/aoutm68k/aoutm68k_syscallargs.h:1.46 src/sys/compat/aoutm68k/aoutm68k_syscallargs.h:1.47
--- src/sys/compat/aoutm68k/aoutm68k_syscallargs.h:1.46	Wed May 10 06:19:48 2017
+++ src/sys/compat/aoutm68k/aoutm68k_syscallargs.h	Tue Dec 19 08:09:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscallargs.h,v 1.46 2017/05/10 06:19:48 riastradh Exp $ */
+/* $NetBSD: aoutm68k_syscallargs.h,v 1.47 2017/12/19 08:09:36 kamil Exp $ */
 
 /*
  * System call argument lists.
@@ -191,8 +191,6 @@ struct compat_12_sys_msync_args;
 #endif
 
 struct sys_sbrk_args;
-
-struct sys_sstk_args;
 #if defined(COMPAT_43) || !defined(_KERNEL)
 
 struct compat_43_sys_mmap_args;
@@ -824,8 +822,6 @@ int	sys_vfork(struct lwp *, const void *
 
 int	sys_sbrk(struct lwp *, const struct sys_sbrk_args *, register_t *);
 
-int	sys_sstk(struct lwp *, const struct sys_sstk_args *, register_t *);
-
 #if defined(COMPAT_43) || !defined(_KERNEL)
 int	compat_43_sys_mmap(struct lwp *, const struct compat_43_sys_mmap_args *, register_t *);
 

Index: src/sys/compat/aoutm68k/aoutm68k_syscalls.c
diff -u src/sys/compat/aoutm68k/aoutm68k_syscalls.c:1.45 src/sys/compat/aoutm68k/aoutm68k_syscalls.c:1.46
--- src/sys/compat/aoutm68k/aoutm68k_syscalls.c:1.45	Wed May 10 06:19:48 2017
+++ src/sys/compat/aoutm68k/aoutm68k_syscalls.c	Tue Dec 19 08:09:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_syscalls.c,v 1.45 2017/05/10 06:19:48 riastradh Exp $ */
+/* $NetBSD: aoutm68k_syscalls.c,v 1.46 2017/12/19 08:09:36 kamil Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.45 2017/05/10 06:19:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_syscalls.c,v 1.46 2017/12/19 08:09:36 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -152,7 +152,7 @@ const char *const aoutm68k_syscallnames[
 	/*  67 */	"#67 (obsolete vread)",
 	/*  68 */	"#68 (obsolete vwrite)",
 	/*  69 */	"sbrk",
-	/*  70 */	"sstk",
+	/*  70 */	"#70 (obsolete sstk)",
 #if defined(COMPAT_43) || !defined(_KERNEL)
 	/*  71 */	"ommap",
 #else
@@ -899,7 +899,7 @@ const char *const altaoutm68k_syscallnam
 	/*  67 */	NULL, /* obsolete vread */
 	/*  68 */	NULL, /* obsolete vwrite */
 	/*  69 */	NULL, /* sbrk */
-	/*  70 */	NULL, /* sstk */
+	/*  70 */	NULL, /* obsolete sstk */
 #if defined(COMPAT_43) || !defined(_KERNEL)
 	/*  71 */	"mmap",
 #else

Index: src/sys/compat/aoutm68k/aoutm68k_sysent.c
diff -u src/sys/compat/aoutm68k/aoutm68k_sysent.c:1.50 src/sys/compat/aoutm68k/aoutm68k_sysent.c:1.51
--- src/sys/compat/aoutm68k/aoutm68k_sysent.c:1.50	Wed May 10 06:19:48 2017
+++ src/sys/compat/aoutm68k/aoutm68k_sysent.c	Tue Dec 19 08:09:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_sysent.c,v 1.50 2017/05/10 06:19:48 riastradh Exp $ */
+/* $NetBSD: aoutm68k_sysent.c,v 1.51 2017/12/19 08:09:36 kamil Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.50 2017/05/10 06:19:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_sysent.c,v 1.51 2017/12/19 08:09:36 kamil Exp $");
 
 #if 

CVS commit: src/sys/compat/aoutm68k

2017-12-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 08:09:36 UTC 2017

Modified Files:
src/sys/compat/aoutm68k: aoutm68k_syscall.h aoutm68k_syscallargs.h
aoutm68k_syscalls.c aoutm68k_sysent.c syscalls.master

Log Message:
compat aoutm68k: Mark sstk(2) as OBSOL

Remove the sstk(2) syscall support and mark it as obsolete.
It has never been implemented in the kernel.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/aoutm68k/aoutm68k_syscall.h
cvs rdiff -u -r1.46 -r1.47 src/sys/compat/aoutm68k/aoutm68k_syscallargs.h
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/aoutm68k/aoutm68k_syscalls.c
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/aoutm68k/aoutm68k_sysent.c
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/aoutm68k/syscalls.master

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



CVS commit: src/sys/compat/netbsd32

2017-12-18 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 07:58:50 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_systrace_args.c syscalls.master

Log Message:
Sync syscalls.master in compat_netbsd32(8) with kern/syscalls.master

___lwp_part60 removed 'const' from the ts argument.

'const struct timespec *ts' -> 'struct timespec *ts'

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_systrace_args.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/netbsd32/syscalls.master

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.129 src/sys/compat/netbsd32/netbsd32_syscall.h:1.130
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.129	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Tue Dec 19 07:58:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.129 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.130 2017/12/19 07:58:50 kamil Exp $ */
 
 /*
  * System call numbers.
@@ -1248,7 +1248,7 @@
 /* syscall: "netbsd32_clock_nanosleep" ret: "int" args: "netbsd32_clockid_t" "int" "const netbsd32_timespecp_t" "netbsd32_timespecp_t" */
 #define	NETBSD32_SYS_netbsd32_clock_nanosleep	477
 
-/* syscall: "netbsd32lwp_park60" ret: "int" args: "netbsd32_clockid_t" "int" "const netbsd32_timespecp_t" "lwpid_t" "netbsd32_voidp" "netbsd32_voidp" */
+/* syscall: "netbsd32lwp_park60" ret: "int" args: "netbsd32_clockid_t" "int" "netbsd32_timespecp_t" "lwpid_t" "netbsd32_voidp" "netbsd32_voidp" */
 #define	NETBSD32_SYS_netbsd32lwp_park60	478
 
 /* syscall: "netbsd32_posix_fallocate" ret: "int" args: "int" "int" "netbsd32_off_t" "netbsd32_off_t" */
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.129 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.130
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.129	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Tue Dec 19 07:58:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.129 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.130 2017/12/19 07:58:50 kamil Exp $ */
 
 /*
  * System call argument lists.
@@ -2563,7 +2563,7 @@ check_syscall_args(netbsd32_clock_nanosl
 struct netbsd32lwp_park60_args {
 	syscallarg(netbsd32_clockid_t) clock_id;
 	syscallarg(int) flags;
-	syscallarg(const netbsd32_timespecp_t) ts;
+	syscallarg(netbsd32_timespecp_t) ts;
 	syscallarg(lwpid_t) unpark;
 	syscallarg(netbsd32_voidp) hint;
 	syscallarg(netbsd32_voidp) unparkhint;

Index: src/sys/compat/netbsd32/netbsd32_systrace_args.c
diff -u src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.19 src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.20
--- src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.19	Wed May 10 06:19:49 2017
+++ src/sys/compat/netbsd32/netbsd32_systrace_args.c	Tue Dec 19 07:58:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_systrace_args.c,v 1.19 2017/05/10 06:19:49 riastradh Exp $ */
+/* $NetBSD: netbsd32_systrace_args.c,v 1.20 2017/12/19 07:58:50 kamil Exp $ */
 
 /*
  * System call argument to DTrace register array converstion.
@@ -3423,7 +3423,7 @@ systrace_args(register_t sysnum, const v
 		const struct netbsd32lwp_park60_args *p = params;
 		iarg[0] = SCARG(p, clock_id); /* netbsd32_clockid_t */
 		iarg[1] = SCARG(p, flags); /* int */
-		uarg[2] = (intptr_t) SCARG(p, ts).i32; /* const netbsd32_timespecp_t */
+		uarg[2] = (intptr_t) SCARG(p, ts).i32; /* netbsd32_timespecp_t */
 		iarg[3] = SCARG(p, unpark); /* lwpid_t */
 		uarg[4] = (intptr_t) SCARG(p, hint).i32; /* netbsd32_voidp */
 		uarg[5] = (intptr_t) SCARG(p, unparkhint).i32; /* netbsd32_voidp */
@@ -9265,7 +9265,7 @@ systrace_entry_setargdesc(int sysnum, in
 			p = "int";
 			break;
 		case 2:
-			p = "const netbsd32_timespecp_t";
+			p = "netbsd32_timespecp_t";
 			break;
 		case 3:
 			p = "lwpid_t";

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.115 src/sys/compat/netbsd32/syscalls.master:1.116
--- src/sys/compat/netbsd32/syscalls.master:1.115	Wed Oct 19 09:44:01 2016
+++ src/sys/compat/netbsd32/syscalls.master	Tue Dec 19 07:58:50 2017
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.115 2016/10/19 09:44:01 skrll Exp $
+	$NetBSD: syscalls.master,v 1.116 2017/12/19 07:58:50 kamil Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1047,7 +1047,7 @@
 			netbsd32_timespecp_t rmtp); }
 478	STD 		{ int|netbsd32|60|_lwp_park(\
 			netbsd32_clockid_t 

CVS commit: src/sys/compat/netbsd32

2017-12-18 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Dec 19 07:58:50 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_systrace_args.c syscalls.master

Log Message:
Sync syscalls.master in compat_netbsd32(8) with kern/syscalls.master

___lwp_part60 removed 'const' from the ts argument.

'const struct timespec *ts' -> 'struct timespec *ts'

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_systrace_args.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/netbsd32/syscalls.master

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



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.


CVS commit: src/sys/compat/netbsd32

2017-12-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Dec 18 00:33:32 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
include  for siginfo32_t.


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

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.115 src/sys/compat/netbsd32/netbsd32.h:1.116
--- src/sys/compat/netbsd32/netbsd32.h:1.115	Sun Dec 17 20:59:27 2017
+++ src/sys/compat/netbsd32/netbsd32.h	Mon Dec 18 00:33:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.115 2017/12/17 20:59:27 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.116 2017/12/18 00:33:32 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/sys/compat/netbsd32

2017-12-17 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Dec 18 00:33:32 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
include  for siginfo32_t.


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

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



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.


CVS commit: src/sys/compat/common

2017-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec 16 09:10:30 UTC 2017

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

Log Message:
Build these functions regardless of whether COMPAT_50 or COMPAT_70 are
enabled. They must be there, because they are needed in rtsock.c even
when no compat option is enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.1 -r1.2 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

2017-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Dec 16 09:10:30 UTC 2017

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

Log Message:
Build these functions regardless of whether COMPAT_50 or COMPAT_70 are
enabled. They must be there, because they are needed in rtsock.c even
when no compat option is enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.1 -r1.2 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.5 src/sys/compat/common/rtsock_50.c:1.6
--- src/sys/compat/common/rtsock_50.c:1.5	Sat Dec 16 07:59:14 2017
+++ src/sys/compat/common/rtsock_50.c	Sat Dec 16 09:10:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.5 2017/12/16 07:59:14 mrg Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.6 2017/12/16 09:10:30 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,13 +61,20 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.5 2017/12/16 07:59:14 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.6 2017/12/16 09:10:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
 #endif
 
-#if defined(COMPAT_50)
+/*
+ * COMPAT_50 and COMPAT_RTSOCK must be defined for rtsock.c regardless of
+ * the currently enabled options.
+ */
+#ifndef COMPAT_50
+#define COMPAT_50
+#endif
+
 #define	COMPAT_RTSOCK
 
 #include 
@@ -147,5 +154,3 @@ compat_50_iflist(struct ifnet *ifp, stru
 	w->w_where = (char *)w->w_where + len;
 	return 0;
 }
-
-#endif /* COMPAT_50 */

Index: src/sys/compat/common/rtsock_70.c
diff -u src/sys/compat/common/rtsock_70.c:1.1 src/sys/compat/common/rtsock_70.c:1.2
--- src/sys/compat/common/rtsock_70.c:1.1	Wed Sep 21 10:50:23 2016
+++ src/sys/compat/common/rtsock_70.c	Sat Dec 16 09:10:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_70.c,v 1.1 2016/09/21 10:50:23 roy Exp $	*/
+/*	$NetBSD: rtsock_70.c,v 1.2 2017/12/16 09:10:30 maxv Exp $	*/
 
 /*
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.1 2016/09/21 10:50:23 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,v 1.2 2017/12/16 09:10:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: rtsock_70.c,
 #include 
 #include 
 
-#if defined(COMPAT_70)
 void
 compat_70_rt_newaddrmsg1(int cmd, struct ifaddr *ifa)
 {
@@ -112,4 +111,3 @@ compat_70_iflist_addr(struct rt_walkarg 
 	}
 	return error;
 }
-#endif /* COMPAT_70 */



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

2017-12-16 Thread Maxime Villard
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.



CVS commit: src/sys/compat/common

2017-12-16 Thread Maxime Villard
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.

Modified files:

Index: src/sys/compat/common/Makefile.inc
diff -u src/sys/compat/common/Makefile.inc:1.22 src/sys/compat/common/Makefile.inc:1.23
--- src/sys/compat/common/Makefile.inc:1.22	Tue Mar 22 08:25:23 2016
+++ src/sys/compat/common/Makefile.inc	Sat Dec 16 08:31:36 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.22 2016/03/22 08:25:23 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.23 2017/12/16 08:31:36 maxv Exp $
 #
 #	Configuration variables (default values are below):
 #
@@ -17,7 +17,7 @@
 
 # Default values:
 COMPATDST?=		${.OBJDIR}/lib/compat
-COMPAT_AS?=		library
+COMPAT_AS?=		obj
 COMPATDOTDIR?= ../../.
 
 COMPATDIR=		${S:S@^.@${COMPATDOTDIR}@:Q}/compat/common



CVS commit: src/sys/compat/common

2017-12-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec 16 07:59:15 UTC 2017

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

Log Message:
remove check for netbsd 1.5 without 5.0.  it doesn't happen.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 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.4 src/sys/compat/common/rtsock_50.c:1.5
--- src/sys/compat/common/rtsock_50.c:1.4	Mon Aug 24 22:50:33 2015
+++ src/sys/compat/common/rtsock_50.c	Sat Dec 16 07:59:14 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock_50.c,v 1.4 2015/08/24 22:50:33 pooka Exp $	*/
+/*	$NetBSD: rtsock_50.c,v 1.5 2017/12/16 07:59:14 mrg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,16 +61,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.4 2015/08/24 22:50:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock_50.c,v 1.5 2017/12/16 07:59:14 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
 #endif
 
-#if defined(COMPAT_14) && !defined(COMPAT_50)
-#define	COMPAT_50	1	/* 1.4 needs 5.0 */
-#endif
-
 #if defined(COMPAT_50)
 #define	COMPAT_RTSOCK
 



CVS commit: src/sys/compat/common

2017-12-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec 16 07:59:15 UTC 2017

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

Log Message:
remove check for netbsd 1.5 without 5.0.  it doesn't happen.


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

2017-12-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 10 00:43:05 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Finally (hopefully) return completely to the state where compat_linux is
enabled by default.

While here make it possible to enable this if already enabled, or disable
if already disabled, without error.   Some minor KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux32/common/linux32_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/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.9 src/sys/compat/linux/common/linux_mod.c:1.10
--- src/sys/compat/linux/common/linux_mod.c:1.9	Fri Dec  8 15:31:13 2017
+++ src/sys/compat/linux/common/linux_mod.c	Sun Dec 10 00:43:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.9 2017/12/08 15:31:13 kre Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.10 2017/12/10 00:43:05 kre Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.9 2017/12/08 15:31:13 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.10 2017/12/10 00:43:05 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -136,13 +136,16 @@ linux_sysctl_enable(SYSCTLFN_ARGS)
 	if (error != 0 || newp == NULL)
 		return error;
 
-	if (val == 1) {
+	if (val == *(int *)rnode->sysctl_data)
+		return 0;
+
+	if (val == 1)
 		error = exec_add(linux_execsw, __arraycount(linux_execsw));
-	} else if (val == 0) {
+	else if (val == 0)
 		error = exec_remove(linux_execsw, __arraycount(linux_execsw));
-	} else {
+	else 
 		error = EINVAL;
-	}
+
 	if (error)
 		return error;
 
@@ -160,7 +163,10 @@ compat_linux_modcmd(modcmd_t cmd, void *
 	case MODULE_CMD_INIT:
 		linux_futex_init();
 		linux_sysctl_init();
-		return 0;
+		error = exec_add(linux_execsw, __arraycount(linux_execsw));
+		if (error != 0) 	 
+			linux_sysctl_fini();
+		return error;
 
 	case MODULE_CMD_FINI:
 		error = exec_remove(linux_execsw, __arraycount(linux_execsw));

Index: src/sys/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.10 src/sys/compat/linux32/common/linux32_mod.c:1.11
--- src/sys/compat/linux32/common/linux32_mod.c:1.10	Fri Dec  8 15:31:13 2017
+++ src/sys/compat/linux32/common/linux32_mod.c	Sun Dec 10 00:43:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_mod.c,v 1.10 2017/12/08 15:31:13 kre Exp $	*/
+/*	$NetBSD: linux32_mod.c,v 1.11 2017/12/10 00:43:05 kre Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.10 2017/12/08 15:31:13 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.11 2017/12/10 00:43:05 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -95,13 +95,17 @@ linux32_sysctl_enable(SYSCTLFN_ARGS)
 	if (error != 0 || newp == NULL)
 		return error;
 
-	if (val == 1) {
+	if (val == *(int *)rnode->sysctl_data)
+		return 0;
+
+	if (val == 1)
 		error = exec_add(linux32_execsw, __arraycount(linux32_execsw));
-	} else if (val == 0) {
-		error = exec_remove(linux32_execsw, __arraycount(linux32_execsw));
-	} else {
+	else if (val == 0)
+		error =
+		exec_remove(linux32_execsw, __arraycount(linux32_execsw));
+	else
 		error = EINVAL;
-	}
+
 	if (error)
 		return error;
 
@@ -118,10 +122,14 @@ compat_linux32_modcmd(modcmd_t cmd, void
 	switch (cmd) {
 	case MODULE_CMD_INIT:
 		linux32_sysctl_init();
-		return 0;
+		error = exec_add(linux32_execsw, __arraycount(linux32_execsw));
+		if (error != 0) 	 
+			linux32_sysctl_fini(); 	 
+		return error;
 
 	case MODULE_CMD_FINI:
-		error = exec_remove(linux32_execsw, __arraycount(linux32_execsw));
+		error =
+		exec_remove(linux32_execsw, __arraycount(linux32_execsw));
 		if (error)
 			return error;
 		linux32_sysctl_fini();



CVS commit: src/sys/compat

2017-12-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Dec 10 00:43:05 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Finally (hopefully) return completely to the state where compat_linux is
enabled by default.

While here make it possible to enable this if already enabled, or disable
if already disabled, without error.   Some minor KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.10 -r1.11 src/sys/compat/linux32/common/linux32_mod.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

2017-12-08 Thread Maxime Villard

Le 08/12/2017 à 20:54, Robert Elz a écrit :

 Date:Fri, 8 Dec 2017 16:54:24 +0100
 From:Maxime Villard 
 Message-ID:  <96c690fd-8577-0e4d-dcbb-84c51aed0...@m00nbsd.net>

   | No, it wasn't barbaric, it made perfect sense:

It was, and made no sense.


Perhaps "it used to make perfect sense" would have been more appropriate. I
meant to say that in the case of a compat_linux disabled by default, it did
make perfect sense, and wasn't barbaric in any way in its initial form.

Now that this initial form has been partly reverted, it does indeed become
nonsensical. Only there, there is no point in having such a sysctl anymore,
and the correct solution is to drop it entirely.

Maxime


Re: CVS commit: src/sys/compat

2017-12-08 Thread Robert Elz
Date:Fri, 8 Dec 2017 16:54:24 +0100
From:Maxime Villard 
Message-ID:  <96c690fd-8577-0e4d-dcbb-84c51aed0...@m00nbsd.net>

  | No, it wasn't barbaric, it made perfect sense:

It was, and made no sense.

  | when modloaded the linux execsw is not registered,

I don't know enough about the module structures and what the module
init code does to answer that, but I do believe that other modules
can be loaded (incl autoloaded) and do not need some extra sysctl enable
routine to make them operable - hence that should not be necessary
here either.

If something more is needed than is there now (for the case of the built-in
module, or for later loaded modules) someone who understands can fix it
all I'm sure.   But forcing the module to be disabled as part of its init
routine will not be a part of that.

kre



Re: CVS commit: src/sys/compat

2017-12-08 Thread Maxime Villard

Le 08/12/2017 à 16:31, Robert Elz a écrit :

Module Name:src
Committed By:   kre
Date:   Fri Dec  8 15:31:13 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Finish the previous change - as well as setting the default for these
compat modules back to enabled, stop forcing it to switch back to
disabled any time the module is init'd (which is truly barbaric behaviour.)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_mod.c

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


No, it wasn't barbaric, it made perfect sense: when modloaded the linux
execsw is not registered, and therefore resetting linux_enabled to zero
forced the user to go through linux_sysctl_enable(), which would register
the execsw normally.

By the way, it looks like Joerg's partial revert does not work, because
if compat_linux is enabled by default then we want exec_add() to be called
by default in MODULE_CMD_INIT. (Haven't tested though.)

Maxime


CVS commit: src/sys/compat

2017-12-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Dec  8 15:31:13 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Finish the previous change - as well as setting the default for these
compat modules back to enabled, stop forcing it to switch back to
disabled any time the module is init'd (which is truly barbaric behaviour.)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_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

2017-12-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Dec  8 15:31:13 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Finish the previous change - as well as setting the default for these
compat modules back to enabled, stop forcing it to switch back to
disabled any time the module is init'd (which is truly barbaric behaviour.)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.9 -r1.10 src/sys/compat/linux32/common/linux32_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/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.8 src/sys/compat/linux/common/linux_mod.c:1.9
--- src/sys/compat/linux/common/linux_mod.c:1.8	Fri Dec  1 22:14:52 2017
+++ src/sys/compat/linux/common/linux_mod.c	Fri Dec  8 15:31:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.9 2017/12/08 15:31:13 kre Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.9 2017/12/08 15:31:13 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -158,7 +158,6 @@ compat_linux_modcmd(modcmd_t cmd, void *
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-		linux_enabled = 0;
 		linux_futex_init();
 		linux_sysctl_init();
 		return 0;

Index: src/sys/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.9 src/sys/compat/linux32/common/linux32_mod.c:1.10
--- src/sys/compat/linux32/common/linux32_mod.c:1.9	Fri Dec  1 22:14:52 2017
+++ src/sys/compat/linux32/common/linux32_mod.c	Fri Dec  8 15:31:13 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $	*/
+/*	$NetBSD: linux32_mod.c,v 1.10 2017/12/08 15:31:13 kre Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.10 2017/12/08 15:31:13 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -117,7 +117,6 @@ compat_linux32_modcmd(modcmd_t cmd, void
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
-		linux32_enabled = 0;
 		linux32_sysctl_init();
 		return 0;
 



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

2017-12-06 Thread Christos Zoulas
On Dec 7,  7:34am, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/sys/compat/netbsd32

| can they make 32 bit trace records instead?  if not, why not?

Because every other syscall is making 64 bit records, so ktrace.out
file is only parseable/readable by the 64 bit ktrace. Putting a 32
bit signal record inside a 64 bit record file does not make any sense
(try it).

When/if we fix 32 bit processes to emit 32 bit records then we can
switch back.

christos


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

2017-12-06 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Dec  6 19:15:27 UTC 2017
> 
> Modified Files:
>   src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_signal.c
> 
> Log Message:
> disable 32 bit signal ktrace records; 32 bit traced process produce 64 bit
> trace records, the only record that we can't parse is that one :-)
> XXX: pullup-8

can they make 32 bit trace records instead?  if not, why not?

thanks.


.mrg.


CVS commit: src/sys/compat/netbsd32

2017-12-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  6 19:15:27 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_signal.c

Log Message:
disable 32 bit signal ktrace records; 32 bit traced process produce 64 bit
trace records, the only record that we can't parse is that one :-)
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_signal.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.207 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.208
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.207	Mon Jul 31 11:38:01 2017
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Wed Dec  6 14:15:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.207 2017/07/31 15:38:01 maxv Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.208 2017/12/06 19:15:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.207 2017/07/31 15:38:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.208 2017/12/06 19:15:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -159,7 +159,11 @@ struct emul emul_netbsd32 = {
 	.e_usertrap =		NULL,
 	.e_ucsize =		sizeof(ucontext32_t),
 	.e_startlwp =		startlwp32,
-	.e_ktrpsig =		netbsd32_ktrpsig
+#ifdef notyet
+	.e_ktrpsig =		netbsd32_ktrpsig,
+#else
+	.e_ktrpsig =		NULL,
+#endif
 };
 
 /*

Index: src/sys/compat/netbsd32/netbsd32_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.43 src/sys/compat/netbsd32/netbsd32_signal.c:1.44
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.43	Sun Sep 18 01:16:21 2016
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Wed Dec  6 14:15:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.43 2016/09/18 05:16:21 christos Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.44 2017/12/06 19:15:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.43 2016/09/18 05:16:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.44 2017/12/06 19:15:27 christos Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -226,6 +226,7 @@ netbsd32_ksi32_to_ksi(struct _ksiginfo *
 	}
 }
 
+#ifdef notyet
 #ifdef KTRACE
 static void
 netbsd32_ksi_to_ksi32(struct __ksiginfo32 *si32, const struct _ksiginfo *si)
@@ -268,6 +269,7 @@ netbsd32_ksi_to_ksi32(struct __ksiginfo3
 	}
 }
 #endif
+#endif
 
 void
 netbsd32_si_to_si32(siginfo32_t *si32, const siginfo_t *si)
@@ -513,6 +515,7 @@ struct netbsd32_ktr_psig {
 	/* and optional siginfo_t */
 };
 
+#ifdef notyet
 #ifdef KTRACE
 void
 netbsd32_ktrpsig(int sig, sig_t action, const sigset_t *mask,
@@ -548,5 +551,4 @@ netbsd32_ktrpsig(int sig, sig_t action, 
 	ktraddentry(l, kte, KTA_WAITOK);
 }
 #endif
-
-
+#endif



CVS commit: src/sys/compat/netbsd32

2017-12-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  6 19:15:27 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_signal.c

Log Message:
disable 32 bit signal ktrace records; 32 bit traced process produce 64 bit
trace records, the only record that we can't parse is that one :-)
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_signal.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/netbsd32

2017-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  6 04:12:25 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_60.c

Log Message:
don't forget to convert the timespec.
XXX: pullup-8


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

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_compat_60.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_60.c:1.2 src/sys/compat/netbsd32/netbsd32_compat_60.c:1.3
--- src/sys/compat/netbsd32/netbsd32_compat_60.c:1.2	Thu Aug 21 02:40:35 2014
+++ src/sys/compat/netbsd32/netbsd32_compat_60.c	Tue Dec  5 23:12:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_60.c,v 1.2 2014/08/21 06:40:35 maxv Exp $	*/
+/*	$NetBSD: netbsd32_compat_60.c,v 1.3 2017/12/06 04:12:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_60.c,v 1.2 2014/08/21 06:40:35 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_60.c,v 1.3 2017/12/06 04:12:25 christos Exp $");
 
 #include 
 #include 
@@ -71,6 +71,7 @@ compat_60_netbsd32__lwp_park(struct lwp 
 		error = copyin(SCARG_P32(uap, ts), , sizeof ts32);
 		if (error != 0)
 			return error;
+		netbsd32_to_timespec(, );
 		tsp = 
 	}
 



CVS commit: src/sys/compat/netbsd32

2017-12-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec  6 04:12:25 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_60.c

Log Message:
don't forget to convert the timespec.
XXX: pullup-8


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

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



CVS commit: src/sys/compat/common

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 15:23:30 UTC 2017

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

Log Message:
Make code look the same, in particular zero out the rest of the directory
record.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.61 -r1.62 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_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.34 src/sys/compat/common/vfs_syscalls_12.c:1.35
--- src/sys/compat/common/vfs_syscalls_12.c:1.34	Fri Jul 28 11:34:06 2017
+++ src/sys/compat/common/vfs_syscalls_12.c	Sun Dec  3 10:23:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.34 2017/07/28 15:34:06 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.35 2017/12/03 15:23:30 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.34 2017/07/28 15:34:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.35 2017/12/03 15:23:30 christos Exp $");
 
 #include 
 #include 
@@ -183,6 +183,10 @@ again:
 off += reclen;
 			continue;
 		}
+		if (bdp->d_namlen >= sizeof(idb.d_name))
+			idb.d_namlen = sizeof(idb.d_name) - 1;
+		else
+			idb.d_namlen = bdp->d_namlen;
 		old_reclen = _DIRENT_RECLEN(, bdp->d_namlen);
 		if (reclen > len || resid < old_reclen) {
 			/* entry too big for buffer, so just stop */
@@ -197,9 +201,9 @@ again:
 		idb.d_fileno = (uint32_t)bdp->d_fileno;
 		idb.d_reclen = (uint16_t)old_reclen;
 		idb.d_type = (uint8_t)bdp->d_type;
-		idb.d_namlen = (uint8_t)bdp->d_namlen;
-		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		bdp->d_namlen));
+		(void)memcpy(idb.d_name, bdp->d_name, idb.d_namlen);
+		memset(idb.d_name + idb.d_namlen, 0,
+		idb.d_reclen - _DIRENT_NAMEOFF() - idb.d_namlen);
 		if ((error = copyout(, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.61 src/sys/compat/common/vfs_syscalls_43.c:1.62
--- src/sys/compat/common/vfs_syscalls_43.c:1.61	Sat Jul 29 00:02:49 2017
+++ src/sys/compat/common/vfs_syscalls_43.c	Sun Dec  3 10:23:30 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.61 2017/07/29 04:02:49 riastradh Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.62 2017/12/03 15:23:30 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.61 2017/07/29 04:02:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.62 2017/12/03 15:23:30 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -463,6 +463,10 @@ again:
 off += reclen;
 			continue;
 		}
+		if (bdp->d_namlen >= sizeof(idb.d_name))
+			idb.d_namlen = sizeof(idb.d_name) - 1;
+		else
+			idb.d_namlen = bdp->d_namlen;
 		old_reclen = _DIRENT_RECLEN(, bdp->d_namlen);
 		if (reclen > len || resid < old_reclen) {
 			/* entry too big for buffer, so just stop */
@@ -476,9 +480,10 @@ again:
 		 */
 		idb.d_fileno = (uint32_t)bdp->d_fileno;
 		idb.d_reclen = (uint16_t)old_reclen;
-		idb.d_namlen = (uint16_t)bdp->d_namlen;
-		memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name),
-		idb.d_namlen));
+		idb.d_fileno = (uint32_t)bdp->d_fileno;
+		(void)memcpy(idb.d_name, bdp->d_name, idb.d_namlen);
+		memset(idb.d_name + idb.d_namlen, 0,
+		idb.d_reclen - _DIRENT_NAMEOFF() - idb.d_namlen);
 		if ((error = copyout(, outp, old_reclen)))
 			goto out;
 		/* advance past this real entry */



CVS commit: src/sys/compat/common

2017-12-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec  3 15:23:30 UTC 2017

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

Log Message:
Make code look the same, in particular zero out the rest of the directory
record.
XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.61 -r1.62 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/ultrix

2017-12-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Dec  3 12:53:52 UTC 2017

Modified Files:
src/sys/compat/ultrix: ultrix_fs.c

Log Message:
Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/ultrix/ultrix_fs.c

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

Modified files:

Index: src/sys/compat/ultrix/ultrix_fs.c
diff -u src/sys/compat/ultrix/ultrix_fs.c:1.57 src/sys/compat/ultrix/ultrix_fs.c:1.58
--- src/sys/compat/ultrix/ultrix_fs.c:1.57	Thu Apr 13 09:18:18 2017
+++ src/sys/compat/ultrix/ultrix_fs.c	Sun Dec  3 12:53:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ultrix_fs.c,v 1.57 2017/04/13 09:18:18 hannken Exp $	*/
+/*	$NetBSD: ultrix_fs.c,v 1.58 2017/12/03 12:53:52 maxv Exp $	*/
 
 /*
  * Copyright (c) 1995, 1997 Jonathan Stone
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.57 2017/04/13 09:18:18 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ultrix_fs.c,v 1.58 2017/12/03 12:53:52 maxv Exp $");
 
 #include 
 #include 
@@ -276,7 +276,7 @@ ultrix_sys_getmnt(struct lwp *l, const s
 make_ultrix_mntent(sp, );
 if ((error = copyout((void *), sfsp,
 sizeof(tem))) != 0) {
-	goto bad;
+	goto bad_freeiter;
 }
 sfsp++;
 count++;
@@ -289,8 +289,9 @@ ultrix_sys_getmnt(struct lwp *l, const s
 	else
 		*retval = count;
 
-bad:
+bad_freeiter:
 	mountlist_iterator_destroy(iter);
+bad:
 	if (path)
 		free(path, M_TEMP);
 	return error;



CVS commit: src/sys/compat/ultrix

2017-12-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Dec  3 12:53:52 UTC 2017

Modified Files:
src/sys/compat/ultrix: ultrix_fs.c

Log Message:
Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/ultrix/ultrix_fs.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

2017-12-02 Thread Christos Zoulas
In article <19b5c128-7725-0638-67f8-749532353...@m00nbsd.net>,
Maxime Villard   wrote:
>
>So is making the system vulnerable by default with marginal features. The
>system is broken now. All you had to do is one sysctl; but that takes too much
>time, and you're probably too busy handling serious business like debating
>about your favorite hitler quotes.

The problem is that nothing is black and white:
1. You probably don't use the feature most of the time, others might.
   [this determines how marginal the feature is]
2. How critical are the bugs, how easy it is to find them all? For
   example, are there similar bugs in other places in the system;
   do we disable those parts? [security vs usability]

Here you unilateraly made a decision to disable a feature that was
previously enabled. Regardless if the decision was correct or
incorrect, you made a determination based on your assessment and
affected not only yourself, but everyone else using the system.
Such decisions should be made by consensus not by force. It is a
different story if there was a critical bug that could not be fixed,
so the feature had to be disabled for safety. Here we are talking
about a feature that was enabled for a long time, and was disabled
without enough prior discussion.

I understand we perhaps are not moving fast enough or making
decisions fast enough, but process needs to be followed otherwise
everyone is unhappy with the results.

christos



Re: CVS commit: src/sys/compat

2017-12-02 Thread Maxime Villard

Le 02/12/2017 à 02:27, Joerg Sonnenberger a écrit :

On Fri, Dec 01, 2017 at 11:32:08PM +0100, Maxime Villard wrote:

Le 01/12/2017 à 23:14, Joerg Sonnenberger a écrit :

Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_mod.c

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


tell us what is "broken", exactly


Every Linux binary failing by default is the very definition of broken.


So is making the system vulnerable by default with marginal features. The
system is broken now. All you had to do is one sysctl; but that takes too much
time, and you're probably too busy handling serious business like debating
about your favorite hitler quotes.

Bye,
Maxime


Re: CVS commit: src/sys/compat

2017-12-01 Thread Robert Elz
Date:Sat, 2 Dec 2017 02:27:33 +0100
From:Joerg Sonnenberger 
Message-ID:  <20171202012733.ga17...@britannica.bec.de>

  | > tell us what is "broken", exactly
  | 
  | Every Linux binary failing by default is the very definition of broken.

I agree - I was planning on making the same change, just had not
gotten around to it yet.

kre



Re: CVS commit: src/sys/compat

2017-12-01 Thread Joerg Sonnenberger
On Fri, Dec 01, 2017 at 11:32:08PM +0100, Maxime Villard wrote:
> Le 01/12/2017 à 23:14, Joerg Sonnenberger a écrit :
> > Module Name:src
> > Committed By:   joerg
> > Date:   Fri Dec  1 22:14:52 UTC 2017
> > 
> > Modified Files:
> > src/sys/compat/linux/common: linux_mod.c
> > src/sys/compat/linux32/common: linux32_mod.c
> > 
> > Log Message:
> > Unbreak Linux emulation by default. While not loading it automatically
> > is somewhat sensible, breaking functionality of GENERIC is not and has
> > been objected to on a regular base.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
> > cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_mod.c
> > 
> > Please note that diffs are not public domain; they are subject to the
> > copyright notices on the relevant files.
> 
> tell us what is "broken", exactly

Every Linux binary failing by default is the very definition of broken.

Joerg


Re: CVS commit: src/sys/compat

2017-12-01 Thread Maxime Villard

Le 01/12/2017 à 23:14, Joerg Sonnenberger a écrit :

Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_mod.c

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


tell us what is "broken", exactly


CVS commit: src/sys/compat

2017-12-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_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/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.7 src/sys/compat/linux/common/linux_mod.c:1.8
--- src/sys/compat/linux/common/linux_mod.c:1.7	Fri Sep 29 17:08:00 2017
+++ src/sys/compat/linux/common/linux_mod.c	Fri Dec  1 22:14:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.7 2017/09/29 17:08:00 maxv Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.7 2017/09/29 17:08:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -119,7 +119,7 @@ static struct execsw linux_execsw[] = {
 #endif
 };
 
-int linux_enabled = 0;
+int linux_enabled = 1;
 
 int
 linux_sysctl_enable(SYSCTLFN_ARGS)

Index: src/sys/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.8 src/sys/compat/linux32/common/linux32_mod.c:1.9
--- src/sys/compat/linux32/common/linux32_mod.c:1.8	Fri Sep 29 17:47:29 2017
+++ src/sys/compat/linux32/common/linux32_mod.c	Fri Dec  1 22:14:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_mod.c,v 1.8 2017/09/29 17:47:29 maxv Exp $	*/
+/*	$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.8 2017/09/29 17:47:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -78,7 +78,7 @@ static struct execsw linux32_execsw[] = 
 #endif
 };
 
-int linux32_enabled = 0;
+int linux32_enabled = 1;
 
 int
 linux32_sysctl_enable(SYSCTLFN_ARGS)



CVS commit: src/sys/compat

2017-12-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_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/netbsd32

2017-11-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 26 17:46:13 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.


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

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

Modified files:

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

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



CVS commit: src/sys/compat/netbsd32

2017-11-26 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Nov 26 17:46:13 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.


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

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



CVS commit: src/sys/compat/common

2017-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 22 15:25:34 UTC 2017

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

Log Message:
#idef the label next_ifa: just like the only goto using it.


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

2017-11-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 22 15:25:34 UTC 2017

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

Log Message:
#idef the label next_ifa: just like the only goto using it.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 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.14 src/sys/compat/common/uipc_syscalls_40.c:1.15
--- src/sys/compat/common/uipc_syscalls_40.c:1.14	Wed Nov 22 10:19:14 2017
+++ src/sys/compat/common/uipc_syscalls_40.c	Wed Nov 22 15:25:34 2017
@@ -1,9 +1,9 @@
-/*	$NetBSD: uipc_syscalls_40.c,v 1.14 2017/11/22 10:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: uipc_syscalls_40.c,v 1.15 2017/11/22 15:25:34 martin Exp $	*/
 
 /* written by Pavel Cahyna, 2006. Public domain. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.14 2017/11/22 10:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.15 2017/11/22 15:25:34 martin Exp $");
 
 /*
  * System call interface to the socket abstraction.
@@ -124,7 +124,9 @@ compat_ifconf(u_long cmd, void *data)
 			}
 			space -= sz;
 
+#ifdef COMPAT_OSOCK
 		next_ifa:
+#endif
 			s = pserialize_read_enter();
 			ifa_release(ifa, _ifa);
 		}



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

2017-11-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Nov 21 10:45:12 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_sg.c

Log Message:
This should be "linux_sg_version", not "version".


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/common/linux_sg.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/linux/common/linux_sg.c
diff -u src/sys/compat/linux/common/linux_sg.c:1.13 src/sys/compat/linux/common/linux_sg.c:1.14
--- src/sys/compat/linux/common/linux_sg.c:1.13	Fri Mar 21 21:54:58 2008
+++ src/sys/compat/linux/common/linux_sg.c	Tue Nov 21 10:45:12 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sg.c,v 1.13 2008/03/21 21:54:58 ad Exp $ */
+/* $NetBSD: linux_sg.c,v 1.14 2017/11/21 10:45:12 maxv Exp $ */
 
 /*
  * Copyright (c) 2004 Soren S. Jorvang.  All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.13 2008/03/21 21:54:58 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sg.c,v 1.14 2017/11/21 10:45:12 maxv Exp $");
 
 #include 
 #include 
@@ -88,7 +88,7 @@ linux_ioctl_sg(struct lwp *l, const stru
 	DPRINTF(("Command = %lx\n", com));
 	switch (com) {
 	case LINUX_SG_GET_VERSION_NUM: {
-		error = copyout(, SCARG(uap, data),
+		error = copyout(_sg_version, SCARG(uap, data),
 		sizeof(linux_sg_version));
 		break;
 	}



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

2017-11-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Nov 21 10:45:12 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_sg.c

Log Message:
This should be "linux_sg_version", not "version".


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/compat/linux/common/linux_sg.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/netbsd32

2017-10-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 31 16:10:25 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysctl.c

Log Message:
unconst machine_arch32 for sysctl data .. pointed out by Riccardo Mottola


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

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_sysctl.c
diff -u src/sys/compat/netbsd32/netbsd32_sysctl.c:1.37 src/sys/compat/netbsd32/netbsd32_sysctl.c:1.38
--- src/sys/compat/netbsd32/netbsd32_sysctl.c:1.37	Tue Oct 31 12:37:23 2017
+++ src/sys/compat/netbsd32/netbsd32_sysctl.c	Tue Oct 31 16:10:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_sysctl.c,v 1.37 2017/10/31 12:37:23 martin Exp $	*/
+/*	$NetBSD: netbsd32_sysctl.c,v 1.38 2017/10/31 16:10:25 kre Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.37 2017/10/31 12:37:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.38 2017/10/31 16:10:25 kre Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -110,7 +110,7 @@ sysctl_hw_machine_arch32(SYSCTLFN_ARGS)
 	struct sysctlnode node = *rnode;
 #ifndef PROC_MACHINE_ARCH32
 	extern const char machine_arch32[];
-#define PROC_MACHINE_ARCH32(P)	machine_arch32
+#define PROC_MACHINE_ARCH32(P)	__UNCONST(machine_arch32)
 #endif
 
 	node.sysctl_data = PROC_MACHINE_ARCH32(l->l_proc);



CVS commit: src/sys/compat/netbsd32

2017-10-31 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Oct 31 16:10:25 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysctl.c

Log Message:
unconst machine_arch32 for sysctl data .. pointed out by Riccardo Mottola


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

2017-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 31 12:43:57 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_conv.h

Log Message:
PR kern/52681: fix msghdr conversion.


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

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.32 src/sys/compat/netbsd32/netbsd32_conv.h:1.33
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.32	Mon Jul 31 15:38:01 2017
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Tue Oct 31 12:43:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.32 2017/07/31 15:38:01 maxv Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.33 2017/10/31 12:43:56 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -280,10 +280,10 @@ static __inline void
 netbsd32_from_msghdr(struct netbsd32_msghdr *mhp32, const struct msghdr *mhp)
 {
 
-	mhp32->msg_name = mhp32->msg_name;
-	mhp32->msg_namelen = mhp32->msg_namelen;
-	mhp32->msg_iovlen = mhp32->msg_iovlen;
-	mhp32->msg_control = mhp32->msg_control;
+	NETBSD32PTR32(mhp32->msg_name, mhp->msg_name);
+	mhp32->msg_namelen = mhp->msg_namelen;
+	mhp32->msg_iovlen = mhp->msg_iovlen;
+	NETBSD32PTR32(mhp32->msg_control, mhp->msg_control);
 	mhp32->msg_controllen = mhp->msg_controllen;
 	mhp32->msg_flags = mhp->msg_flags;
 }



CVS commit: src/sys/compat/netbsd32

2017-10-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Oct 31 12:43:57 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_conv.h

Log Message:
PR kern/52681: fix msghdr conversion.


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

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



CVS commit: src/sys/compat

2017-10-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct 21 07:24:26 UTC 2017

Modified Files:
src/sys/compat/linux/arch/amd64: linux_machdep.c
src/sys/compat/linux32/arch/amd64: linux32_machdep.c

Log Message:
Include opt_user_ldt.h when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/linux/arch/amd64/linux_machdep.c
cvs rdiff -u -r1.42 -r1.43 \
src/sys/compat/linux32/arch/amd64/linux32_machdep.c

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

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_machdep.c
diff -u src/sys/compat/linux/arch/amd64/linux_machdep.c:1.54 src/sys/compat/linux/arch/amd64/linux_machdep.c:1.55
--- src/sys/compat/linux/arch/amd64/linux_machdep.c:1.54	Thu Oct 19 10:01:09 2017
+++ src/sys/compat/linux/arch/amd64/linux_machdep.c	Sat Oct 21 07:24:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.c,v 1.54 2017/10/19 10:01:09 maxv Exp $ */
+/*	$NetBSD: linux_machdep.c,v 1.55 2017/10/21 07:24:26 maxv Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.54 2017/10/19 10:01:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.55 2017/10/21 07:24:26 maxv Exp $");
 
 #include 
 #include 
@@ -57,8 +57,10 @@ __KERNEL_RCSID(0, "$NetBSD: linux_machde
  * To see whether wscons is configured (for virtual console ioctl calls).
  */
 #if defined(_KERNEL_OPT)
+#include "opt_user_ldt.h"
 #include "wsdisplay.h"
 #endif
+
 #if (NWSDISPLAY > 0)
 #include 
 #include 

Index: src/sys/compat/linux32/arch/amd64/linux32_machdep.c
diff -u src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.42 src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.43
--- src/sys/compat/linux32/arch/amd64/linux32_machdep.c:1.42	Thu Oct 19 10:01:09 2017
+++ src/sys/compat/linux32/arch/amd64/linux32_machdep.c	Sat Oct 21 07:24:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_machdep.c,v 1.42 2017/10/19 10:01:09 maxv Exp $ */
+/*	$NetBSD: linux32_machdep.c,v 1.43 2017/10/21 07:24:26 maxv Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -31,7 +31,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.42 2017/10/19 10:01:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_machdep.c,v 1.43 2017/10/21 07:24:26 maxv Exp $");
+
+#if defined(_KERNEL_OPT)
+#include "opt_user_ldt.h"
+#endif
 
 #include 
 #include 



CVS commit: src/sys/compat

2017-10-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Oct 21 07:24:26 UTC 2017

Modified Files:
src/sys/compat/linux/arch/amd64: linux_machdep.c
src/sys/compat/linux32/arch/amd64: linux32_machdep.c

Log Message:
Include opt_user_ldt.h when needed.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/compat/linux/arch/amd64/linux_machdep.c
cvs rdiff -u -r1.42 -r1.43 \
src/sys/compat/linux32/arch/amd64/linux32_machdep.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/svr4

2017-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 16 09:05:29 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Make debug code compile


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/svr4/svr4_stream.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/svr4

2017-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 16 09:05:29 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Make debug code compile


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/compat/svr4/svr4_stream.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/svr4/svr4_stream.c
diff -u src/sys/compat/svr4/svr4_stream.c:1.91 src/sys/compat/svr4/svr4_stream.c:1.92
--- src/sys/compat/svr4/svr4_stream.c:1.91	Fri Jul 28 17:52:47 2017
+++ src/sys/compat/svr4/svr4_stream.c	Sat Sep 16 09:05:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stream.c,v 1.91 2017/07/28 17:52:47 riastradh Exp $	 */
+/*	$NetBSD: svr4_stream.c,v 1.92 2017/09/16 09:05:29 martin Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.91 2017/07/28 17:52:47 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.92 2017/09/16 09:05:29 martin Exp $");
 
 #include 
 #include 
@@ -201,9 +201,10 @@ show_ioc(const char *str, struct svr4_st
 
 	ptr = (u_char *) malloc(len, M_TEMP, M_WAITOK);
 	uprintf("%s cmd = %ld, timeout = %d, len = %d, buf = %p { ",
-	str, ioc->cmd, ioc->timeout, ioc->len, ioc->buf);
+	str, (long)ioc->cmd, ioc->timeout, ioc->len,
+	NETBSD32PTR(ioc->buf));
 
-	if ((error = copyin(ioc->buf, ptr, len)) != 0) {
+	if ((error = copyin(NETBSD32PTR(ioc->buf), ptr, len)) != 0) {
 		free((char *) ptr, M_TEMP);
 		return error;
 	}
@@ -237,13 +238,14 @@ show_strbuf(struct svr4_strbuf *str)
 	if (len > 0) {
 	ptr = (u_char *) malloc(len, M_TEMP, M_WAITOK);
 
-	if ((error = copyin(str->buf, ptr, len)) != 0) {
+	if ((error = copyin(NETBSD32PTR(str->buf), ptr, len)) != 0) {
 		free((char *) ptr, M_TEMP);
 		return error;
 	}
 	}
 
-	uprintf(", { %d, %d, %p=[ ", str->maxlen, str->len, str->buf);
+	uprintf(", { %d, %d, %p=[ ", str->maxlen, str->len,
+	NETBSD32PTR(str->buf));
 
 	if (ptr)
 		bufprint(ptr, len);
@@ -353,7 +355,7 @@ sockaddr_to_netaddr_in(struct svr4_strmc
 	na->port = sain->sin_port;
 	na->addr = sain->sin_addr.s_addr;
 	DPRINTF(("sockaddr_in -> netaddr %d %d %lx\n", na->family, na->port,
-		 na->addr));
+		 (unsigned long)na->addr));
 }
 
 
@@ -540,7 +542,7 @@ si_listen(file_t *fp, int fd, struct svr
 		return EINVAL;
 
 	if (lst.cmd != SVR4_TI_OLD_BIND_REQUEST) {
-		DPRINTF(("si_listen: bad request %ld\n", lst.cmd));
+		DPRINTF(("si_listen: bad request %ld\n", (long)lst.cmd));
 		return EINVAL;
 	}
 
@@ -707,7 +709,8 @@ sockmod(file_t *fp, int fd, struct svr4_
 		return si_getudata(fp, fd, ioc, l);
 
 	default:
-		DPRINTF(("Unknown sockmod ioctl %lx\n", ioc->cmd));
+		DPRINTF(("Unknown sockmod ioctl %lx\n",
+		(unsigned long)ioc->cmd));
 		return 0;
 
 	}
@@ -779,7 +782,7 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		return error;
 
 	if (bnd.cmd != SVR4_TI_OLD_BIND_REQUEST) {
-		DPRINTF(("ti_bind: bad request %ld\n", bnd.cmd));
+		DPRINTF(("ti_bind: bad request %ld\n", (long)bnd.cmd));
 		return EINVAL;
 	}
 	if (bnd.offs < 0 ||
@@ -880,7 +883,7 @@ timod(file_t *fp, int fd, struct svr4_st
 		return 0;
 
 	default:
-		DPRINTF(("Unknown timod ioctl %lx\n", ioc->cmd));
+		DPRINTF(("Unknown timod ioctl %lx\n", (unsigned long)ioc->cmd));
 		return 0;
 	}
 }
@@ -1400,8 +1403,8 @@ svr4_sys_putmsg(struct lwp *l, const str
 
 
 #ifdef DEBUG_SVR4
-	show_msg(">putmsg", SCARG(uap, fd), SCARG(uap, ctl),
-		 SCARG(uap, dat), SCARG(uap, flags));
+	show_msg(">putmsg", SCARG(uap, fd), NETBSD32PTR(SCARG(uap, ctl)),
+		 NETBSD32PTR(SCARG(uap, dat)), SCARG(uap, flags));
 #endif /* DEBUG_SVR4 */
 
 	if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
@@ -1476,7 +1479,8 @@ svr4_sys_putmsg(struct lwp *l, const str
 goto out;
 			}
 #endif
-	DPRINTF(("putmsg: Invalid inet length %ld\n", sc.len));
+	DPRINTF(("putmsg: Invalid inet length %ld\n",
+			(long)sc.len));
 			error = EINVAL;
 			goto out;
 		}
@@ -1541,7 +1545,8 @@ svr4_sys_putmsg(struct lwp *l, const str
 		*retval = 0;
 		return error;
 	default:
-		DPRINTF(("putmsg: Unimplemented command %lx\n", sc.cmd));
+		DPRINTF(("putmsg: Unimplemented command %lx\n",
+		(unsigned long)sc.cmd));
 		error = ENOSYS;
 		goto out;
 	}
@@ -1571,8 +1576,8 @@ svr4_sys_getmsg(struct lwp *l, const str
 	memset(, 0, sizeof(sc));
 
 #ifdef DEBUG_SVR4
-	show_msg(">getmsg", SCARG(uap, fd), SCARG(uap, ctl),
-		 SCARG(uap, dat), 0);
+	show_msg(">getmsg", SCARG(uap, fd), NETBSD32PTR(SCARG(uap, ctl)),
+		 NETBSD32PTR(SCARG(uap, dat)), 0);
 #endif /* DEBUG_SVR4 */
 
 	if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
@@ -1869,8 +1874,8 @@ svr4_sys_getmsg(struct lwp *l, const str
 	*retval = 0;
 
 #ifdef DEBUG_SVR4
-	show_msg("

CVS commit: src/sys/compat/svr4_32

2017-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 16 09:04:50 UTC 2017

Modified Files:
src/sys/compat/svr4_32: svr4_32_ioctl.c svr4_32_misc.c svr4_32_signal.c

Log Message:
Make debug code compile


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/svr4_32/svr4_32_ioctl.c
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/svr4_32/svr4_32_misc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/svr4_32/svr4_32_signal.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/svr4_32/svr4_32_ioctl.c
diff -u src/sys/compat/svr4_32/svr4_32_ioctl.c:1.22 src/sys/compat/svr4_32/svr4_32_ioctl.c:1.23
--- src/sys/compat/svr4_32/svr4_32_ioctl.c:1.22	Sat Mar 14 21:04:19 2009
+++ src/sys/compat/svr4_32/svr4_32_ioctl.c	Sat Sep 16 09:04:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_ioctl.c,v 1.22 2009/03/14 21:04:19 dsl Exp $	 */
+/*	$NetBSD: svr4_32_ioctl.c,v 1.23 2017/09/16 09:04:50 martin Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.22 2009/03/14 21:04:19 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.23 2017/09/16 09:04:50 martin Exp $");
 
 #include 
 #include 
@@ -103,8 +103,8 @@ svr4_32_sys_ioctl(struct lwp *l, const s
 
 	svr4_32_decode_cmd(SCARG(uap, com), dir, , , );
 
-	uprintf("svr4_32_ioctl(%d, _IO%s(%c, %d, %d), %#x);\n", SCARG(uap, fd),
-	dir, c, num, argsiz, SCARG(uap, data));
+	uprintf("svr4_32_ioctl(%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, fd),
+	dir, c, num, argsiz, NETBSD32PTR64(SCARG(uap, data)));
 #endif
 	cmd = SCARG(uap, com);
 

Index: src/sys/compat/svr4_32/svr4_32_misc.c
diff -u src/sys/compat/svr4_32/svr4_32_misc.c:1.78 src/sys/compat/svr4_32/svr4_32_misc.c:1.79
--- src/sys/compat/svr4_32/svr4_32_misc.c:1.78	Fri Jul 28 15:34:07 2017
+++ src/sys/compat/svr4_32/svr4_32_misc.c	Sat Sep 16 09:04:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_misc.c,v 1.78 2017/07/28 15:34:07 riastradh Exp $	 */
+/*	$NetBSD: svr4_32_misc.c,v 1.79 2017/09/16 09:04:50 martin Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.78 2017/07/28 15:34:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_misc.c,v 1.79 2017/09/16 09:04:50 martin Exp $");
 
 #include 
 #include 
@@ -1012,7 +1012,8 @@ svr4_32_setinfo(int pid, struct rusage *
 	}
 
 	DPRINTF(("siginfo [pid %ld signo %d code %d errno %d status %d]\n",
-		 i.si_pid, i.si_signo, i.si_code, i.si_errno, i.si_status));
+		 (long)i.si_pid, i.si_signo, i.si_code, i.si_errno,
+		 i.si_status));
 
 	return copyout(, s, sizeof(i));
 }
@@ -1043,7 +1044,7 @@ svr4_32_sys_waitsys(struct lwp *l, const
 
 	DPRINTF(("waitsys(%d, %d, %p, %x)\n",
 	 SCARG(uap, grp), id,
-		 SCARG(uap, info), SCARG(uap, options)));
+		 NETBSD32PTR64(SCARG(uap, info)), SCARG(uap, options)));
 
 	/* Translate options */
 	options = 0;

Index: src/sys/compat/svr4_32/svr4_32_signal.c
diff -u src/sys/compat/svr4_32/svr4_32_signal.c:1.30 src/sys/compat/svr4_32/svr4_32_signal.c:1.31
--- src/sys/compat/svr4_32/svr4_32_signal.c:1.30	Sun Jul 30 12:31:46 2017
+++ src/sys/compat/svr4_32/svr4_32_signal.c	Sat Sep 16 09:04:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $	 */
+/*	$NetBSD: svr4_32_signal.c,v 1.31 2017/09/16 09:04:50 martin Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.31 2017/09/16 09:04:50 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_svr4.h"
@@ -651,12 +651,12 @@ svr4_32_sys_context(struct lwp *l, const
 
 	switch (SCARG(uap, func)) {
 	case SVR4_GETCONTEXT:
-		DPRINTF(("getcontext(%p)\n", SCARG(uap, uc)));
+		DPRINTF(("getcontext(%p)\n", NETBSD32PTR64(SCARG(uap, uc;
 		svr4_32_getcontext(l, , >l_sigmask);
 		return copyout(, SCARG_P32(uap, uc), sizeof(uc));
 
 	case SVR4_SETCONTEXT:
-		DPRINTF(("setcontext(%p)\n", SCARG(uap, uc)));
+		DPRINTF(("setcontext(%p)\n", NETBSD32PTR64(SCARG(uap, uc;
 		if (!SCARG_P32(uap, uc))
 			exit1(l, 0, 0);
 		else if ((error = copyin(SCARG_P32(uap, uc),
@@ -667,7 +667,7 @@ svr4_32_sys_context(struct lwp *l, const
 
 	default:
 		DPRINTF(("context(%d, %p)\n", SCARG(uap, func),
-		SCARG(uap, uc)));
+		NETBSD32PTR64(SCARG(uap, uc;
 		return ENOSYS;
 	}
 	return 0;



CVS commit: src/sys/compat/svr4_32

2017-09-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Sep 16 09:04:50 UTC 2017

Modified Files:
src/sys/compat/svr4_32: svr4_32_ioctl.c svr4_32_misc.c svr4_32_signal.c

Log Message:
Make debug code compile


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/svr4_32/svr4_32_ioctl.c
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/svr4_32/svr4_32_misc.c
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/svr4_32/svr4_32_signal.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/ibcs2

2017-08-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Aug  9 18:55:21 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_misc.c

Log Message:
Remove __i386__.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/ibcs2/ibcs2_misc.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/ibcs2/ibcs2_misc.c
diff -u src/sys/compat/ibcs2/ibcs2_misc.c:1.114 src/sys/compat/ibcs2/ibcs2_misc.c:1.115
--- src/sys/compat/ibcs2/ibcs2_misc.c:1.114	Fri Jul 28 15:34:06 2017
+++ src/sys/compat/ibcs2/ibcs2_misc.c	Wed Aug  9 18:55:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_misc.c,v 1.114 2017/07/28 15:34:06 riastradh Exp $	*/
+/*	$NetBSD: ibcs2_misc.c,v 1.115 2017/08/09 18:55:21 maxv Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -95,7 +95,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.114 2017/07/28 15:34:06 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c,v 1.115 2017/08/09 18:55:21 maxv Exp $");
 
 #include 
 #include 
@@ -135,10 +135,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibcs2_misc.c
 #include 
 #include 
 
-#if defined(__i386__)
-#include 
-#endif
-
 #include 
 #include 
 #include 
@@ -208,29 +204,16 @@ ibcs2_sys_ulimit(struct lwp *l, const st
 int
 ibcs2_sys_waitsys(struct lwp *l, const struct ibcs2_sys_waitsys_args *uap, register_t *retval)
 {
-#if defined(__i386__)
 	/* {
 		syscallarg(int) a1;
 		syscallarg(int) a2;
 		syscallarg(int) a3;
 	} */
-#endif
 	int error, options, status, pid;
 
-#if defined(__i386__)
-#define WAITPID_EFLAGS	0x8c4	/* OF, SF, ZF, PF */
-	if ((l->l_md.md_regs->tf_eflags & WAITPID_EFLAGS) == WAITPID_EFLAGS) {
-		/* waitpid */
-		pid = SCARG(uap, a1);
-		options = SCARG(uap, a3);
-	} else {
-#endif
-		/* wait */
-		pid = WAIT_ANY;
-		options = 0;
-#if defined(__i386__)
-	}
-#endif
+	/* wait */
+	pid = WAIT_ANY;
+	options = 0;
 
 	error = do_sys_wait(, , options, NULL);
 	retval[0] = pid;



CVS commit: src/sys/compat/ibcs2

2017-08-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Aug  9 18:55:21 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_misc.c

Log Message:
Remove __i386__.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/ibcs2/ibcs2_misc.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/svr4

2017-08-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Aug  9 18:52:00 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_exec.h svr4_stat.c

Log Message:
Remove __i386__.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/svr4/svr4_exec.h
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/svr4/svr4_stat.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/svr4/svr4_exec.h
diff -u src/sys/compat/svr4/svr4_exec.h:1.28 src/sys/compat/svr4/svr4_exec.h:1.29
--- src/sys/compat/svr4/svr4_exec.h:1.28	Thu Dec 10 14:13:53 2009
+++ src/sys/compat/svr4/svr4_exec.h	Wed Aug  9 18:52:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_exec.h,v 1.28 2009/12/10 14:13:53 matt Exp $	 */
+/*	$NetBSD: svr4_exec.h,v 1.29 2017/08/09 18:52:00 maxv Exp $	 */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,15 +37,6 @@
  * play with brk(2) a bit more.
  */
 
-#ifdef __i386__
-/*
- * I cannot load the interpreter after the data segment because brk(2)
- * breaks. I have to load it somewhere before. Programs start at
- * 0x0800 so I load the interpreter far before.
- */
-#define SVR4_INTERP_ADDR	0x0100
-#endif
-
 #ifdef __m68k__
 /*
  * Here programs load at 0x8000, so I load the interpreter far before.

Index: src/sys/compat/svr4/svr4_stat.c
diff -u src/sys/compat/svr4/svr4_stat.c:1.70 src/sys/compat/svr4/svr4_stat.c:1.71
--- src/sys/compat/svr4/svr4_stat.c:1.70	Thu Aug 14 17:29:30 2014
+++ src/sys/compat/svr4/svr4_stat.c	Wed Aug  9 18:52:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stat.c,v 1.70 2014/08/14 17:29:30 maxv Exp $	 */
+/*	$NetBSD: svr4_stat.c,v 1.71 2017/08/09 18:52:00 maxv Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.70 2014/08/14 17:29:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stat.c,v 1.71 2017/08/09 18:52:00 maxv Exp $");
 
 #include 
 #include 
@@ -454,8 +454,6 @@ svr4_sys_systeminfo(struct lwp *l, const
 	case SVR4_SI_ISALIST:
 #if defined(__sparc__)
 		str = "sparcv9 sparcv9-fsmuld sparcv8 sparcv8-fsmuld sparcv7 sparc";
-#elif defined(__i386__)
-		str = "i386";
 #else
 		str = "unknown";
 #endif
@@ -475,9 +473,7 @@ svr4_sys_systeminfo(struct lwp *l, const
 		break;
 
 	case SVR4_SI_PLATFORM:
-#if defined(__i386__)
-		str = "i86pc";
-#elif defined(__sparc__)
+#if defined(__sparc__)
 		{
 			extern char machine_model[];
 



CVS commit: src/sys/compat/svr4

2017-08-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Aug  9 18:52:00 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_exec.h svr4_stat.c

Log Message:
Remove __i386__.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/svr4/svr4_exec.h
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/svr4/svr4_stat.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/netbsd32

2017-07-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jul 31 15:38:01 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_conv.h netbsd32_netbsd.c

Log Message:
Remove references to COMPAT_OLDSOCK (itself removed years ago).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.206 -r1.207 src/sys/compat/netbsd32/netbsd32_netbsd.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.31 src/sys/compat/netbsd32/netbsd32_conv.h:1.32
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.31	Sun Nov 13 13:59:45 2016
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Mon Jul 31 15:38:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.31 2016/11/13 13:59:45 rin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.32 2017/07/31 15:38:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -29,13 +29,6 @@
 #ifndef _COMPAT_NETBSD32_NETBSD32_CONV_H_
 #define _COMPAT_NETBSD32_NETBSD32_CONV_H_
 
-/*
- * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
- * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
- * this would be module-safe.
- */
-#define COMPAT_OLDSOCK /* used by  */
-
 #include 
 #include 
 #include 

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.207
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206	Sat Apr 29 01:15:40 2017
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Mon Jul 31 15:38:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.207 2017/07/31 15:38:01 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.207 2017/07/31 15:38:01 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -39,13 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net
 #include "opt_syscall_debug.h"
 #endif
 
-/*
- * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
- * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
- * this would be module-safe.
- */
-#define COMPAT_OLDSOCK /* used by  */
-
 #include 
 #include 
 #include 



CVS commit: src/sys/compat/netbsd32

2017-07-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Jul 31 15:38:01 UTC 2017

Modified Files:
src/sys/compat/netbsd32: netbsd32_conv.h netbsd32_netbsd.c

Log Message:
Remove references to COMPAT_OLDSOCK (itself removed years ago).


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.206 -r1.207 src/sys/compat/netbsd32/netbsd32_netbsd.c

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



CVS commit: src/sys/compat/svr4_32

2017-07-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 30 12:31:47 UTC 2017

Modified Files:
src/sys/compat/svr4_32: svr4_32_signal.c

Log Message:
make it compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/svr4_32/svr4_32_signal.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/svr4_32/svr4_32_signal.c
diff -u src/sys/compat/svr4_32/svr4_32_signal.c:1.29 src/sys/compat/svr4_32/svr4_32_signal.c:1.30
--- src/sys/compat/svr4_32/svr4_32_signal.c:1.29	Fri Jul 28 13:38:36 2017
+++ src/sys/compat/svr4_32/svr4_32_signal.c	Sun Jul 30 08:31:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_signal.c,v 1.29 2017/07/28 17:38:36 riastradh Exp $	 */
+/*	$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.29 2017/07/28 17:38:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_svr4.h"
@@ -397,16 +397,16 @@ svr4_32_sys_signal(struct lwp *l, const 
 		nbsa.sa_handler = (sig_t)SCARG(uap, handler);
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		error = sigaction1(l, signum, , , NULL, 0);
+		error = sigaction1(l, native_signo, , , NULL, 0);
 		if (error)
-			return (error);
+			return error;
 		*retval = (u_int)(u_long)obsa.sa_handler;
-		return (0);
+		return 0;
 
 	case SVR4_SIGHOLD_MASK:
 	sighold:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_BLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -414,7 +414,7 @@ svr4_32_sys_signal(struct lwp *l, const 
 
 	case SVR4_SIGRELSE_MASK:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_UNBLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -424,17 +424,17 @@ svr4_32_sys_signal(struct lwp *l, const 
 		nbsa.sa_handler = SIG_IGN;
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		return (sigaction1(l, signum, , 0, NULL, 0));
+		return sigaction1(l, native_signo, , 0, NULL, 0);
 
 	case SVR4_SIGPAUSE_MASK:
 		mutex_enter(p->p_lock);
 		ss = l->l_sigmask;
 		mutex_exit(p->p_lock);
-		sigdelset(, signum);
-		return (sigsuspend1(l, ));
+		sigdelset(, native_signo);
+		return sigsuspend1(l, );
 
 	default:
-		return (ENOSYS);
+		return ENOSYS;
 	}
 }
 



CVS commit: src/sys/compat/svr4_32

2017-07-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 30 12:31:47 UTC 2017

Modified Files:
src/sys/compat/svr4_32: svr4_32_signal.c

Log Message:
make it compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/svr4_32/svr4_32_signal.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/sys

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 06:12:50 UTC 2017

Modified Files:
src/sys/compat/sys: socket.h

Log Message:
Only compat_43 needs compat_osock. Note that the use of vec_compat_ifioctl
is racy.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/socket.h

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

Modified files:

Index: src/sys/compat/sys/socket.h
diff -u src/sys/compat/sys/socket.h:1.14 src/sys/compat/sys/socket.h:1.15
--- src/sys/compat/sys/socket.h:1.14	Thu Apr  7 17:48:40 2016
+++ src/sys/compat/sys/socket.h	Sat Jul 29 06:12:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.14 2016/04/07 17:48:40 mrg Exp $	*/
+/*	$NetBSD: socket.h,v 1.15 2017/07/29 06:12:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
@@ -43,8 +43,7 @@
 #include "opt_compat_43.h"
 #include "opt_modular.h"
 
-#if defined(COMPAT_43) || defined(COMPAT_LINUX) || defined(COMPAT_SVR4) || \
-defined(COMPAT_ULTRIX) || defined(MODULAR)
+#if defined(COMPAT_43) || defined(MODULAR)
 #define COMPAT_OSOCK
 #endif
 



CVS commit: src/sys/compat/sys

2017-07-29 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Jul 29 06:12:50 UTC 2017

Modified Files:
src/sys/compat/sys: socket.h

Log Message:
Only compat_43 needs compat_osock. Note that the use of vec_compat_ifioctl
is racy.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/compat/sys/socket.h

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

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 04:08:47 UTC 2017

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

Log Message:
Kill needless nested extern of vec_compat_cvtcmd/ioctl.

Already declared in if_43.h.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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.13 src/sys/compat/common/if_43.c:1.14
--- src/sys/compat/common/if_43.c:1.13	Sat Nov  5 23:30:22 2016
+++ src/sys/compat/common/if_43.c	Sat Jul 29 04:08:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.13 2016/11/05 23:30:22 pgoyette Exp $	*/
+/*	$NetBSD: if_43.c,v 1.14 2017/07/29 04:08:47 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.13 2016/11/05 23:30:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.14 2017/07/29 04:08:47 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -289,9 +289,6 @@ static int (*orig_compat_ifioctl)(struct
 void
 if_43_init(void)
 {
-	extern u_long (*vec_compat_cvtcmd)(u_long);
-	extern int (*vec_compat_ifioctl)(struct socket *, u_long, u_long,
-	void *, struct lwp *);
 
 	orig_compat_cvtcmd = vec_compat_cvtcmd;
 	vec_compat_cvtcmd = compat_cvtcmd;



CVS commit: src/sys/compat/common

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 04:08:47 UTC 2017

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

Log Message:
Kill needless nested extern of vec_compat_cvtcmd/ioctl.

Already declared in if_43.h.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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/linux/common

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 02:31:22 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_time.c

Log Message:
Put suser check in the right function: settimeofday, not gettimeofday.

While here, remove wrong comment.

Noted by kre@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/linux/common/linux_time.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/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.38 src/sys/compat/linux/common/linux_time.c:1.39
--- src/sys/compat/linux/common/linux_time.c:1.38	Sat Jul 29 01:14:59 2017
+++ src/sys/compat/linux/common/linux_time.c	Sat Jul 29 02:31:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $ */
+/*	$NetBSD: linux_time.c,v 1.39 2017/07/29 02:31:22 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.39 2017/07/29 02:31:22 riastradh Exp $");
 
 #include 
 #include 
@@ -79,9 +79,6 @@ linux_sys_gettimeofday(struct lwp *l, co
 	}
 
 	if (SCARG(uap, tzp)) {
-		if (kauth_authorize_generic(kauth_cred_get(),
-			KAUTH_GENERIC_ISSUSER, NULL) != 0)
-			return (EPERM);
 		error = copyout(_sys_tz, SCARG(uap, tzp), sizeof(linux_sys_tz));
 		if (error)
 			return (error);
@@ -105,11 +102,10 @@ linux_sys_settimeofday(struct lwp *l, co
 			return (error);
 	}
 
-	/*
-	 * If user is not the superuser, we returned
-	 * after the sys_settimeofday() call.
-	 */
 	if (SCARG(uap, tzp)) {
+		if (kauth_authorize_generic(kauth_cred_get(),
+			KAUTH_GENERIC_ISSUSER, NULL) != 0)
+			return (EPERM);
 		error = copyin(SCARG(uap, tzp), _sys_tz, sizeof(linux_sys_tz));
 		if (error)
 			return (error);



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

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 02:31:22 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_time.c

Log Message:
Put suser check in the right function: settimeofday, not gettimeofday.

While here, remove wrong comment.

Noted by kre@.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/linux/common/linux_time.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/linux/common

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:14:59 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_time.c

Log Message:
Only let the superuser set the compat_linux timezone.

Not really keen to invent a new kauth cookie for this useless purpose.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/linux/common/linux_time.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/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.37 src/sys/compat/linux/common/linux_time.c:1.38
--- src/sys/compat/linux/common/linux_time.c:1.37	Mon Jan 13 10:33:03 2014
+++ src/sys/compat/linux/common/linux_time.c	Sat Jul 29 01:14:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.38 2017/07/29 01:14:59 riastradh Exp $");
 
 #include 
 #include 
@@ -79,6 +79,9 @@ linux_sys_gettimeofday(struct lwp *l, co
 	}
 
 	if (SCARG(uap, tzp)) {
+		if (kauth_authorize_generic(kauth_cred_get(),
+			KAUTH_GENERIC_ISSUSER, NULL) != 0)
+			return (EPERM);
 		error = copyout(_sys_tz, SCARG(uap, tzp), sizeof(linux_sys_tz));
 		if (error)
 			return (error);



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

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:14:59 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_time.c

Log Message:
Only let the superuser set the compat_linux timezone.

Not really keen to invent a new kauth cookie for this useless purpose.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/linux/common/linux_time.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:14:00 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_stat.c

Log Message:
Little happy on the commit trigger.  Actually use the out label.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/ibcs2/ibcs2_stat.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:14:00 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_stat.c

Log Message:
Little happy on the commit trigger.  Actually use the out label.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/ibcs2/ibcs2_stat.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/ibcs2/ibcs2_stat.c
diff -u src/sys/compat/ibcs2/ibcs2_stat.c:1.49 src/sys/compat/ibcs2/ibcs2_stat.c:1.50
--- src/sys/compat/ibcs2/ibcs2_stat.c:1.49	Sat Jul 29 01:05:54 2017
+++ src/sys/compat/ibcs2/ibcs2_stat.c	Sat Jul 29 01:14:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_stat.c,v 1.49 2017/07/29 01:05:54 riastradh Exp $	*/
+/*	$NetBSD: ibcs2_stat.c,v 1.50 2017/07/29 01:14:00 riastradh Exp $	*/
 /*
  * Copyright (c) 1995, 1998 Scott Bartram
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.49 2017/07/29 01:05:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.50 2017/07/29 01:14:00 riastradh Exp $");
 
 #include 
 #include 
@@ -203,7 +203,7 @@ ibcs2_sys_statvfs(struct lwp *l, const s
 	mp = vp->v_mount;
 	sp = >mnt_stat;
 	if ((error = VFS_STATVFS(mp, sp)) != 0)
-		return (error);
+		goto out;
 	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
 	error = cvt_statvfs(sp, (void *)SCARG(uap, buf),
 	sizeof(struct ibcs2_statvfs));



CVS commit: src/sys/compat/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:05:54 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_stat.c

Log Message:
Don't drop vnode ref until we're done with mount in ibcs2_stat(v)fs.

Nothing else guarantees the mount will stick around.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/ibcs2/ibcs2_stat.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/ibcs2/ibcs2_stat.c
diff -u src/sys/compat/ibcs2/ibcs2_stat.c:1.48 src/sys/compat/ibcs2/ibcs2_stat.c:1.49
--- src/sys/compat/ibcs2/ibcs2_stat.c:1.48	Fri Sep  5 09:21:54 2014
+++ src/sys/compat/ibcs2/ibcs2_stat.c	Sat Jul 29 01:05:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_stat.c,v 1.48 2014/09/05 09:21:54 matt Exp $	*/
+/*	$NetBSD: ibcs2_stat.c,v 1.49 2017/07/29 01:05:54 riastradh Exp $	*/
 /*
  * Copyright (c) 1995, 1998 Scott Bartram
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.48 2014/09/05 09:21:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.49 2017/07/29 01:05:54 riastradh Exp $");
 
 #include 
 #include 
@@ -147,11 +147,13 @@ ibcs2_sys_statfs(struct lwp *l, const st
 		return (error);
 	mp = vp->v_mount;
 	sp = >mnt_stat;
-	vrele(vp);
 	if ((error = VFS_STATVFS(mp, sp)) != 0)
-		return (error);
+		goto out;
 	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
-	return cvt_statfs(sp, (void *)SCARG(uap, buf), SCARG(uap, len));
+	error = cvt_statfs(sp, (void *)SCARG(uap, buf), SCARG(uap, len));
+out:
+	vrele(vp);
+	return (error);
 }
 
 int
@@ -200,12 +202,14 @@ ibcs2_sys_statvfs(struct lwp *l, const s
 		return (error);
 	mp = vp->v_mount;
 	sp = >mnt_stat;
-	vrele(vp);
 	if ((error = VFS_STATVFS(mp, sp)) != 0)
 		return (error);
 	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
-	return cvt_statvfs(sp, (void *)SCARG(uap, buf),
-			   sizeof(struct ibcs2_statvfs));
+	error = cvt_statvfs(sp, (void *)SCARG(uap, buf),
+	sizeof(struct ibcs2_statvfs));
+out:
+	vrele(vp);
+	return error;
 }
 
 int



CVS commit: src/sys/compat/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 01:05:54 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_stat.c

Log Message:
Don't drop vnode ref until we're done with mount in ibcs2_stat(v)fs.

Nothing else guarantees the mount will stick around.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/ibcs2/ibcs2_stat.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:57:48 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_ioctl.c

Log Message:
Zero buffers in ibcs2 ioctl to avoid disclosing stack to userland.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/ibcs2/ibcs2_ioctl.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:57:48 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_ioctl.c

Log Message:
Zero buffers in ibcs2 ioctl to avoid disclosing stack to userland.

>From Ilja Van Sprundel.


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

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

Modified files:

Index: src/sys/compat/ibcs2/ibcs2_ioctl.c
diff -u src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45 src/sys/compat/ibcs2/ibcs2_ioctl.c:1.46
--- src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45	Tue Jun 24 10:03:17 2008
+++ src/sys/compat/ibcs2/ibcs2_ioctl.c	Fri Jul 28 17:57:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $	*/
+/*	$NetBSD: ibcs2_ioctl.c,v 1.46 2017/07/28 17:57:48 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.46 2017/07/28 17:57:48 riastradh Exp $");
 
 #include 
 #include 
@@ -402,8 +402,10 @@ ibcs2_sys_ioctl(struct lwp *l, const str
 		if ((error = (*ctl)(fp, TIOCGETA, )) != 0)
 			goto out;
 
+		memset(, 0, sizeof(sts));
 		btios2stios(, );
 		if (SCARG(uap, cmd) == IBCS2_TCGETA) {
+			memset(, 0, sizeof(st));
 			stios2stio(, );
 			error = copyout(, SCARG(uap, data), sizeof(st));
 			if (error)
@@ -559,6 +561,7 @@ ibcs2_sys_gtty(struct lwp *l, const stru
 
 	fd_putfile(SCARG(uap, fd));
 
+	memset(, 0, sizeof(itb));
 	itb.sg_ispeed = tb.sg_ispeed;
 	itb.sg_ospeed = tb.sg_ospeed;
 	itb.sg_erase = tb.sg_erase;



CVS commit: src/sys/compat/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:52:47 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Check bounds in svr4_sys_putmsg.  Check more svr4_strmcmd bounds.

svr4 streams code is still a disaster.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/svr4/svr4_stream.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/svr4/svr4_stream.c
diff -u src/sys/compat/svr4/svr4_stream.c:1.90 src/sys/compat/svr4/svr4_stream.c:1.91
--- src/sys/compat/svr4/svr4_stream.c:1.90	Fri Jul 28 17:43:46 2017
+++ src/sys/compat/svr4/svr4_stream.c	Fri Jul 28 17:52:47 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stream.c,v 1.90 2017/07/28 17:43:46 riastradh Exp $	 */
+/*	$NetBSD: svr4_stream.c,v 1.91 2017/07/28 17:52:47 riastradh Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.90 2017/07/28 17:43:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.91 2017/07/28 17:52:47 riastradh Exp $");
 
 #include 
 #include 
@@ -533,6 +533,11 @@ si_listen(file_t *fp, int fd, struct svr
 
 	if ((error = copyin(NETBSD32PTR(ioc->buf), , ioc->len)) != 0)
 		return error;
+	if (lst.offs < 0 ||
+	lst.len < 0 ||
+	lst.len > ioc->len ||
+	ioc->len - lst.len < lst.offs)
+		return EINVAL;
 
 	if (lst.cmd != SVR4_TI_OLD_BIND_REQUEST) {
 		DPRINTF(("si_listen: bad request %ld\n", lst.cmd));
@@ -777,7 +782,10 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		DPRINTF(("ti_bind: bad request %ld\n", bnd.cmd));
 		return EINVAL;
 	}
-	if (bnd.offs < 0)
+	if (bnd.offs < 0 ||
+	bnd.len < 0 ||
+	bnd.len > ioc->len ||
+	ioc->len - bnd.len < bnd.offs)
 		return EINVAL;
 
 	switch (st->s_family) {
@@ -1434,7 +1442,10 @@ svr4_sys_putmsg(struct lwp *l, const str
 
 	if ((error = copyin(NETBSD32PTR(ctl.buf), , ctl.len)) != 0)
 		goto out;
-	if (sc.offs < 0) {
+	if (sc.offs < 0 ||
+	sc.len < 0 ||
+	sc.len > ctl.len ||
+	sc.offs > ctl.len - sc.len) {
 		error = EINVAL;
 		goto out;
 	}
@@ -1481,8 +1492,11 @@ svr4_sys_putmsg(struct lwp *l, const str
 			*retval = 0;
 			error = 0;
 			goto out;
-		}
-		else {
+		} else if (sc.len < sizeof(dev_t[2])) {
+			*retval = 0;
+			error = EINVAL;
+			goto out;
+		} else {
 			/* Maybe we've been given a device/inode pair */
 			dev_t *dev = SVR4_ADDROF();
 			svr4_ino_t *ino = (svr4_ino_t *) [1];



CVS commit: src/sys/compat/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:52:47 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Check bounds in svr4_sys_putmsg.  Check more svr4_strmcmd bounds.

svr4 streams code is still a disaster.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/compat/svr4/svr4_stream.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/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:43:46 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Feebly attempt to get this reference counting less bad.

This svr4 streams code is bad and it should feel bad.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/svr4/svr4_stream.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/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:43:46 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Feebly attempt to get this reference counting less bad.

This svr4 streams code is bad and it should feel bad.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/svr4/svr4_stream.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/svr4/svr4_stream.c
diff -u src/sys/compat/svr4/svr4_stream.c:1.89 src/sys/compat/svr4/svr4_stream.c:1.90
--- src/sys/compat/svr4/svr4_stream.c:1.89	Fri Jul 28 16:55:48 2017
+++ src/sys/compat/svr4/svr4_stream.c	Fri Jul 28 17:43:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stream.c,v 1.89 2017/07/28 16:55:48 riastradh Exp $	 */
+/*	$NetBSD: svr4_stream.c,v 1.90 2017/07/28 17:43:46 riastradh Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.89 2017/07/28 16:55:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.90 2017/07/28 17:43:46 riastradh Exp $");
 
 #include 
 #include 
@@ -1507,10 +1507,12 @@ svr4_sys_putmsg(struct lwp *l, const str
  	switch (st->s_cmd = sc.cmd) {
 	case SVR4_TI_CONNECT_REQUEST:	/* connect 	*/
 	 	KERNEL_UNLOCK_ONE(NULL);
+		fd_putfile(SCARG(uap, fd));
 		return do_sys_connect(l, SCARG(uap, fd), skp);
 
 	case SVR4_TI_SENDTO_REQUEST:	/* sendto 	*/
 	 	KERNEL_UNLOCK_ONE(NULL);
+		fd_putfile(SCARG(uap, fd));
 		msg.msg_name = skp;
 		msg.msg_namelen = skp->sa_len;
 		msg.msg_iov = 



CVS commit: src/sys/compat

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:38:36 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_signal.c
src/sys/compat/svr4_32: svr4_32_signal.c

Log Message:
Fix indexing of svr4 signals.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/svr4/svr4_signal.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/svr4_32/svr4_32_signal.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/svr4/svr4_signal.c
diff -u src/sys/compat/svr4/svr4_signal.c:1.66 src/sys/compat/svr4/svr4_signal.c:1.67
--- src/sys/compat/svr4/svr4_signal.c:1.66	Sun Nov  9 18:16:55 2014
+++ src/sys/compat/svr4/svr4_signal.c	Fri Jul 28 17:38:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_signal.c,v 1.66 2014/11/09 18:16:55 maxv Exp $	 */
+/*	$NetBSD: svr4_signal.c,v 1.67 2017/07/28 17:38:35 riastradh Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.66 2014/11/09 18:16:55 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.67 2017/07/28 17:38:35 riastradh Exp $");
 
 #include 
 #include 
@@ -72,6 +72,21 @@ void native_to_svr4_sigaction(const stru
 extern const int native_to_svr4_signo[];
 extern const int svr4_to_native_signo[];
 
+static int
+svr4_decode_signum(int signum, int *native_signo, int *sigcall)
+{
+
+	if (SVR4_SIGNO(signum) >= SVR4_NSIG)
+		return EINVAL;
+
+	if (native_signo)
+		*native_signo = svr4_to_native_signo[SVR4_SIGNO(signum)];
+	if (sigcall)
+		*sigcall = SVR4_SIGCALL(signum);
+
+	return 0;
+}
+
 static inline void
 svr4_sigfillset(svr4_sigset_t *s)
 {
@@ -173,6 +188,7 @@ svr4_sys_sigaction(struct lwp *l, const 
 	} */
 	struct svr4_sigaction nssa, ossa;
 	struct sigaction nbsa, obsa;
+	int native_signo;
 	int error;
 
 	if (SCARG(uap, nsa)) {
@@ -181,7 +197,12 @@ svr4_sys_sigaction(struct lwp *l, const 
 			return (error);
 		svr4_to_native_sigaction(, );
 	}
-	error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))],
+
+	error = svr4_decode_signum(SCARG(uap, signum), _signo, NULL);
+	if (error)
+		return error;
+
+	error = sigaction1(l, native_signo,
 	SCARG(uap, nsa) ?  : 0, SCARG(uap, osa) ?  : 0,
 	NULL, 0);
 	if (error)
@@ -216,16 +237,18 @@ svr4_sys_signal(struct lwp *l, const str
 		syscallarg(int) signum;
 		syscallarg(svr4_sig_t) handler;
 	} */
-	int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
+	int native_signo, sigcall;
 	struct proc *p = l->l_proc;
 	struct sigaction nbsa, obsa;
 	sigset_t ss;
 	int error;
 
-	if (signum <= 0 || signum >= SVR4_NSIG)
-		return (EINVAL);
+	error = svr4_decode_signum(SCARG(uap, signum), _signo,
+	);
+	if (error)
+		return error;
 
-	switch (SVR4_SIGCALL(SCARG(uap, signum))) {
+	switch (sigcall) {
 	case SVR4_SIGDEFER_MASK:
 		if (SCARG(uap, handler) == SVR4_SIG_HOLD)
 			goto sighold;
@@ -235,7 +258,7 @@ svr4_sys_signal(struct lwp *l, const str
 		nbsa.sa_handler = (sig_t)SCARG(uap, handler);
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		error = sigaction1(l, signum, , , NULL, 0);
+		error = sigaction1(l, native_signo, , , NULL, 0);
 		if (error)
 			return (error);
 		*retval = (u_int)(u_long)obsa.sa_handler;
@@ -244,7 +267,7 @@ svr4_sys_signal(struct lwp *l, const str
 	case SVR4_SIGHOLD_MASK:
 	sighold:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_BLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -252,7 +275,7 @@ svr4_sys_signal(struct lwp *l, const str
 
 	case SVR4_SIGRELSE_MASK:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_UNBLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -262,11 +285,11 @@ svr4_sys_signal(struct lwp *l, const str
 		nbsa.sa_handler = SIG_IGN;
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		return (sigaction1(l, signum, , 0, NULL, 0));
+		return (sigaction1(l, native_signo, , 0, NULL, 0));
 
 	case SVR4_SIGPAUSE_MASK:
 		ss = l->l_sigmask;	/* XXXAD locking */
-		sigdelset(, signum);
+		sigdelset(, native_signo);
 		return (sigsuspend1(l, ));
 
 	default:
@@ -392,9 +415,15 @@ svr4_sys_kill(struct lwp *l, const struc
 		syscallarg(int) signum;
 	} */
 	struct sys_kill_args ka;
+	int native_signo;
+	int error;
+
+	error = svr4_decode_signum(SCARG(uap, signum), _signo, NULL);
+	if (error)
+		return error;
 
 	SCARG(, pid) = SCARG(uap, pid);
-	SCARG(, signum) = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
+	SCARG(, signum) = native_signo;
 	return sys_kill(l, , retval);
 }
 

Index: src/sys/compat/svr4_32/svr4_32_signal.c
diff -u src/sys/compat/svr4_32/svr4_32_signal.c:1.28 src/sys/compat/svr4_32/svr4_32_signal.c:1.29
--- src/sys/compat/svr4_32/svr4_32_signal.c:1.28	Mon Apr  4 23:07:06 2016
+++ src/sys/compat/svr4_32/svr4_32_signal.c	Fri 

CVS commit: src/sys/compat

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 17:38:36 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_signal.c
src/sys/compat/svr4_32: svr4_32_signal.c

Log Message:
Fix indexing of svr4 signals.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/svr4/svr4_signal.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/svr4_32/svr4_32_signal.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/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 16:57:12 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_lwp.c

Log Message:
Zero stack data before copyout.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/svr4/svr4_lwp.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/svr4/svr4_lwp.c
diff -u src/sys/compat/svr4/svr4_lwp.c:1.19 src/sys/compat/svr4/svr4_lwp.c:1.20
--- src/sys/compat/svr4/svr4_lwp.c:1.19	Mon Nov 23 00:46:07 2009
+++ src/sys/compat/svr4/svr4_lwp.c	Fri Jul 28 16:57:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $	*/
+/*	$NetBSD: svr4_lwp.c,v 1.20 2017/07/28 16:57:12 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.20 2017/07/28 16:57:12 riastradh Exp $");
 
 #include 
 #include 
@@ -108,6 +108,8 @@ svr4_sys__lwp_info(struct lwp *l, const 
 	struct svr4_lwpinfo lwpinfo;
 	int error;
 
+	memset(, 0, sizeof(lwpinfo));
+
 	/* XXX NJWLWP */
 	TIMEVAL_TO_TIMESPEC(>l_proc->p_stats->p_ru.ru_stime, _stime);
 	TIMEVAL_TO_TIMESPEC(>l_proc->p_stats->p_ru.ru_utime, _utime);



CVS commit: src/sys/compat/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 16:57:12 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_lwp.c

Log Message:
Zero stack data before copyout.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/svr4/svr4_lwp.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/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 16:55:48 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Fix some of the multitudinous holes in svr4 streams.

We should never have enabled this by default; it is a minefield.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/svr4/svr4_stream.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/svr4/svr4_stream.c
diff -u src/sys/compat/svr4/svr4_stream.c:1.88 src/sys/compat/svr4/svr4_stream.c:1.89
--- src/sys/compat/svr4/svr4_stream.c:1.88	Wed Apr 26 03:02:48 2017
+++ src/sys/compat/svr4/svr4_stream.c	Fri Jul 28 16:55:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_stream.c,v 1.88 2017/04/26 03:02:48 riastradh Exp $	 */
+/*	$NetBSD: svr4_stream.c,v 1.89 2017/07/28 16:55:48 riastradh Exp $	 */
 
 /*-
  * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.88 2017/04/26 03:02:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_stream.c,v 1.89 2017/07/28 16:55:48 riastradh Exp $");
 
 #include 
 #include 
@@ -527,7 +527,8 @@ si_listen(file_t *fp, int fd, struct svr
 	if (st == NULL)
 		return EINVAL;
 
-	if (ioc->len > sizeof(lst))
+	if (ioc->len < offsetof(struct svr4_strmcmd, pad) ||
+	ioc->len > sizeof(lst))
 		return EINVAL;
 
 	if ((error = copyin(NETBSD32PTR(ioc->buf), , ioc->len)) != 0)
@@ -717,7 +718,9 @@ ti_getinfo(file_t *fp, int fd, struct sv
 
 	memset(, 0, sizeof(info));
 
-	if (ioc->len > sizeof(info))
+	/* tsdu is next after cmd, the only field we read */
+	if (ioc->len < offsetof(struct svr4_infocmd, tsdu) ||
+	ioc->len > sizeof(info))
 		return EINVAL;
 
 	if ((error = copyin(NETBSD32PTR(ioc->buf), , ioc->len)) != 0)
@@ -763,7 +766,8 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		return EINVAL;
 	}
 
-	if (ioc->len > sizeof(bnd))
+	if (ioc->len < offsetof(struct svr4_strmcmd, pad) ||
+	ioc->len > sizeof(bnd))
 		return EINVAL;
 
 	if ((error = copyin(NETBSD32PTR(ioc->buf), , ioc->len)) != 0)
@@ -773,6 +777,8 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		DPRINTF(("ti_bind: bad request %ld\n", bnd.cmd));
 		return EINVAL;
 	}
+	if (bnd.offs < 0)
+		return EINVAL;
 
 	switch (st->s_family) {
 	case AF_INET:
@@ -782,6 +788,9 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		if (bnd.offs == 0)
 			goto reply;
 
+		if (ioc->len < sizeof(struct svr4_netaddr_in) ||
+		bnd.offs > ioc->len - sizeof(struct svr4_netaddr_in))
+			return EINVAL;
 		netaddr_to_sockaddr_in(sain, );
 
 		DPRINTF(("TI_BIND: fam %d, port %d, addr %x\n",
@@ -795,6 +804,9 @@ ti_bind(file_t *fp, int fd, struct svr4_
 		if (bnd.offs == 0)
 			goto reply;
 
+		if (ioc->len < sizeof(struct svr4_netaddr_un) ||
+		bnd.offs > ioc->len - sizeof(struct svr4_netaddr_un))
+			return EINVAL;
 		netaddr_to_sockaddr_un(saun, );
 
 		if (saun->sun_path[0] == '\0')
@@ -1412,7 +1424,8 @@ svr4_sys_putmsg(struct lwp *l, const str
 		goto out;
 	}
 
-	if (ctl.len > sizeof(sc)) {
+	if (ctl.len < offsetof(struct svr4_strmcmd, pad) ||
+	ctl.len > sizeof(sc)) {
 		DPRINTF(("putmsg: Bad control size %ld != %d\n",
 		(unsigned long)sizeof(struct svr4_strmcmd), ctl.len));
 		error = EINVAL;
@@ -1421,6 +1434,10 @@ svr4_sys_putmsg(struct lwp *l, const str
 
 	if ((error = copyin(NETBSD32PTR(ctl.buf), , ctl.len)) != 0)
 		goto out;
+	if (sc.offs < 0) {
+		error = EINVAL;
+		goto out;
+	}
 
 	switch (st->s_family) {
 	case AF_INET:
@@ -1723,8 +1740,16 @@ svr4_sys_getmsg(struct lwp *l, const str
 		if (ctl.len > sizeof(sc))
 			ctl.len = sizeof(sc);
 
+		if (ctl.len < offsetof(struct svr4_strmcmd, pad)) {
+			error = EINVAL;
+			goto out;
+		}
 		if ((error = copyin(NETBSD32PTR(ctl.buf), , ctl.len)) != 0)
 			goto out;
+		if (sc.offs < 0) {
+			error = EINVAL;
+			goto out;
+		}
 
 		msg.msg_name = NULL;
 		msg.msg_namelen = 0;



CVS commit: src/sys/compat/svr4

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 16:55:48 UTC 2017

Modified Files:
src/sys/compat/svr4: svr4_stream.c

Log Message:
Fix some of the multitudinous holes in svr4 streams.

We should never have enabled this by default; it is a minefield.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/compat/svr4/svr4_stream.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:51:35 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Make sure we move forward over the buffer.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/ibcs2/ibcs2_exec_coff.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:51:35 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Make sure we move forward over the buffer.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/ibcs2/ibcs2_exec_coff.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/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.28 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.29
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.28	Fri Jul 28 15:50:04 2017
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Fri Jul 28 15:51:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.28 2017/07/28 15:50:04 riastradh Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.29 2017/07/28 15:51:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.28 2017/07/28 15:50:04 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.29 2017/07/28 15:51:35 riastradh Exp $");
 
 #include 
 #include 
@@ -469,7 +469,8 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 			/* path_index = slhdr->path_index * sizeof(long); */
 			entry_len = slhdr->entry_len * sizeof(long);
 
-			if (entry_len > len ||
+			if (entry_len < sizeof(struct coff_slhdr) ||
+			entry_len > len ||
 			strnlen(slhdr->sl_name, entry_len) == entry_len) {
 free(tbuf, M_TEMP);
 return ENOEXEC;



CVS commit: src/sys/compat/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:50:04 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Make sure we have enough space in the buffer before reading it.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/compat/ibcs2/ibcs2_exec_coff.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/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.27 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.28
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.27	Fri Jul 28 15:47:23 2017
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Fri Jul 28 15:50:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.27 2017/07/28 15:47:23 riastradh Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.28 2017/07/28 15:50:04 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.27 2017/07/28 15:47:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.28 2017/07/28 15:50:04 riastradh Exp $");
 
 #include 
 #include 
@@ -454,6 +454,10 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 		}
 		bufp = tbuf;
 		while (len) {
+			if (len < sizeof(struct coff_slhdr)) {
+free(tbuf, M_TEMP);
+return ENOEXEC;
+			}
 			slhdr = (struct coff_slhdr *)bufp;
 
 			if (slhdr->path_index > LONG_MAX / sizeof(long) ||



CVS commit: src/sys/compat/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:50:04 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Make sure we have enough space in the buffer before reading it.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/compat/ibcs2/ibcs2_exec_coff.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/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:47:23 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Check for NUL termination within the buffer we have.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/ibcs2/ibcs2_exec_coff.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/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.27
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26	Fri Oct 25 14:46:35 2013
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Fri Jul 28 15:47:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.27 2017/07/28 15:47:23 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.27 2017/07/28 15:47:23 riastradh Exp $");
 
 #include 
 #include 
@@ -465,7 +465,8 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 			/* path_index = slhdr->path_index * sizeof(long); */
 			entry_len = slhdr->entry_len * sizeof(long);
 
-			if (entry_len > len) {
+			if (entry_len > len ||
+			strnlen(slhdr->sl_name, entry_len) == entry_len) {
 free(tbuf, M_TEMP);
 return ENOEXEC;
 			}



CVS commit: src/sys/compat/ibcs2

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 28 15:47:23 UTC 2017

Modified Files:
src/sys/compat/ibcs2: ibcs2_exec_coff.c

Log Message:
Check for NUL termination within the buffer we have.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/ibcs2/ibcs2_exec_coff.c

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



<    5   6   7   8   9   10   11   12   13   14   >