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

2021-01-17 Thread Roy Marples

Hi Simon

On 17/01/2021 11:26, Simon Burge wrote:

On 15/01/2021 07:15, matthew green wrote:

Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD
and is the same struct on all BSD. While bringing the same functionality to
IPv4, I elected to keep the same struct just to have the same API, warts
and all. I like consistency.


Does anyone else have an in_nbrinfo?  I _think_ the "asked" member only
seems to get assigned a 0 for ipv4, and with a long being 32-bits on any
32 bit platform making it a long instead of an int doesn't buy anything.


No, it's currently unique to NetBSD.
Other BSD's just don't have the infrastructure in their network for it either.
I'll note that on a 64-bit platform it's 64 bits though so these do gains 
something.

The value is similar to struct if_data counters really, so maybe it should be a 
uint64_t if you really want to change it.
I would then argue that it might be better then to version it proper and move it 
out of compat32.




I'm still keen to make this change (asked as an int instead of a long in
in_nbrinfo) and announce a mini flag day for arp for -current users so
that it's one less compat32 ioctl we have to maintain.


I would just like arp to work without error.
My personal preference would be to keep the same API and add compat.


I've committed compat32 support for SIOCGNBRINFO_IN6 and in6_nbrinfo.


Looks great!
Also looks the same as what I did but couldn't get to work.
Maybe I missed the netbsd32 on the long.

Roy


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

2021-01-17 Thread Simon Burge
Hi Roy,

Roy Marples wrote:

> On 15/01/2021 07:15, matthew green wrote:
> >> Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD
> >> and is the same struct on all BSD. While bringing the same functionality to
> >> IPv4, I elected to keep the same struct just to have the same API, warts
> >> and all. I like consistency.

Does anyone else have an in_nbrinfo?  I _think_ the "asked" member only
seems to get assigned a 0 for ipv4, and with a long being 32-bits on any
32 bit platform making it a long instead of an int doesn't buy anything.

I'm still keen to make this change (asked as an int instead of a long in
in_nbrinfo) and announce a mini flag day for arp for -current users so
that it's one less compat32 ioctl we have to maintain.

> > [ .. ]
> >> 
> >> That breaks API/ABI though yes? As such it would require stuff in compat
> >> anyway, but leaving it as it just needs n32 compat gunk instead which is
> >> less impactful on other systems.
> > 
> > in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can
> > choose to break them in -current.  there's a slight problem that -current 
> > has
> > a minor flag day here, but it's not the compat issue you seem to think.
>
> CVS disagrees - in6_nbrinfo is from NetBSD-1, only in_nbrinfo is recent:
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/nd6.h?rev=1.14.4.2=text/x-cvsweb-markup_with_tag=netbsd-1-5

Sorry, I only checked the history of in_nbrinfo and just assumed that
in6_nbrinfo was of a similar vintage.  I've committed compat32 support
for SIOCGNBRINFO_IN6 and in6_nbrinfo.

Cheers,
Simon.


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

2021-01-15 Thread Roy Marples

On 15/01/2021 02:43, Simon Burge wrote:

I'll test a bit more

I can't actually test as my ERLite won't boot anymore.
Console light is green, cu says I'm connected but I get nothing out of it.
With cat5 cables plugged in the ports they flash green and then stick on amber.

I'm guessing this is non recoverable :(
If it is recoverable somehow I can put NetBSD back on it as I have a shiny new 
USG in it's place.


Roy


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

2021-01-14 Thread Roy Marples

On 15/01/2021 07:15, matthew green wrote:

Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD
and is the same struct on all BSD. While bringing the same functionality to
IPv4, I elected to keep the same struct just to have the same API, warts
and all. I like consistency.

[ .. ]


That breaks API/ABI though yes? As such it would require stuff in compat
anyway, but leaving it as it just needs n32 compat gunk instead which is
less impactful on other systems.


in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can
choose to break them in -current.  there's a slight problem that -current has
a minor flag day here, but it's not the compat issue you seem to think.


CVS disagrees - in6_nbrinfo is from NetBSD-1, only in_nbrinfo is recent:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/nd6.h?rev=1.14.4.2=text/x-cvsweb-markup_with_tag=netbsd-1-5

Roy


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

2021-01-14 Thread matthew green
> Oh, I quite agree.
> However, in6_nbrinfo predates my involvement with NetBSD and is the same 
> struct 
> on all BSD. While bringing the same functionality to IPv4, I elected to keep 
> the 
> same struct just to have the same API, warts and all. I like consistency.
[ .. ]
>
> That breaks API/ABI though yes?
> As such it would require stuff in compat anyway, but leaving it as it just 
> needs 
> n32 compat gunk instead which is less impactful on other systems.

in6_nbrinfo/in_nbrinfo are not in any published netbsd release
so we can choose to break them in -current.  there's a slight
problem that -current has a minor flag day here, but it's not
the compat issue you seem to think.

with simon's proposed patch, the API doesn't change, so there
no source compat issue to worry about either.  this _only_
breaks -current in the last 4 months or so.


i think we should do this, rather than add additional compat.
we're allowed (and should!) fix -current issues like this.


.mrg.


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

2021-01-14 Thread Roy Marples

On 15/01/2021 02:43, Simon Burge wrote:

Hi Roy,

Roy Marples wrote:


On 14/01/2021 11:03, Simon Burge wrote:

Sure, I will have a look.  Anything IPv6 related I might need a helping
hand to get a test case though :).


As they share a similar structure, you solve one you likely solve the other.
I can assume you have working IPv4 ;)


In general where we can define the structure that are passed in an
interface, regardless if it's a ioctl or sysctl or whatever, we should
try to design the structure so that it's the same regardless of if it's
built with 32-bit or 64-bit userlands.


Oh, I quite agree.
However, in6_nbrinfo predates my involvement with NetBSD and is the same struct 
on all BSD. While bringing the same functionality to IPv4, I elected to keep the 
same struct just to have the same API, warts and all. I like consistency.




The issue with in_nbrinfo and in6_nbrinfo is that there's a "long" in
the structure, so this has different sizes depending on your native long
size.

I _think_ this is the is value out of the la_asked member of struct
llentry which is a uint16_t so we can just make it an int the your
structures will align nicely.  In both cases the ifname name is 16
bytes.  For in_nbrinfo in_addr is effectively an int so we have just
four ints after the ifname.  For in6_nbrinfo the in6_addr is 128 bytes
so aligns nicely, then a couple more ints after that.

If "asked" is from struct llentry then the attached patch should work
without requiring any compat32 support.  If you're happy with this, I'll
test a bit more then commit.


That breaks API/ABI though yes?
As such it would require stuff in compat anyway, but leaving it as it just needs 
n32 compat gunk instead which is less impactful on other systems.


Roy


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

2021-01-14 Thread Simon Burge
Hi Roy,

Roy Marples wrote:

> On 14/01/2021 11:03, Simon Burge wrote:
> > Sure, I will have a look.  Anything IPv6 related I might need a helping
> > hand to get a test case though :).
>
> As they share a similar structure, you solve one you likely solve the other.
> I can assume you have working IPv4 ;)

In general where we can define the structure that are passed in an
interface, regardless if it's a ioctl or sysctl or whatever, we should
try to design the structure so that it's the same regardless of if it's
built with 32-bit or 64-bit userlands.  This is hard where you have
pointers, both otherwise is usually possible with a bit of planning.
You especially need to watch out for long which is a different size on
32-bit/64-bit userlands and also for int64_t which can align differently
depending on the architecture.  If you can do a printf of the struct
size with a variety of arches and they're all the same then good!  amd64,
i386, mips64 (n32), sparc would probably cover the range of cases to
test on (a compile test will do if you look at the generated code for
what is passed to printf).  The general rule is if we can avoid touching
compat/netbsd32 then life is easier!

The issue with in_nbrinfo and in6_nbrinfo is that there's a "long" in
the structure, so this has different sizes depending on your native long
size.

I _think_ this is the is value out of the la_asked member of struct
llentry which is a uint16_t so we can just make it an int the your
structures will align nicely.  In both cases the ifname name is 16
bytes.  For in_nbrinfo in_addr is effectively an int so we have just
four ints after the ifname.  For in6_nbrinfo the in6_addr is 128 bytes
so aligns nicely, then a couple more ints after that.

If "asked" is from struct llentry then the attached patch should work
without requiring any compat32 support.  If you're happy with this, I'll
test a bit more then commit.

Cheers,
Simon.

Index: netinet/in_var.h
===
RCS file: /cvsroot/src/sys/netinet/in_var.h,v
retrieving revision 1.98
diff -d -p -u -r1.98 in_var.h
--- netinet/in_var.h11 Sep 2020 15:22:12 -  1.98
+++ netinet/in_var.h15 Jan 2021 02:18:01 -
@@ -118,7 +118,7 @@ struct in_ifaddr {
 struct in_nbrinfo {
char ifname[IFNAMSIZ];  /* if name, e.g. "en0" */
struct in_addr addr;/* IPv4 address of the neighbor */
-   longasked;  /* number of queries already sent for this addr 
*/
+   int asked;  /* number of queries already sent for this addr 
*/
int state;  /* reachability state */
int expire; /* lifetime for NDP state transition */
 };
Index: netinet6/nd6.h
===
RCS file: /cvsroot/src/sys/netinet6/nd6.h,v
retrieving revision 1.91
diff -d -p -u -r1.91 nd6.h
--- netinet6/nd6.h  11 Sep 2020 15:03:33 -  1.91
+++ netinet6/nd6.h  15 Jan 2021 02:18:01 -
@@ -83,7 +83,7 @@ struct nd_kifinfo {
 struct in6_nbrinfo {
char ifname[IFNAMSIZ];  /* if name, e.g. "en0" */
struct in6_addr addr;   /* IPv6 address of the neighbor */
-   longasked;  /* number of queries already sent for this addr 
*/
+   int asked;  /* number of queries already sent for this addr 
*/
int isrouter;   /* if it acts as a router */
int state;  /* reachability state */
int expire; /* lifetime for NDP state transition */


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

2021-01-14 Thread Roy Marples

On 14/01/2021 11:03, Simon Burge wrote:

Sure, I will have a look.  Anything IPv6 related I might need a helping
hand to get a test case though :).


As they share a similar structure, you solve one you likely solve the other.
I can assume you have working IPv4 ;)

Roy


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

2021-01-14 Thread Simon Burge
Roy Marples wrote:

> On 14/01/2021 08:00, Simon Burge wrote:
> > Module Name:src
> > Committed By:   simonb
> > Date:   Thu Jan 14 08:00:45 UTC 2021
> > 
> > Modified Files:
> > src/sys/compat/netbsd32: netbsd32.h netbsd32_ioctl.c netbsd32_ioctl.h
> > 
> > Log Message:
> > Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.
> > XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.
>
> Could I prompt you into looking at SIOCGNBRINFO (arp -a) and SIOCGNBRINFO_IN6 
> (ndp -a) please?
>
> I could never get that working.

Sure, I will have a look.  Anything IPv6 related I might need a helping
hand to get a test case though :).

Cheers,
Simon.


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

2021-01-14 Thread Roy Marples

On 14/01/2021 08:00, Simon Burge wrote:

Module Name:src
Committed By:   simonb
Date:   Thu Jan 14 08:00:45 UTC 2021

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

Log Message:
Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.
XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.


Could I prompt you into looking at SIOCGNBRINFO (arp -a) and SIOCGNBRINFO_IN6 
(ndp -a) please?


I could never get that working.

Thanks

Roy


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

2020-06-28 Thread Christos Zoulas


> On Jun 28, 2020, at 10:24 AM, Robert Elz  wrote:
> 
>Date:Sat, 27 Jun 2020 11:49:30 -0400
>From:"Christos Zoulas" 
>Message-ID:  <20200627154930.84e22f...@cvs.netbsd.org>
> 
>  | Modified Files:
>  |src/sys/compat/sys: mount.h
>  |
>  | Log Message:
>  | Ignore the supplied size, and always use the argument size that we know.
> 
> Is this fix correct?Certainly looks more reasonable than
> what was there before, as the supplied size (for no seemingly
> good reason) is often 0, but in compat_20_sys_getfsstat() (in
> sys/compat/common/vfs_syscalls_20.c) statvfs_to_statfs12_copy()
> is called, via do_sys_getvfsstat() with a size of
> sizeof(struct statvfs90) and a statvfs90 (compat/sys/statvfs.h)
> is certainly not the same size as a statfs12 (compat/sys/mount.h)
> 
> Or perhaps (probably more likely) compat_20_sys_getfsstat() should
> be passing sizeof(struct statfs12) instead ?   (And now may as well
> just pass 0).

No, it has to be sizeof(struct statfs12) because the function fills an
array of struct statfs12 and needs to know how much to increment.

Thanks,

christos



signature.asc
Description: Message signed with OpenPGP


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

2020-06-28 Thread Robert Elz
Date:Sat, 27 Jun 2020 11:49:30 -0400
From:"Christos Zoulas" 
Message-ID:  <20200627154930.84e22f...@cvs.netbsd.org>

  | Modified Files:
  | src/sys/compat/sys: mount.h
  |
  | Log Message:
  | Ignore the supplied size, and always use the argument size that we know.

Is this fix correct?Certainly looks more reasonable than
what was there before, as the supplied size (for no seemingly
good reason) is often 0, but in compat_20_sys_getfsstat() (in
sys/compat/common/vfs_syscalls_20.c) statvfs_to_statfs12_copy()
is called, via do_sys_getvfsstat() with a size of
sizeof(struct statvfs90) and a statvfs90 (compat/sys/statvfs.h)
is certainly not the same size as a statfs12 (compat/sys/mount.h)

Or perhaps (probably more likely) compat_20_sys_getfsstat() should
be passing sizeof(struct statfs12) instead ?   (And now may as well
just pass 0).

kre



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

2020-03-08 Thread Paul Goyette

On Mon, 9 Mar 2020, Paul Goyette wrote:


Module Name:src
Committed By:   pgoyette
Date:   Mon Mar  9 01:06:34 UTC 2020

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

Log Message:
If a syscall requires a module to be autoloaded, the initial invocation
of that syscall will return ERESTART.  For amd64's netbsd32_syscall()
that means we need to back up the PC saved in the trap frame so we can
re-issue the syscall instruction.  For "normal" syscall traps, we saved
the instruction length in the trap frame, but this was missing for the
oosyscall/lcall path.  Since the PC was not backed up, the kernel-only
value ERESTART was returned to userland, causing all sort of grief for
old compat_netbsd32 executables!


While here, I also added some comments on some recent #endif to better
identify their associated #if - no functional change intended for this.



XXX Pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/netbsd32/netbsd32_mod.c

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


!DSPAM:5e6596db22973983836595!




++--+---+
| Paul Goyette   | PGP Key fingerprint: | E-mail addresses: |
| (Retired)  | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org   |
++--+---+


CVS commit: src/sys/compat

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 12:06:26 UTC 2019

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

Log Message:
8-byte objects on i386 or arm-oabi are aligned in 4-byte boundary.
Therefore, we must use __attribute__((__aligned__(4))) for them.
netbsd32_{,u}int64 are provided for this purpose. However, we
cannot use it in  due to circular dependency
b/w .

In order to distangle it, we choose here to have a duplicate type,
netbsd32_siginfo_uint64, in . The equivalence
with netbsd32_uint64 is asserted in .

Now, gdb for i386 works again on amd64 kernel.

Based on patch provided by kamil. Thanks!

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sys/siginfo.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

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 12:06:26 UTC 2019

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

Log Message:
8-byte objects on i386 or arm-oabi are aligned in 4-byte boundary.
Therefore, we must use __attribute__((__aligned__(4))) for them.
netbsd32_{,u}int64 are provided for this purpose. However, we
cannot use it in  due to circular dependency
b/w .

In order to distangle it, we choose here to have a duplicate type,
netbsd32_siginfo_uint64, in . The equivalence
with netbsd32_uint64 is asserted in .

Now, gdb for i386 works again on amd64 kernel.

Based on patch provided by kamil. Thanks!

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/sys/siginfo.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.130 src/sys/compat/netbsd32/netbsd32.h:1.131
--- src/sys/compat/netbsd32/netbsd32.h:1.130	Mon Nov 18 04:17:08 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Mon Nov 18 12:06:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.130 2019/11/18 04:17:08 rin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.131 2019/11/18 12:06:26 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -162,6 +162,10 @@ typedef int64_t netbsd32_int64 NETBSD32_
 typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN;
 #undef NETBSD32_INT64_ALIGN
 
+/* Type used in siginfo, avoids circular dependencies between headers. */
+CTASSERT(sizeof(netbsd32_uint64) == sizeof(netbsd32_siginfo_uint64));
+CTASSERT(__alignof__(netbsd32_uint64) == __alignof__(netbsd32_siginfo_uint64));
+
 /*
  * all pointers are netbsd32_pointer_t (defined in )
  */

Index: src/sys/compat/sys/siginfo.h
diff -u src/sys/compat/sys/siginfo.h:1.8 src/sys/compat/sys/siginfo.h:1.9
--- src/sys/compat/sys/siginfo.h:1.8	Mon Sep 30 21:13:33 2019
+++ src/sys/compat/sys/siginfo.h	Mon Nov 18 12:06:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: siginfo.h,v 1.8 2019/09/30 21:13:33 kamil Exp $	 */
+/*	$NetBSD: siginfo.h,v 1.9 2019/11/18 12:06:26 rin Exp $	 */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,6 +34,15 @@
 
 #ifdef _KERNEL
 
+/* Avoids circular dependency with machine/netbsd32_machdep.h */
+#if defined(__x86_64__) || (defined(__arm__) && defined(__ARM_EABI__))
+#define NETBSD32_SIGINFO_UINT64_ALIGN __attribute__((__aligned__(4)))
+#else
+#define NETBSD32_SIGINFO_UINT64_ALIGN __attribute__((__aligned__(8)))
+#endif
+typedef uint64_t netbsd32_siginfo_uint64 NETBSD32_SIGINFO_UINT64_ALIGN;
+#undef NETBSD32_SIGINFO_UINT64_ALIGN
+
 typedef union sigval32 {
 	int sival_int;
 	uint32_t sival_ptr;
@@ -73,7 +82,7 @@ struct __ksiginfo32 {
 			int	_sysnum;
 			int	_retval[2];
 			int	_error;
-			uint64_t _args[8]; /* SYS_MAXSYSARGS */
+			netbsd32_siginfo_uint64 _args[8]; /* SYS_MAXSYSARGS */
 		} _syscall;
 
 		struct {



CVS commit: src/sys/compat/netbsd32

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 11:01:41 UTC 2019

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

Log Message:
TRAP_EXEC does not have extra fields to be filled in at the moment.
Explicitly ignore fields for now.

Pointed out by kamil. Thanks!

XXX
pullup to netbsd-9


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

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 11:01:41 UTC 2019

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

Log Message:
TRAP_EXEC does not have extra fields to be filled in at the moment.
Explicitly ignore fields for now.

Pointed out by kamil. Thanks!

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 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_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.49 src/sys/compat/netbsd32/netbsd32_signal.c:1.50
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.49	Mon Nov 18 10:25:48 2019
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Mon Nov 18 11:01:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.50 2019/11/18 11:01:41 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.50 2019/11/18 11:01:41 rin Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -213,6 +213,7 @@ fill_fault:
 	case SIGTRAP:
 		switch (si32->_code) {
 		case TRAP_EXEC:
+			break;
 		case TRAP_CHLD:
 		case TRAP_LWP:
 			si->_reason._ptrace_state._pe_report_event =
@@ -302,6 +303,7 @@ fill_fault:
 	case SIGTRAP:
 		switch (si->_code) {
 		case TRAP_EXEC:
+			break;
 		case TRAP_CHLD:
 		case TRAP_LWP:
 			si32->_reason._ptrace_state._pe_report_event =



CVS commit: src/sys/compat/netbsd32

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 10:25:48 UTC 2019

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

Log Message:
When converting siginfo, examine si_code at the beginning,
as explained in siginfo(2).

- If it is SI_NOINFO, there's no additional information.
- If it is non-positive, i.e., codes described in siginfo(2),
  we need to fill in _rt.

XXX
Description for SA_ASYNCIO in siginfo(2) seems outdated;
neither si_fd nor si_band are filled in with that code.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 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_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.48 src/sys/compat/netbsd32/netbsd32_signal.c:1.49
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.48	Mon Nov 18 10:14:52 2019
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Mon Nov 18 10:25:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -195,6 +195,11 @@ netbsd32_ksi32_to_ksi(struct _ksiginfo *
 	si->_code = si32->_code;
 	si->_errno = si32->_errno;
 
+	if (si32->_code == SI_NOINFO)
+		return;
+	else if (si32->_code <= 0)	/* codes described in siginfo(2) */
+		goto fill_rt;
+
 	switch (si32->_signo) {
 	case SIGILL:
 	case SIGFPE:
@@ -240,6 +245,7 @@ CTASSERT(sizeof(si->_reason._ptrace_stat
 	case SIGVTALRM:
 	case SIGPROF:
 	default:	/* see sigqueue() and kill1() */
+fill_rt:
 		si->_reason._rt._pid = si32->_reason._rt._pid;
 		si->_reason._rt._uid = si32->_reason._rt._uid;
 		si->_reason._rt._value.sival_int =
@@ -278,6 +284,11 @@ netbsd32_ksi_to_ksi32(struct __ksiginfo3
 	si32->_code = si->_code;
 	si32->_errno = si->_errno;
 
+	if (si->_code == SI_NOINFO)
+		return;
+	else if (si->_code <= 0)	/* codes described in siginfo(2) */
+		goto fill_rt;
+
 	switch (si->_signo) {
 	case SIGILL:
 	case SIGFPE:
@@ -323,6 +334,7 @@ CTASSERT(sizeof(si32->_reason._ptrace_st
 	case SIGVTALRM:
 	case SIGPROF:
 	default:	/* see sigqueue() and kill1() */
+fill_rt:
 		si32->_reason._rt._pid = si->_reason._rt._pid;
 		si32->_reason._rt._uid = si->_reason._rt._uid;
 		si32->_reason._rt._value.sival_int =



CVS commit: src/sys/compat/netbsd32

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 10:25:48 UTC 2019

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

Log Message:
When converting siginfo, examine si_code at the beginning,
as explained in siginfo(2).

- If it is SI_NOINFO, there's no additional information.
- If it is non-positive, i.e., codes described in siginfo(2),
  we need to fill in _rt.

XXX
Description for SA_ASYNCIO in siginfo(2) seems outdated;
neither si_fd nor si_band are filled in with that code.

XXX
pullup to netbsd-9


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

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 10:14:52 UTC 2019

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

Log Message:
Provide _ptrace_state for SIGTRAP with TRAP_EXEC, TRAP_CHLD, or TRAP_LWP.

Pointed out by kamil. Thanks!

XXX
pullup to netbsd-9


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

2019-11-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 10:14:52 UTC 2019

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

Log Message:
Provide _ptrace_state for SIGTRAP with TRAP_EXEC, TRAP_CHLD, or TRAP_LWP.

Pointed out by kamil. Thanks!

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 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_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.47 src/sys/compat/netbsd32/netbsd32_signal.c:1.48
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.47	Mon Nov 18 04:58:42 2019
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Mon Nov 18 10:14:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -206,17 +206,35 @@ fill_fault:
 		si->_reason._fault._trap = si32->_reason._fault._trap;
 		break;
 	case SIGTRAP:
-		if (si32->_code != TRAP_SCE && si32->_code != TRAP_SCX)
+		switch (si32->_code) {
+		case TRAP_EXEC:
+		case TRAP_CHLD:
+		case TRAP_LWP:
+			si->_reason._ptrace_state._pe_report_event =
+			si32->_reason._ptrace_state._pe_report_event;
+CTASSERT(sizeof(si->_reason._ptrace_state._option._pe_other_pid) ==
+sizeof(si->_reason._ptrace_state._option._pe_lwp));
+			si->_reason._ptrace_state._option._pe_other_pid =
+			si32->_reason._ptrace_state._option._pe_other_pid;
+			break;
+		case TRAP_SCE:
+		case TRAP_SCX:
+			si->_reason._syscall._sysnum =
+			si32->_reason._syscall._sysnum;
+			si->_reason._syscall._retval[0] =
+			si32->_reason._syscall._retval[0];
+			si->_reason._syscall._retval[1] =
+			si32->_reason._syscall._retval[1];
+			si->_reason._syscall._error =
+			si32->_reason._syscall._error;
+			for (i = 0;
+			i < __arraycount(si->_reason._syscall._args); i++)
+si->_reason._syscall._args[i] =
+si32->_reason._syscall._args[i];
+			break;
+		default:
 			goto fill_fault;
-		si->_reason._syscall._sysnum = si32->_reason._syscall._sysnum;
-		si->_reason._syscall._retval[0] =
-		si32->_reason._syscall._retval[0];
-		si->_reason._syscall._retval[1] =
-		si32->_reason._syscall._retval[1];
-		si->_reason._syscall._error = si32->_reason._syscall._error;
-		for (i = 0; i < __arraycount(si->_reason._syscall._args); i++)
-			si->_reason._syscall._args[i] =
-			si32->_reason._syscall._args[i];
+		}
 		break;
 	case SIGALRM:
 	case SIGVTALRM:
@@ -271,17 +289,35 @@ fill_fault:
 		si32->_reason._fault._trap = si->_reason._fault._trap;
 		break;
 	case SIGTRAP:
-		if (si->_code != TRAP_SCE && si->_code != TRAP_SCX)
+		switch (si->_code) {
+		case TRAP_EXEC:
+		case TRAP_CHLD:
+		case TRAP_LWP:
+			si32->_reason._ptrace_state._pe_report_event =
+			si->_reason._ptrace_state._pe_report_event;
+CTASSERT(sizeof(si32->_reason._ptrace_state._option._pe_other_pid) ==
+sizeof(si32->_reason._ptrace_state._option._pe_lwp));
+			si32->_reason._ptrace_state._option._pe_other_pid =
+			si->_reason._ptrace_state._option._pe_other_pid;
+			break;
+		case TRAP_SCE:
+		case TRAP_SCX:
+			si32->_reason._syscall._sysnum =
+			si->_reason._syscall._sysnum;
+			si32->_reason._syscall._retval[0] =
+			si->_reason._syscall._retval[0];
+			si32->_reason._syscall._retval[1] =
+			si->_reason._syscall._retval[1];
+			si32->_reason._syscall._error =
+			si->_reason._syscall._error;
+			for (i = 0;
+			i < __arraycount(si->_reason._syscall._args); i++)
+si32->_reason._syscall._args[i] =
+si->_reason._syscall._args[i];
+			break;
+		default:
 			goto fill_fault;
-		si32->_reason._syscall._sysnum = si->_reason._syscall._sysnum;
-		si32->_reason._syscall._retval[0] =
-		si->_reason._syscall._retval[0];
-		si32->_reason._syscall._retval[1] =
-		si->_reason._syscall._retval[1];
-		si32->_reason._syscall._error = si->_reason._syscall._error;
-		for (i = 0; i < __arraycount(si32->_reason._syscall._args); i++)
-			si32->_reason._syscall._args[i] =
-			si->_reason._syscall._args[i];
+		}
 		break;
 	case SIGALRM:
 	case SIGVTALRM:



CVS commit: src/sys/compat/netbsd32

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:58:42 UTC 2019

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

Log Message:
Sort by signal numbers as far as possible, adjust locations of functions.
No functional changes intended.

XXX
pullup to netbsd-9


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

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:58:42 UTC 2019

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

Log Message:
Sort by signal numbers as far as possible, adjust locations of functions.
No functional changes intended.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 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_signal.c
diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.46 src/sys/compat/netbsd32/netbsd32_signal.c:1.47
--- src/sys/compat/netbsd32/netbsd32_signal.c:1.46	Mon Nov 18 04:09:53 2019
+++ src/sys/compat/netbsd32/netbsd32_signal.c	Mon Nov 18 04:58:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_signal.c,v 1.46 2019/11/18 04:09:53 rin Exp $	*/
+/*	$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.46 2019/11/18 04:09:53 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $");
 
 #if defined(_KERNEL_OPT) 
 #include "opt_ktrace.h"
@@ -197,9 +197,9 @@ netbsd32_ksi32_to_ksi(struct _ksiginfo *
 
 	switch (si32->_signo) {
 	case SIGILL:
+	case SIGFPE:
 	case SIGBUS:
 	case SIGSEGV:
-	case SIGFPE:
 fill_fault:
 		si->_reason._fault._addr =
 		NETBSD32IPTR64(si32->_reason._fault._addr);
@@ -227,6 +227,11 @@ fill_fault:
 		si->_reason._rt._value.sival_int =
 		si32->_reason._rt._value.sival_int;
 		break;
+	case SIGURG:
+	case SIGIO:
+		si->_reason._poll._band = si32->_reason._poll._band;
+		si->_reason._poll._fd = si32->_reason._poll._fd;
+		break;
 	case SIGCHLD:
 		si->_reason._child._pid = si32->_reason._child._pid;
 		si->_reason._child._uid = si32->_reason._child._uid;
@@ -234,14 +239,17 @@ fill_fault:
 		si->_reason._child._utime = si32->_reason._child._utime;
 		si->_reason._child._stime = si32->_reason._child._stime;
 		break;
-	case SIGURG:
-	case SIGIO:
-		si->_reason._poll._band = si32->_reason._poll._band;
-		si->_reason._poll._fd = si32->_reason._poll._fd;
-		break;
 	}
 }
 
+void
+netbsd32_si32_to_si(siginfo_t *si, const siginfo32_t *si32)
+{
+
+	memset(si, 0, sizeof (*si));
+	netbsd32_ksi32_to_ksi(>_info, >_info);
+}
+
 static void
 netbsd32_ksi_to_ksi32(struct __ksiginfo32 *si32, const struct _ksiginfo *si)
 {
@@ -254,9 +262,9 @@ netbsd32_ksi_to_ksi32(struct __ksiginfo3
 
 	switch (si->_signo) {
 	case SIGILL:
+	case SIGFPE:
 	case SIGBUS:
 	case SIGSEGV:
-	case SIGFPE:
 fill_fault:
 		si32->_reason._fault._addr =
 		NETBSD32PTR32I(si->_reason._fault._addr);
@@ -284,6 +292,11 @@ fill_fault:
 		si32->_reason._rt._value.sival_int =
 		si->_reason._rt._value.sival_int;
 		break;
+	case SIGURG:
+	case SIGIO:
+		si32->_reason._poll._band = si->_reason._poll._band;
+		si32->_reason._poll._fd = si->_reason._poll._fd;
+		break;
 	case SIGCHLD:
 		si32->_reason._child._pid = si->_reason._child._pid;
 		si32->_reason._child._uid = si->_reason._child._uid;
@@ -291,11 +304,6 @@ fill_fault:
 		si32->_reason._child._utime = si->_reason._child._utime;
 		si32->_reason._child._stime = si->_reason._child._stime;
 		break;
-	case SIGURG:
-	case SIGIO:
-		si32->_reason._poll._band = si->_reason._poll._band;
-		si32->_reason._poll._fd = si->_reason._poll._fd;
-		break;
 	}
 }
 
@@ -308,14 +316,6 @@ netbsd32_si_to_si32(siginfo32_t *si32, c
 }
 
 void
-netbsd32_si32_to_si(siginfo_t *si, const siginfo32_t *si32)
-{
-
-	memset(si, 0, sizeof (*si));
-	netbsd32_ksi32_to_ksi(>_info, >_info);
-}
-
-void
 getucontext32(struct lwp *l, ucontext32_t *ucp)
 {
 	struct proc *p = l->l_proc;



CVS commit: src/sys/compat/netbsd32

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:17:08 UTC 2019

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

Log Message:
Sorry, revert unintentional parts of the previous commit:
http://mail-index.netbsd.org/source-changes/2019/11/18/msg110946.html

I was going to commit only netbsd32_signal.c.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.69 -r1.70 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.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.129 src/sys/compat/netbsd32/netbsd32.h:1.130
--- src/sys/compat/netbsd32/netbsd32.h:1.129	Mon Nov 18 04:09:53 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Mon Nov 18 04:17:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.129 2019/11/18 04:09:53 rin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.130 2019/11/18 04:17:08 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -37,7 +37,6 @@
  */
 
 #include  /* precautionary upon removal from ucred.h */
-#include 
 #include 
 #include 
 #include 
@@ -73,11 +72,7 @@ typedef int32_t netbsd32_key_t;
 typedef int32_t netbsd32_intptr_t;
 typedef uint32_t netbsd32_uintptr_t;
 
-/*
- * netbsd32_[u]int64 are machine dependent and defined in :
- * 64 bit integers only have 4-byte alignment on some 32 bit ports,
- * but always have 8-byte alignment on 64 bit systems.
- */
+/* netbsd32_[u]int64 are machine dependent and defined below */
 
 /*
  * machine dependant section; must define:
@@ -159,6 +154,15 @@ netbsd32_ptr32_incr(netbsd32_pointer_t *
 #undef NETBSD32_POINTER_TYPE
 
 /*
+ * 64 bit integers only have 4-byte alignment on some 32 bit ports,
+ * but always have 8-byte alignment on 64 bit systems.
+ * NETBSD32_INT64_ALIGN may be __attribute__((__aligned__(4)))
+ */
+typedef int64_t netbsd32_int64 NETBSD32_INT64_ALIGN;
+typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN;
+#undef NETBSD32_INT64_ALIGN
+
+/*
  * all pointers are netbsd32_pointer_t (defined in )
  */
 
@@ -208,13 +212,14 @@ struct netbsd32_iovec {
 
 /* from  */
 typedef int32_t netbsd32_timer_t;
+typedef	int32_t netbsd32_time50_t;
 typedef	netbsd32_int64 netbsd32_time_t;
 typedef netbsd32_pointer_t netbsd32_timerp_t;
 typedef netbsd32_pointer_t netbsd32_clockidp_t;
 
 typedef netbsd32_pointer_t netbsd32_timespec50p_t;
 struct netbsd32_timespec50 {
-	int32_t		tv_sec;			/* seconds */
+	netbsd32_time50_t tv_sec;			/* seconds */
 	netbsd32_long	tv_nsec;	/* and nanoseconds */
 };
 
@@ -226,7 +231,7 @@ struct netbsd32_timespec {
 
 typedef netbsd32_pointer_t netbsd32_timeval50p_t;
 struct netbsd32_timeval50 {
-	netbsd32_long		tv_sec;		/* seconds */
+	netbsd32_time50_t	tv_sec;		/* seconds */
 	netbsd32_long		tv_usec;	/* and microseconds */
 };
 

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.41 src/sys/compat/netbsd32/netbsd32_conv.h:1.42
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.41	Mon Nov 18 04:09:53 2019
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Mon Nov 18 04:17:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.41 2019/11/18 04:09:53 rin Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.42 2019/11/18 04:17:08 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -58,7 +58,7 @@ netbsd32_from_timeval50(const struct tim
 struct netbsd32_timeval50 *tv32)
 {
 
-	tv32->tv_sec = (netbsd32_long)tv->tv_sec;
+	tv32->tv_sec = (netbsd32_time50_t)tv->tv_sec;
 	tv32->tv_usec = (netbsd32_long)tv->tv_usec;
 }
 
@@ -152,7 +152,7 @@ netbsd32_from_timespec50(const struct ti
 struct netbsd32_timespec50 *s32p)
 {
 
-	s32p->tv_sec = (int32_t)p->tv_sec;
+	s32p->tv_sec = (netbsd32_time50_t)p->tv_sec;
 	s32p->tv_nsec = (netbsd32_long)p->tv_nsec;
 }
 

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.106
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105	Mon Nov 18 04:09:53 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Nov 18 04:17:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.106 2019/11/18 04:17:08 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.106 2019/11/18 04:17:08 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1066,30 +1066,6 @@ netbsd32_do_clockctl_ntp_adjtime(struct 
 }
 #endif
 
-#ifdef COMPAT_50
-static void

CVS commit: src/sys/compat/netbsd32

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:17:08 UTC 2019

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

Log Message:
Sorry, revert unintentional parts of the previous commit:
http://mail-index.netbsd.org/source-changes/2019/11/18/msg110946.html

I was going to commit only netbsd32_signal.c.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.105 -r1.106 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.69 -r1.70 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/netbsd32

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:09:53 UTC 2019

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

Log Message:
Belatedly catch up with kern_sig.c rev 1.358:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_sig.c#rev1.358

Provide syscall information with SIGTRAP TRAP_SCE/TRAP_SCX so that
picotrace/truss, for example, works fine on COMPAT_NETBSD32.

With some minor changes:

- Centralize netbsd32_si{,32}_si{32,}() into netbsd32_ksi{,32}_ksi{32,}().
- Provide si_status with SIGCHLD.
- Remove the remaining of SA.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_ioctl.h
cvs rdiff -u -r1.45 -r1.46 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

2019-11-17 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov 18 04:09:53 UTC 2019

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

Log Message:
Belatedly catch up with kern_sig.c rev 1.358:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_sig.c#rev1.358

Provide syscall information with SIGTRAP TRAP_SCE/TRAP_SCX so that
picotrace/truss, for example, works fine on COMPAT_NETBSD32.

With some minor changes:

- Centralize netbsd32_si{,32}_si{32,}() into netbsd32_ksi{,32}_ksi{32,}().
- Provide si_status with SIGCHLD.
- Remove the remaining of SA.

XXX
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.104 -r1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_ioctl.h
cvs rdiff -u -r1.45 -r1.46 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.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.128 src/sys/compat/netbsd32/netbsd32.h:1.129
--- src/sys/compat/netbsd32/netbsd32.h:1.128	Thu Nov  7 15:21:55 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Mon Nov 18 04:09:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.128 2019/11/07 15:21:55 rin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.129 2019/11/18 04:09:53 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -37,6 +37,7 @@
  */
 
 #include  /* precautionary upon removal from ucred.h */
+#include 
 #include 
 #include 
 #include 
@@ -72,7 +73,11 @@ typedef int32_t netbsd32_key_t;
 typedef int32_t netbsd32_intptr_t;
 typedef uint32_t netbsd32_uintptr_t;
 
-/* netbsd32_[u]int64 are machine dependent and defined below */
+/*
+ * netbsd32_[u]int64 are machine dependent and defined in :
+ * 64 bit integers only have 4-byte alignment on some 32 bit ports,
+ * but always have 8-byte alignment on 64 bit systems.
+ */
 
 /*
  * machine dependant section; must define:
@@ -154,15 +159,6 @@ netbsd32_ptr32_incr(netbsd32_pointer_t *
 #undef NETBSD32_POINTER_TYPE
 
 /*
- * 64 bit integers only have 4-byte alignment on some 32 bit ports,
- * but always have 8-byte alignment on 64 bit systems.
- * NETBSD32_INT64_ALIGN may be __attribute__((__aligned__(4)))
- */
-typedef int64_t netbsd32_int64 NETBSD32_INT64_ALIGN;
-typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN;
-#undef NETBSD32_INT64_ALIGN
-
-/*
  * all pointers are netbsd32_pointer_t (defined in )
  */
 
@@ -212,14 +208,13 @@ struct netbsd32_iovec {
 
 /* from  */
 typedef int32_t netbsd32_timer_t;
-typedef	int32_t netbsd32_time50_t;
 typedef	netbsd32_int64 netbsd32_time_t;
 typedef netbsd32_pointer_t netbsd32_timerp_t;
 typedef netbsd32_pointer_t netbsd32_clockidp_t;
 
 typedef netbsd32_pointer_t netbsd32_timespec50p_t;
 struct netbsd32_timespec50 {
-	netbsd32_time50_t tv_sec;			/* seconds */
+	int32_t		tv_sec;			/* seconds */
 	netbsd32_long	tv_nsec;	/* and nanoseconds */
 };
 
@@ -231,7 +226,7 @@ struct netbsd32_timespec {
 
 typedef netbsd32_pointer_t netbsd32_timeval50p_t;
 struct netbsd32_timeval50 {
-	netbsd32_time50_t	tv_sec;		/* seconds */
+	netbsd32_long		tv_sec;		/* seconds */
 	netbsd32_long		tv_usec;	/* and microseconds */
 };
 

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.40 src/sys/compat/netbsd32/netbsd32_conv.h:1.41
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.40	Thu Oct  3 22:16:53 2019
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Mon Nov 18 04:09:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.40 2019/10/03 22:16:53 kamil Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.41 2019/11/18 04:09:53 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -58,7 +58,7 @@ netbsd32_from_timeval50(const struct tim
 struct netbsd32_timeval50 *tv32)
 {
 
-	tv32->tv_sec = (netbsd32_time50_t)tv->tv_sec;
+	tv32->tv_sec = (netbsd32_long)tv->tv_sec;
 	tv32->tv_usec = (netbsd32_long)tv->tv_usec;
 }
 
@@ -152,7 +152,7 @@ netbsd32_from_timespec50(const struct ti
 struct netbsd32_timespec50 *s32p)
 {
 
-	s32p->tv_sec = (netbsd32_time50_t)p->tv_sec;
+	s32p->tv_sec = (int32_t)p->tv_sec;
 	s32p->tv_nsec = (netbsd32_long)p->tv_nsec;
 }
 

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104	Tue Aug 20 09:32:21 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Mon Nov 18 04:09:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 

CVS commit: src/sys/compat

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 23:45:08 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux32/arch/amd64: linux32_syscall.h
linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c
linux32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.107 -r1.108 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.109 -r1.110 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.105 -r1.106 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.83 -r1.84 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c
cvs rdiff -u -r1.79 -r1.80 \
src/sys/compat/linux32/arch/amd64/linux32_syscall.h \
src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h \
src/sys/compat/linux32/arch/amd64/linux32_syscalls.c \
src/sys/compat/linux32/arch/amd64/linux32_sysent.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/compat/linux32/arch/amd64/linux32_systrace_args.c

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

Modified files:

Index: src/sys/compat/linux/arch/alpha/linux_syscall.h
diff -u src/sys/compat/linux/arch/alpha/linux_syscall.h:1.108 src/sys/compat/linux/arch/alpha/linux_syscall.h:1.109
--- src/sys/compat/linux/arch/alpha/linux_syscall.h:1.108	Sun Mar 24 16:39:46 2019
+++ src/sys/compat/linux/arch/alpha/linux_syscall.h	Sat Nov  9 23:45:07 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.108 2019/03/24 16:39:46 maxv Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.109 2019/11/09 23:45:07 jdolecek Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.94 2017/02/03 16:17:08 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.96 2019/11/09 23:44:31 jdolecek Exp
  */
 
 #ifndef _LINUX_SYS_SYSCALL_H_
@@ -702,6 +702,9 @@
 /* syscall: "recvmmsg" ret: "int" args: "int" "struct linux_mmsghdr *" "unsigned int" "unsigned int" "struct timespec *" */
 #define	LINUX_SYS_recvmmsg	479
 
+/* syscall: "fallocate" ret: "int" args: "int" "int" "off_t" "off_t" */
+#define	LINUX_SYS_fallocate	480
+
 /* syscall: "dup3" ret: "int" args: "int" "int" "int" */
 #define	LINUX_SYS_dup3	487
 
Index: 

CVS commit: src/sys/compat

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 23:44:32 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_file.c
src/sys/compat/linux32/arch/amd64: syscalls.master
src/sys/compat/linux32/common: linux32_unistd.c

Log Message:
add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;
this is needed so that glibc falls back to emulation and apps behaving
properly, since EOPNOTSUPP is a documented and expected return code, but
ENOSYS is not

right now there are no filesystems in NetBSD tree supporting the fallocate
VOP, so no point trying to map this to a native call

supposed to help with problem reported in
https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.60 -r1.61 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.72 -r1.73 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux32/arch/amd64/syscalls.master
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/linux32/common/linux32_unistd.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/alpha/syscalls.master
diff -u src/sys/compat/linux/arch/alpha/syscalls.master:1.95 src/sys/compat/linux/arch/alpha/syscalls.master:1.96
--- src/sys/compat/linux/arch/alpha/syscalls.master:1.95	Sun Mar 24 16:24:19 2019
+++ src/sys/compat/linux/arch/alpha/syscalls.master	Sat Nov  9 23:44:31 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.95 2019/03/24 16:24:19 maxv Exp $
+	$NetBSD: syscalls.master,v 1.96 2019/11/09 23:44:31 jdolecek Exp $
 ;
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -760,7 +760,8 @@
 479	STD		{ int|linux_sys||recvmmsg(int s, \
 			struct linux_mmsghdr *msgvec, unsigned int vlen, \
 			unsigned int flags, struct timespec *timeout); }
-480	UNIMPL		fallocate
+480	STD		{ int|linux_sys||fallocate(int fd, int mode, \
+			off_t offset, off_t len); }
 481	UNIMPL		timerfd_create
 482	UNIMPL		timerfd_settime
 483	UNIMPL		timerfd_gettime

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.60 src/sys/compat/linux/arch/amd64/syscalls.master:1.61
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.60	Fri Feb  3 16:18:19 2017
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Sat Nov  9 23:44:31 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.60 2017/02/03 16:18:19 christos Exp $
+	$NetBSD: syscalls.master,v 1.61 2019/11/09 23:44:31 jdolecek Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -513,7 +513,8 @@
 282	UNIMPL		signalfd
 283	UNIMPL		timerfd_create
 284	UNIMPL		eventfd
-285	UNIMPL		fallocate
+285	STD		{ int|linux_sys||fallocate(int fd, int mode, \
+			off_t offset, off_t len); }
 286	UNIMPL		timerfd_settime
 287	UNIMPL		timerfd_gettime
 288	STD		{ int|linux_sys||accept4(int s, \

Index: src/sys/compat/linux/arch/arm/syscalls.master
diff -u src/sys/compat/linux/arch/arm/syscalls.master:1.67 src/sys/compat/linux/arch/arm/syscalls.master:1.68
--- src/sys/compat/linux/arch/arm/syscalls.master:1.67	Fri Feb  3 16:28:34 2017
+++ src/sys/compat/linux/arch/arm/syscalls.master	Sat Nov  9 23:44:31 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.67 2017/02/03 16:28:34 christos Exp $
+	$NetBSD: syscalls.master,v 1.68 2019/11/09 23:44:31 jdolecek Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -556,7 +556,8 @@
 349	UNIMPL		signalfd
 350	UNIMPL		timerfd_create
 351	UNIMPL		eventfd
-352	UNIMPL		fallocate
+352	STD		{ int|linux_sys||fallocate(int fd, int mode, \
+			off_t offset, off_t len); }
 353	UNIMPL		timerfd_settime
 354	UNIMPL		timerfd_gettime
 355	UNIMPL		signalfd4

Index: src/sys/compat/linux/arch/i386/syscalls.master
diff -u src/sys/compat/linux/arch/i386/syscalls.master:1.122 src/sys/compat/linux/arch/i386/syscalls.master:1.123
--- src/sys/compat/linux/arch/i386/syscalls.master:1.122	Mon Jan  2 16:32:09 2017
+++ src/sys/compat/linux/arch/i386/syscalls.master	Sat Nov 

CVS commit: src/sys/compat

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 23:45:08 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c linux_systrace_args.c
src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h
linux_syscalls.c linux_sysent.c
src/sys/compat/linux32/arch/amd64: linux32_syscall.h
linux32_syscallargs.h linux32_syscalls.c linux32_sysent.c
linux32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/alpha/linux_syscall.h \
src/sys/compat/linux/arch/alpha/linux_sysent.c
cvs rdiff -u -r1.107 -r1.108 \
src/sys/compat/linux/arch/alpha/linux_syscallargs.h
cvs rdiff -u -r1.109 -r1.110 src/sys/compat/linux/arch/alpha/linux_syscalls.c
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux/arch/amd64/linux_syscall.h \
src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
src/sys/compat/linux/arch/amd64/linux_syscalls.c \
src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/arm/linux_syscall.h \
src/sys/compat/linux/arch/arm/linux_syscallargs.h \
src/sys/compat/linux/arch/arm/linux_syscalls.c \
src/sys/compat/linux/arch/arm/linux_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/linux/arch/arm/linux_systrace_args.c
cvs rdiff -u -r1.114 -r1.115 src/sys/compat/linux/arch/i386/linux_syscall.h \
src/sys/compat/linux/arch/i386/linux_syscallargs.h \
src/sys/compat/linux/arch/i386/linux_sysent.c
cvs rdiff -u -r1.115 -r1.116 src/sys/compat/linux/arch/i386/linux_syscalls.c
cvs rdiff -u -r1.9 -r1.10 \
src/sys/compat/linux/arch/i386/linux_systrace_args.c
cvs rdiff -u -r1.106 -r1.107 src/sys/compat/linux/arch/m68k/linux_syscall.h \
src/sys/compat/linux/arch/m68k/linux_syscalls.c \
src/sys/compat/linux/arch/m68k/linux_sysent.c
cvs rdiff -u -r1.105 -r1.106 \
src/sys/compat/linux/arch/m68k/linux_syscallargs.h
cvs rdiff -u -r1.78 -r1.79 src/sys/compat/linux/arch/mips/linux_syscall.h
cvs rdiff -u -r1.77 -r1.78 src/sys/compat/linux/arch/mips/linux_syscallargs.h \
src/sys/compat/linux/arch/mips/linux_syscalls.c \
src/sys/compat/linux/arch/mips/linux_sysent.c
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/linux/arch/powerpc/linux_syscall.h \
src/sys/compat/linux/arch/powerpc/linux_sysent.c
cvs rdiff -u -r1.83 -r1.84 \
src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \
src/sys/compat/linux/arch/powerpc/linux_syscalls.c
cvs rdiff -u -r1.79 -r1.80 \
src/sys/compat/linux32/arch/amd64/linux32_syscall.h \
src/sys/compat/linux32/arch/amd64/linux32_syscallargs.h \
src/sys/compat/linux32/arch/amd64/linux32_syscalls.c \
src/sys/compat/linux32/arch/amd64/linux32_sysent.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/compat/linux32/arch/amd64/linux32_systrace_args.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

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 23:44:32 UTC 2019

Modified Files:
src/sys/compat/linux/arch/alpha: syscalls.master
src/sys/compat/linux/arch/amd64: syscalls.master
src/sys/compat/linux/arch/arm: syscalls.master
src/sys/compat/linux/arch/i386: syscalls.master
src/sys/compat/linux/arch/m68k: syscalls.master
src/sys/compat/linux/arch/mips: syscalls.master
src/sys/compat/linux/arch/powerpc: syscalls.master
src/sys/compat/linux/common: linux_file.c
src/sys/compat/linux32/arch/amd64: syscalls.master
src/sys/compat/linux32/common: linux32_unistd.c

Log Message:
add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;
this is needed so that glibc falls back to emulation and apps behaving
properly, since EOPNOTSUPP is a documented and expected return code, but
ENOSYS is not

right now there are no filesystems in NetBSD tree supporting the fallocate
VOP, so no point trying to map this to a native call

supposed to help with problem reported in
https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/compat/linux/arch/alpha/syscalls.master
cvs rdiff -u -r1.60 -r1.61 src/sys/compat/linux/arch/amd64/syscalls.master
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux/arch/arm/syscalls.master
cvs rdiff -u -r1.122 -r1.123 src/sys/compat/linux/arch/i386/syscalls.master
cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/arch/m68k/syscalls.master
cvs rdiff -u -r1.66 -r1.67 src/sys/compat/linux/arch/mips/syscalls.master
cvs rdiff -u -r1.72 -r1.73 src/sys/compat/linux/arch/powerpc/syscalls.master
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/linux/common/linux_file.c
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/linux32/arch/amd64/syscalls.master
cvs rdiff -u -r1.41 -r1.42 src/sys/compat/linux32/common/linux32_unistd.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/arch

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 22:02:45 UTC 2019

Modified Files:
src/sys/compat/linux/arch: Makefile

Log Message:
don't descend to sparc and sparc64, they don't have syscalls.master
so it just errors out


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/arch/Makefile

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



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

2019-11-09 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sat Nov  9 22:02:45 UTC 2019

Modified Files:
src/sys/compat/linux/arch: Makefile

Log Message:
don't descend to sparc and sparc64, they don't have syscalls.master
so it just errors out


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/linux/arch/Makefile

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

Modified files:

Index: src/sys/compat/linux/arch/Makefile
diff -u src/sys/compat/linux/arch/Makefile:1.1 src/sys/compat/linux/arch/Makefile:1.2
--- src/sys/compat/linux/arch/Makefile:1.1	Mon Jan 16 00:11:42 2017
+++ src/sys/compat/linux/arch/Makefile	Sat Nov  9 22:02:45 2019
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2017/01/16 00:11:42 christos Exp $
+# $NetBSD: Makefile,v 1.2 2019/11/09 22:02:45 jdolecek Exp $
+
+# XXX sparc sparc64 exist but have no syscalls.master
+SUBDIR=alpha amd64 arm i386 m68k mips powerpc
 
-SUBDIR=alpha amd64 arm i386 m68k mips powerpc sparc sparc64
 
 .include 



CVS commit: src/sys/compat/netbsd32

2019-11-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov  7 15:21:56 UTC 2019

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

Log Message:
For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t.

Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64, where
NETBSD32_INT64_ALIGN is __attribute__((__aligned__(4))).


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

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



CVS commit: src/sys/compat/netbsd32

2019-11-07 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Nov  7 15:21:56 UTC 2019

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

Log Message:
For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t.

Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64, where
NETBSD32_INT64_ALIGN is __attribute__((__aligned__(4))).


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 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.127 src/sys/compat/netbsd32/netbsd32.h:1.128
--- src/sys/compat/netbsd32/netbsd32.h:1.127	Thu Oct  3 22:16:53 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Thu Nov  7 15:21:55 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.127 2019/10/03 22:16:53 kamil Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.128 2019/11/07 15:21:55 rin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -902,7 +902,7 @@ struct netbsd32_statvfs {
 	netbsd32_u_long	f_fsid;		/* Posix compatible fsid */
 	netbsd32_u_long	f_namemax;	/* maximum filename length */
 	uid_t		f_owner;	/* user that mounted the file system */
-	uint64_t	f_spare[4];	/* spare space */
+	netbsd32_uint64	f_spare[4];	/* spare space */
 	char	f_fstypename[_VFS_NAMELEN]; /* fs type name */
 	char	f_mntonname[_VFS_MNAMELEN];  /* directory on which mounted */
 	char	f_mntfromname[_VFS_MNAMELEN];  /* mounted file system */



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

2019-11-04 Thread Rin Okuyama

On 2019/11/04 20:20, Rin Okuyama wrote:

Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:20:22 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t.
Since bufsize is the last argument, this affects only LP64EB.

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


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


s/netbsd_size_t/netbsd32_size_t/ in the commit log.


CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:33:01 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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



CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:33:01 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.145 src/sys/compat/netbsd32/netbsd32_syscall.h:1.146
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.145	Mon Nov  4 11:21:36 2019
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Mon Nov  4 11:33:01 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.145 2019/11/04 11:21:36 rin Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.146 2019/11/04 11:33:01 rin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1274,7 +1274,7 @@
 /* syscall: "netbsd32_clock_getcpuclockid2" ret: "int" args: "idtype_t" "id_t" "netbsd32_clockidp_t" */
 #define	NETBSD32_SYS_netbsd32_clock_getcpuclockid2	482
 
-/* syscall: "netbsd32___getvfsstat90" ret: "int" args: "netbsd32_statvfsp_t" "size_t" "int" */
+/* syscall: "netbsd32___getvfsstat90" ret: "int" args: "netbsd32_statvfsp_t" "netbsd32_size_t" "int" */
 #define	NETBSD32_SYS_netbsd32___getvfsstat90	483
 
 /* syscall: "netbsd32___statvfs190" ret: "int" args: "netbsd32_charp" "netbsd32_statvfsp_t" "int" */
@@ -1283,7 +1283,7 @@
 /* syscall: "netbsd32___fstatvfs190" ret: "int" args: "int" "netbsd32_statvfsp_t" "int" */
 #define	NETBSD32_SYS_netbsd32___fstatvfs190	485
 
-/* syscall: "netbsd32___fhstatvfs190" ret: "int" args: "netbsd32_voidp" "size_t" "netbsd32_statvfsp_t" "int" */
+/* syscall: "netbsd32___fhstatvfs190" ret: "int" args: "netbsd32_voidp" "netbsd32_size_t" "netbsd32_statvfsp_t" "int" */
 #define	NETBSD32_SYS_netbsd32___fhstatvfs190	486
 
 #define	NETBSD32_SYS_MAXSYSCALL	487

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.145
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144	Mon Nov  4 11:21:36 2019
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Mon Nov  4 11:33:01 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.144 2019/11/04 11:21:36 rin Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.145 2019/11/04 11:33:01 rin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2624,7 +2624,7 @@ check_syscall_args(netbsd32_clock_getcpu
 
 struct netbsd32___getvfsstat90_args {
 	syscallarg(netbsd32_statvfsp_t) buf;
-	syscallarg(size_t) bufsize;
+	syscallarg(netbsd32_size_t) bufsize;
 	syscallarg(int) flags;
 };
 check_syscall_args(netbsd32___getvfsstat90)
@@ -2645,7 +2645,7 @@ check_syscall_args(netbsd32___fstatvfs19
 
 struct netbsd32___fhstatvfs190_args {
 	syscallarg(netbsd32_voidp) fhp;
-	syscallarg(size_t) fh_size;
+	syscallarg(netbsd32_size_t) fh_size;
 	syscallarg(netbsd32_statvfsp_t) buf;
 	syscallarg(int) flags;
 };
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.145
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144	Mon Nov  4 11:21:36 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Mon Nov  4 11:33:01 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
+ * created from	NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $");
 
 #if defined(_KERNEL_OPT)

CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:32:23 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
netbsd32_size_t should be used instead of size_t for argument of
32-bit syscalls:

- netbsd32___getvfsstat90: bufsize
- netbsd32___fhstatvfs190: fh_size

No need to pullup, since these syscalls were introduced after
branch of netbsd-9.


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

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

Modified files:

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.129 src/sys/compat/netbsd32/syscalls.master:1.130
--- src/sys/compat/netbsd32/syscalls.master:1.129	Mon Nov  4 11:20:22 2019
+++ src/sys/compat/netbsd32/syscalls.master	Mon Nov  4 11:32:22 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp $
+	$NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1169,11 +1169,11 @@
 			id_t id, netbsd32_clockidp_t clock_id); }
 483	STD 		{ int|netbsd32|90|getvfsstat( \
 			netbsd32_statvfsp_t buf, \
-			size_t bufsize, int flags); }
+			netbsd32_size_t bufsize, int flags); }
 484	STD 		{ int|netbsd32|90|statvfs1(netbsd32_charp path, \
 			netbsd32_statvfsp_t buf, int flags); }
 485	STD 		{ int|netbsd32|90|fstatvfs1(int fd, \
 			netbsd32_statvfsp_t buf, int flags); }
 486	STD 		{ int|netbsd32|90|fhstatvfs1(netbsd32_voidp fhp, \
-			size_t fh_size, netbsd32_statvfsp_t buf, \
+			netbsd32_size_t fh_size, netbsd32_statvfsp_t buf, \
 			int flags); }



CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:32:23 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
netbsd32_size_t should be used instead of size_t for argument of
32-bit syscalls:

- netbsd32___getvfsstat90: bufsize
- netbsd32___fhstatvfs190: fh_size

No need to pullup, since these syscalls were introduced after
branch of netbsd-9.


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

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



CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:21:36 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.144 src/sys/compat/netbsd32/netbsd32_syscall.h:1.145
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.144	Sun Oct 13 22:31:31 2019
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Mon Nov  4 11:21:36 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.144 2019/10/13 22:31:31 christos Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.145 2019/11/04 11:21:36 rin Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1228,7 +1228,7 @@
 /* syscall: "netbsd32_openat" ret: "int" args: "int" "const netbsd32_charp" "int" "..." */
 #define	NETBSD32_SYS_netbsd32_openat	468
 
-/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "size_t" */
+/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "netbsd32_size_t" */
 #define	NETBSD32_SYS_netbsd32_readlinkat	469
 
 /* syscall: "netbsd32_symlinkat" ret: "int" args: "const netbsd32_charp" "int" "const netbsd32_charp" */

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143	Sun Oct 13 22:31:31 2019
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Mon Nov  4 11:21:36 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.143 2019/10/13 22:31:31 christos Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.144 2019/11/04 11:21:36 rin Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2511,7 +2511,7 @@ struct netbsd32_readlinkat_args {
 	syscallarg(int) fd;
 	syscallarg(const netbsd32_charp) path;
 	syscallarg(netbsd32_charp) buf;
-	syscallarg(size_t) bufsize;
+	syscallarg(netbsd32_size_t) bufsize;
 };
 check_syscall_args(netbsd32_readlinkat)
 
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143	Sun Oct 13 22:31:32 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Mon Nov  4 11:21:36 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)

Index: src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23 src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.24
--- src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23	Sun Oct 13 22:31:32 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c	Mon Nov  4 11:21:36 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.24 2019/11/04 11:21:36 rin Exp $ */
 
 /*
  * System call autoload table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.128 

CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:21:36 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.23 -r1.24 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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



CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:20:22 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t.
Since bufsize is the last argument, this affects only LP64EB.

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


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

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



CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  4 11:20:22 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t.
Since bufsize is the last argument, this affects only LP64EB.

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


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

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

Modified files:

Index: src/sys/compat/netbsd32/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.128 src/sys/compat/netbsd32/syscalls.master:1.129
--- src/sys/compat/netbsd32/syscalls.master:1.128	Sun Sep 22 22:59:38 2019
+++ src/sys/compat/netbsd32/syscalls.master	Mon Nov  4 11:20:22 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp $
+	$NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -1120,7 +1120,7 @@
 469	STD  		{ netbsd32_ssize_t|netbsd32||readlinkat(int fd, \
 			const netbsd32_charp path, \
 			netbsd32_charp buf, \
-			size_t bufsize); }
+			netbsd32_size_t bufsize); }
 470	STD  		{ int|netbsd32||symlinkat(const netbsd32_charp path1, \
 			int fd, \
 			const netbsd32_charp path2); }



CVS commit: src/sys/compat/ossaudio

2019-11-02 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Nov  2 11:56:34 UTC 2019

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
It's kernel side of PR lib/54667.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/ossaudio/ossaudio.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/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.76 src/sys/compat/ossaudio/ossaudio.c:1.77
--- src/sys/compat/ossaudio/ossaudio.c:1.76	Thu Sep 26 01:37:52 2019
+++ src/sys/compat/ossaudio/ossaudio.c	Sat Nov  2 11:56:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.77 2019/11/02 11:56:34 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.77 2019/11/02 11:56:34 isaki Exp $");
 
 #include 
 #include 
@@ -238,7 +238,10 @@ oss_ioctl_audio(struct lwp *l, const str
 			 __func__, error));
 			goto out;
 		}
-		idat = tmpinfo.play.sample_rate;
+		if (tmpinfo.mode == AUMODE_RECORD)
+			idat = tmpinfo.record.sample_rate;
+		else
+			idat = tmpinfo.play.sample_rate;
 		DPRINTF(("%s: SNDCTL_PCM_READ_RATE < %d\n", __func__, idat));
 		error = copyout(, SCARG(uap, data), sizeof idat);
 		if (error) {



CVS commit: src/sys/compat/ossaudio

2019-11-02 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sat Nov  2 11:56:34 UTC 2019

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
Use record.sample_rate for recording on SNDCTL_DSP_SPEED.
It's kernel side of PR lib/54667.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/compat/ossaudio/ossaudio.c

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



CVS commit: src/sys/compat/common

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

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

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


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

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



CVS commit: src/sys/compat/common

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

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

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


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

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

Modified files:

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



CVS commit: src/sys/compat

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 11:34:48 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
use strlcpy() for the uts conversion, makes the code simpler and more readable.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/sunos32/sunos32_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

2019-10-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 26 11:34:48 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
use strlcpy() for the uts conversion, makes the code simpler and more readable.


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/sunos32/sunos32_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/sunos/sunos_misc.c
diff -u src/sys/compat/sunos/sunos_misc.c:1.175 src/sys/compat/sunos/sunos_misc.c:1.176
--- src/sys/compat/sunos/sunos_misc.c:1.175	Fri Oct  4 08:24:12 2019
+++ src/sys/compat/sunos/sunos_misc.c	Sat Oct 26 07:34:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $	*/
+/*	$NetBSD: sunos_misc.c,v 1.176 2019/10/26 11:34:48 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.176 2019/10/26 11:34:48 christos Exp $");
 
 #include 
 #include 
@@ -653,15 +653,13 @@ sunos_sys_uname(struct lwp *l, const str
 
 	memset(, 0, sizeof(sut));
 
-	memcpy(sut.sysname, ostype, sizeof(sut.sysname) - 1);
-	memcpy(sut.nodename, hostname, sizeof(sut.nodename));
-	sut.nodename[sizeof(sut.nodename)-1] = '\0';
-	memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-	sut.version[0] = '1';
-	memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
+	strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
+	strlcpy(sut.nodename, hostname, sizeof(sut.nodename));
+	strlcpy(sut.release, osrelease, sizeof(sut.release));
+	strlcpy(sut.version, "1", sizeof(sut.version));
+	strlcpy(sut.machine, machine, sizeof(sut.machine));
 
-	return copyout((void *), (void *)SCARG(uap, name),
-	sizeof(struct sunos_utsname));
+	return copyout(, SCARG(uap, name), sizeof(sut));
 }
 
 int

Index: src/sys/compat/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.82 src/sys/compat/sunos32/sunos32_misc.c:1.83
--- src/sys/compat/sunos32/sunos32_misc.c:1.82	Mon Sep 23 17:07:39 2019
+++ src/sys/compat/sunos32/sunos32_misc.c	Sat Oct 26 07:34:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $	*/
+/*	$NetBSD: sunos32_misc.c,v 1.83 2019/10/26 11:34:48 christos Exp $	*/
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp	*/
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.83 2019/10/26 11:34:48 christos Exp $");
 
 #define COMPAT_SUNOS 1
 
@@ -926,15 +926,13 @@ sunos32_sys_uname(struct lwp *l, const s
 
 	memset(, 0, sizeof(sut));
 
-	memcpy(sut.sysname, ostype, sizeof(sut.sysname) - 1);
-	memcpy(sut.nodename, hostname, sizeof(sut.nodename));
-	sut.nodename[sizeof(sut.nodename)-1] = '\0';
-	memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-	memcpy(sut.version, "1", sizeof(sut.version) - 1);
-	memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
+	strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
+	strlcpy(sut.nodename, hostname, sizeof(sut.nodename));
+	strlcpy(sut.release, osrelease, sizeof(sut.release));
+	strlcpy(sut.version, "1", sizeof(sut.version));
+	strlcpy(sut.machine, machine, sizeof(sut.machine));
 
-	return copyout((void *), SCARG_P32(uap, name),
-	sizeof(struct sunos_utsname));
+	return copyout(, SCARG_P32(uap, name), sizeof(sut));
 }
 
 int



CVS commit: src/sys/compat/netbsd32

2019-10-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 13 22:31:32 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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



CVS commit: src/sys/compat/netbsd32

2019-10-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 13 22:31:32 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.22 -r1.23 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.143 src/sys/compat/netbsd32/netbsd32_syscall.h:1.144
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.143	Sun Sep 22 19:03:20 2019
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Sun Oct 13 18:31:31 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.143 2019/09/22 23:03:20 christos Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.144 2019/10/13 22:31:31 christos Exp $ */
 
 /*
  * System call numbers.

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.142 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.142	Sun Sep 22 19:03:20 2019
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Sun Oct 13 18:31:31 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.142 2019/09/22 23:03:20 christos Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.143 2019/10/13 22:31:31 christos Exp $ */
 
 /*
  * System call argument lists.
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.142 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.142	Sun Sep 22 19:03:20 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Sun Oct 13 18:31:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.142 2019/09/22 23:03:20 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.142 2019/09/22 23:03:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)

Index: src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.22 src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23
--- src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.22	Sun Sep 22 19:03:20 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c	Sun Oct 13 18:31:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.22 2019/09/22 23:03:20 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $ */
 
 /*
  * System call autoload table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.22 2019/09/22 23:03:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"

Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.141 src/sys/compat/netbsd32/netbsd32_sysent.c:1.142
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.141	Sun Sep 22 19:03:20 2019
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Sun Oct 13 18:31:32 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.141 2019/09/22 23:03:20 christos Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.142 2019/10/13 22:31:32 christos Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.141 2019/09/22 23:03:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.142 2019/10/13 22:31:32 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1635,7 +1635,7 @@ struct sysent netbsd32_sysent[] = {
 		.sy_call = (sy_call_t *)netbsd32___getdents30
 	},		/* 390 = netbsd32___getdents30 */
 	{
-		.sy_call = (sy_call_t *)nullop,
+		.sy_call = (sy_call_t *)(void *)nullop,
 	},		/* 391 = filler */
 	{
 		ns(struct compat_30_netbsd32___fhstat30_args),

Index: src/sys/compat/netbsd32/netbsd32_systrace_args.c
diff -u src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.33 src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.34
--- src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.33	Sun Sep 22 19:03:20 2019

CVS commit: src/sys/compat/netbsd32

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 14:19:53 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c

Log Message:
Validate input before converting timeval::tv_usec in compat/netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_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/netbsd32

2019-10-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Oct  5 14:19:53 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c

Log Message:
Validate input before converting timeval::tv_usec in compat/netbsd32


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_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/netbsd32/netbsd32_compat_50.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.41
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40	Fri Sep 20 15:09:07 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Sat Oct  5 14:19:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -216,6 +216,10 @@ compat_50_netbsd32_settimeofday(struct l
 		return error;
 
 	netbsd32_to_timeval50(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }

Index: src/sys/compat/netbsd32/netbsd32_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.52 src/sys/compat/netbsd32/netbsd32_time.c:1.53
--- src/sys/compat/netbsd32/netbsd32_time.c:1.52	Thu Sep 26 01:30:00 2019
+++ src/sys/compat/netbsd32/netbsd32_time.c	Sat Oct  5 14:19:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $	*/
+/*	$NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -243,6 +243,10 @@ netbsd32___settimeofday50(struct lwp *l,
 		return error;
 
 	netbsd32_to_timeval(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }
@@ -546,4 +550,3 @@ netbsd32_clock_getcpuclockid2(struct lwp
 	}
 	return copyout(_id, SCARG_P32(uap, clock_id), sizeof(clock_id));
 }
-



CVS commit: src/sys/compat/sunos

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 12:24:12 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
replace memcpy() with src bounds overflow with single char write.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/compat/sunos/sunos_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/sunos/sunos_misc.c
diff -u src/sys/compat/sunos/sunos_misc.c:1.174 src/sys/compat/sunos/sunos_misc.c:1.175
--- src/sys/compat/sunos/sunos_misc.c:1.174	Mon Sep 23 21:07:50 2019
+++ src/sys/compat/sunos/sunos_misc.c	Fri Oct  4 12:24:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $	*/
+/*	$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.175 2019/10/04 12:24:12 mrg Exp $");
 
 #include 
 #include 
@@ -657,7 +657,7 @@ sunos_sys_uname(struct lwp *l, const str
 	memcpy(sut.nodename, hostname, sizeof(sut.nodename));
 	sut.nodename[sizeof(sut.nodename)-1] = '\0';
 	memcpy(sut.release, osrelease, sizeof(sut.release) - 1);
-	memcpy(sut.version, "1", sizeof(sut.version) - 1);
+	sut.version[0] = '1';
 	memcpy(sut.machine, machine, sizeof(sut.machine) - 1);
 
 	return copyout((void *), (void *)SCARG(uap, name),



CVS commit: src/sys/compat/sunos

2019-10-04 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Oct  4 12:24:12 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
replace memcpy() with src bounds overflow with single char write.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/compat/sunos/sunos_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/common

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

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

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


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

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



CVS commit: src/sys/compat/common

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

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

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


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

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

Modified files:

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



CVS commit: src/sys/compat/common

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

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

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


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

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



CVS commit: src/sys/compat/common

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

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

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


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

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

Modified files:

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



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 15:15:34 UTC 2019

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

Log Message:
fix sign-compare.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_drm.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_drm.c
diff -u src/sys/compat/netbsd32/netbsd32_drm.c:1.3 src/sys/compat/netbsd32/netbsd32_drm.c:1.4
--- src/sys/compat/netbsd32/netbsd32_drm.c:1.3	Tue Aug 20 10:26:05 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Sat Sep 28 11:15:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $ */
+/*	$NetBSD: netbsd32_drm.c,v 1.4 2019/09/28 15:15:34 christos Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.4 2019/09/28 15:15:34 christos Exp $");
 
 #include 
 #include 
@@ -345,7 +345,7 @@ compat_drm_getstats(struct file *file, v
 	if (error)
 		return error;
 
-	for (int i = 0; i < st64.count; ++i) {
+	for (size_t i = 0; i < st64.count; ++i) {
 		st32.data[i].value = st64.data[i].value;
 		st32.data[i].type = st64.data[i].type;
 	}



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Sep 28 15:15:34 UTC 2019

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

Log Message:
fix sign-compare.


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

2019-09-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Sep 28 08:21:08 UTC 2019

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

Log Message:
signed/unsigned comparison.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.52 src/sys/compat/netbsd32/netbsd32_socket.c:1.53
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.52	Fri Sep 27 08:17:11 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Sat Sep 28 08:21:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.53 2019/09/28 08:21:08 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.53 2019/09/28 08:21:08 mlelstv Exp $");
 
 #include 
 #include 
@@ -418,7 +418,7 @@ copyin32_msg_control(struct lwp *l, stru
 			size_t nclen;
 
 			nclen = cidx + cspace;
-			if (nclen >= PAGE_SIZE) {
+			if (nclen >= (size_t)PAGE_SIZE) {
 error = EINVAL;
 goto failure;
 			}



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Sep 28 08:21:08 UTC 2019

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

Log Message:
signed/unsigned comparison.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_socket.c

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



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:17:12 UTC 2019

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

Log Message:
Ensure failure if resid goes negative.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.51 src/sys/compat/netbsd32/netbsd32_socket.c:1.52
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.51	Fri Sep 27 08:12:01 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Fri Sep 27 08:17:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $");
 
 #include 
 #include 
@@ -403,7 +403,8 @@ copyin32_msg_control(struct lwp *l, stru
 		/*
 		 * Sanity check the control message length.
 		 */
-		if (cmsg32.cmsg_len > (size_t)resid ||
+		if (resid < 0 ||
+		cmsg32.cmsg_len > (size_t)resid ||
 		cmsg32.cmsg_len < sizeof(cmsg32)) {
 			error = EINVAL;
 			goto failure;



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:17:12 UTC 2019

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

Log Message:
Ensure failure if resid goes negative.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_socket.c

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



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:12:01 UTC 2019

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

Log Message:
signed/unsigned mismatch.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.50 src/sys/compat/netbsd32/netbsd32_socket.c:1.51
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.50	Thu Sep 26 01:32:09 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Fri Sep 27 08:12:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $");
 
 #include 
 #include 
@@ -403,7 +403,7 @@ copyin32_msg_control(struct lwp *l, stru
 		/*
 		 * Sanity check the control message length.
 		 */
-		if (cmsg32.cmsg_len > resid ||
+		if (cmsg32.cmsg_len > (size_t)resid ||
 		cmsg32.cmsg_len < sizeof(cmsg32)) {
 			error = EINVAL;
 			goto failure;



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:12:01 UTC 2019

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

Log Message:
signed/unsigned mismatch.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_socket.c

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



CVS commit: src/sys/compat/ossaudio

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

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
- "source" is u_long in the kernel (and int in userland). Cast -1 to u_long.
- make "s" unsigned since blocksize is too.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/ossaudio/ossaudio.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/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.75 src/sys/compat/ossaudio/ossaudio.c:1.76
--- src/sys/compat/ossaudio/ossaudio.c:1.75	Fri Aug 23 08:42:14 2019
+++ src/sys/compat/ossaudio/ossaudio.c	Wed Sep 25 21:37:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $");
 
 #include 
 #include 
@@ -1087,7 +1087,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
 		}
 		break;
 	case OSS_SOUND_MIXER_READ_RECSRC:
-		if (di->source == -1) {
+		if (di->source == (u_long)-1) {
 			DPRINTF(("%s: OSS_SOUND_MIXER_READ_RECSRC bad source\n",
 			__func__));
 			error = EINVAL;
@@ -1132,7 +1132,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
 		break;
 	case OSS_SOUND_MIXER_WRITE_RECSRC:
 	case OSS_SOUND_MIXER_WRITE_R_RECSRC:
-		if (di->source == -1) {
+		if (di->source == (u_long)-1) {
 			DPRINTF(("%s: OSS_SOUND_MIXER_WRITE_RECSRC bad "
 			"source\n", __func__));
 			error = EINVAL;
@@ -1492,11 +1492,11 @@ static void
 setblocksize(file_t *fp, struct audio_info *info)
 {
 	struct audio_info set;
-	int s;
+	u_int s;
 
-	 if (info->blocksize & (info->blocksize-1)) {
+	 if (info->blocksize & (info->blocksize - 1)) {
 		for(s = 32; s < info->blocksize; s <<= 1)
-			;
+			continue;
 		AUDIO_INITINFO();
 		set.blocksize = s;
 		fp->f_ops->fo_ioctl(fp, AUDIO_SETINFO, );



CVS commit: src/sys/compat/ossaudio

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

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
- "source" is u_long in the kernel (and int in userland). Cast -1 to u_long.
- make "s" unsigned since blocksize is too.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/ossaudio/ossaudio.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

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

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c netbsd32_rndpseudo_50.c
netbsd32_socket.c

Log Message:
use size_t for counters (which are compared and set with unsigneds)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_socket.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.84 src/sys/compat/netbsd32/netbsd32_fs.c:1.85
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.84	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.84 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.84 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $");
 
 #include 
 #include 
@@ -139,7 +139,8 @@ dofilereadv32(int fd, struct file *fp, s
 	struct iovec *iov;
 	struct iovec *needfree;
 	struct iovec aiov[UIO_SMALLIOV];
-	long i, cnt, error = 0;
+	long i, error = 0;
+	size_t cnt;
 	u_int iovlen;
 	struct iovec *ktriov = NULL;
 
@@ -243,7 +244,8 @@ dofilewritev32(int fd, struct file *fp, 
 	struct iovec *iov;
 	struct iovec *needfree;
 	struct iovec aiov[UIO_SMALLIOV];
-	long i, cnt, error = 0;
+	long i, error = 0;
+	size_t cnt;
 	u_int iovlen;
 	struct iovec *ktriov = NULL;
 

Index: src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
diff -u src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.4
--- src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3	Wed Jun 26 22:36:27 2019
+++ src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $	*/
+/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.4 2019/09/26 01:32:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.4 2019/09/26 01:32:09 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -79,7 +79,7 @@ compat32_50_rnd_ioctl(struct file *fp, u
 	{
 		rndstat_t rstbuf = {.start = 0};
 		rndstat50_32_t *rst50_32 = (rndstat50_32_t *)addr;
-		int count;
+		size_t count;
 
 		if (rst50_32->count > RND_MAXSTATCOUNT50)
 			return (EINVAL);

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.49 src/sys/compat/netbsd32/netbsd32_socket.c:1.50
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.49	Wed Nov 14 12:51:37 2018
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.49 2018/11/14 17:51:37 hannken Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.49 2018/11/14 17:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $");
 
 #include 
 #include 
@@ -74,11 +74,12 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_soc
 #define CMSG32_LEN(l)	(CMSG32_ALIGN(sizeof(struct cmsghdr)) + (l))
 
 static int
-copyout32_msg_control_mbuf(struct lwp *l, struct msghdr *mp, int *len,
+copyout32_msg_control_mbuf(struct lwp *l, struct msghdr *mp, u_int *len,
 struct mbuf *m, char **q, bool *truncated)
 {
 	struct cmsghdr *cmsg, cmsg32;
-	int i, j, error;
+	size_t i, j;
+	int error;
 
 	*truncated = false;
 	cmsg = mtod(m, struct cmsghdr *);



CVS commit: src/sys/compat/netbsd32

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

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c netbsd32_rndpseudo_50.c
netbsd32_socket.c

Log Message:
use size_t for counters (which are compared and set with unsigneds)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_socket.c

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



CVS commit: src/sys/compat/netbsd32

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

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

Log Message:
accrightslen should be u_int for compat too


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

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



CVS commit: src/sys/compat/netbsd32

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

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

Log Message:
accrightslen should be u_int for compat too


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 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.125 src/sys/compat/netbsd32/netbsd32.h:1.126
--- src/sys/compat/netbsd32/netbsd32.h:1.125	Wed Sep 25 17:40:42 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Wed Sep 25 21:30:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.125 2019/09/25 21:40:42 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.126 2019/09/26 01:30:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -738,7 +738,7 @@ struct netbsd32_omsghdr {
 	netbsd32_iovecp_t msg_iov;		/* scatter/gather array */
 	int		 msg_iovlen;		/* # elements in msg_iov */
 	netbsd32_caddr_t msg_accrights;		/* access rights sent/recvd */
-	int		 msg_accrightslen;
+	u_int		 msg_accrightslen;
 };
 
 typedef netbsd32_pointer_t netbsd32_mmsghdrp_t;



CVS commit: src/sys/compat/netbsd32

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

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

Log Message:
make the ?: expression types match


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

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

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

Log Message:
make the ?: expression types match


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_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/netbsd32/netbsd32_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.51 src/sys/compat/netbsd32/netbsd32_time.c:1.52
--- src/sys/compat/netbsd32/netbsd32_time.c:1.51	Sat Jan 26 21:08:40 2019
+++ src/sys/compat/netbsd32/netbsd32_time.c	Wed Sep 25 21:30:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_time.c,v 1.51 2019/01/27 02:08:40 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.51 2019/01/27 02:08:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -534,11 +534,11 @@ netbsd32_clock_getcpuclockid2(struct lwp
 
 	switch (SCARG(uap, idtype)) {
 	case P_PID:
-		pid = id == 0 ? l->l_proc->p_pid : id;
+		pid = id == 0 ? l->l_proc->p_pid : (pid_t)id;
 		clock_id = CLOCK_PROCESS_CPUTIME_ID | pid;
 		break;
 	case P_LWPID:
-		lid = id == 0 ? l->l_lid : id;
+		lid = id == 0 ? l->l_lid : (lwpid_t)id;
 		clock_id = CLOCK_THREAD_CPUTIME_ID | lid;
 		break;
 	default:



CVS commit: src/sys/compat/sys

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

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

Log Message:
accrightslen is always used in an unsigned context so make it.


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

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

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

Log Message:
accrightslen is always used in an unsigned context so make it.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 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.18 src/sys/compat/sys/socket.h:1.19
--- src/sys/compat/sys/socket.h:1.18	Thu Apr 11 00:42:08 2019
+++ src/sys/compat/sys/socket.h	Wed Sep 25 21:29:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: socket.h,v 1.18 2019/04/11 04:42:08 msaitoh Exp $	*/
+/*	$NetBSD: socket.h,v 1.19 2019/09/26 01:29:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994
@@ -67,7 +67,7 @@ struct omsghdr {
 	struct iovec	*msg_iov;	/* scatter/gather array */
 	int		msg_iovlen;	/* # elements in msg_iov */
 	void *		msg_accrights;	/* access rights sent/received */
-	int		msg_accrightslen;
+	u_int		msg_accrightslen;
 };
 
 /*



CVS commit: src/sys/compat/common

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

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

Log Message:
fix sign-compare issues.


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

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

Modified files:

Index: src/sys/compat/common/if_media_80.c
diff -u src/sys/compat/common/if_media_80.c:1.1 src/sys/compat/common/if_media_80.c:1.2
--- src/sys/compat/common/if_media_80.c:1.1	Fri May 17 03:37:11 2019
+++ src/sys/compat/common/if_media_80.c	Wed Sep 25 21:28:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media_80.c,v 1.1 2019/05/17 07:37:11 msaitoh Exp $	*/
+/*	$NetBSD: if_media_80.c,v 1.2 2019/09/26 01:28:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -126,8 +126,8 @@ compat_ifmediareq_post(struct ifreq *ifr
 {
 	struct ifmediareq *ifmr = (struct ifmediareq *)ifr;
 	size_t minwords;
-	int count, *kptr;
-	int error;
+	size_t count;
+	int error, *kptr;
 
 	switch (cmd) {
 	case SIOCSIFMEDIA:

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

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



CVS commit: src/sys/compat/common

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

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

Log Message:
fix sign-compare issues.


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

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



CVS commit: src/sys/compat/netbsd32

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 25 21:40:43 UTC 2019

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

Log Message:
avoid signed-compare warning; use uintmax_t to print.


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

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



CVS commit: src/sys/compat/netbsd32

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 25 21:40:43 UTC 2019

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

Log Message:
avoid signed-compare warning; use uintmax_t to print.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 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.124 src/sys/compat/netbsd32/netbsd32.h:1.125
--- src/sys/compat/netbsd32/netbsd32.h:1.124	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Wed Sep 25 17:40:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.124 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.125 2019/09/25 21:40:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -128,9 +128,9 @@ static __inline NETBSD32_POINTER_TYPE
 netbsd32_ptr32i(const void *p64)
 {
 	uintptr_t u64 = (uintptr_t)p64;
-	KASSERTMSG(u64 == (NETBSD32_POINTER_TYPE)u64, "u64 %llx != %llx",
-		   (unsigned long long)u64,
-		   (unsigned long long)(NETBSD32_POINTER_TYPE)u64);
+	KASSERTMSG(u64 == (uintptr_t)(NETBSD32_POINTER_TYPE)u64,
+	"u64 %jx != %jx", (uintmax_t)u64,
+	   (uintmax_t)(NETBSD32_POINTER_TYPE)u64);
 	return u64;
 }
 



CVS commit: src/sys/compat/sunos32

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:39 UTC 2019

Modified Files:
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos32/sunos32_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/sunos32/sunos32_misc.c
diff -u src/sys/compat/sunos32/sunos32_misc.c:1.81 src/sys/compat/sunos32/sunos32_misc.c:1.82
--- src/sys/compat/sunos32/sunos32_misc.c:1.81	Tue Sep 17 11:19:27 2019
+++ src/sys/compat/sunos32/sunos32_misc.c	Mon Sep 23 17:07:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $	*/
+/*	$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $	*/
 /* from :NetBSD: sunos_misc.c,v 1.107 2000/12/01 19:25:10 jdolecek Exp	*/
 
 /*
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.81 2019/09/17 15:19:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos32_misc.c,v 1.82 2019/09/23 21:07:39 christos Exp $");
 
 #define COMPAT_SUNOS 1
 
@@ -838,7 +838,7 @@ sunos32_sys_setsockopt(struct lwp *l, co
 			name = ipoptxlat[name - SUNOS_IP_MULTICAST_IF];
 		}
 	}
-	if (SCARG(uap, valsize) > MLEN) {
+	if ((unsigned)SCARG(uap, valsize) > MLEN) {
 		error = EINVAL;
 		goto out;
 	}
@@ -1081,25 +1081,15 @@ sunos32_sys_statfs(struct lwp *l, const 
 		syscallarg(const netbsd32_charp) path;
 		syscallarg(sunos32_statfsp_t) buf;
 	} */
-	struct mount *mp;
 	struct statvfs *sp;
 	int error;
-	struct vnode *vp;
-	struct sys_statvfs1_args ua;
-
-	SUNOS32TOP_UAP(path, const char);
 
-	error = namei_simple_user(SCARG(, path),
-NSM_FOLLOW_TRYEMULROOT, );
-	if (error != 0)
-		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 sunstatfs(sp, SCARG_P32(uap, buf));
+	sp = STATVFSBUF_GET();
+	error = do_sys_pstatvfs(l, SCARG_P32(uap, path), 0, sp);
+	if (error == 0)
+		error = sunstatfs(sp, SCARG_P32(uap, buf));
+	STATVFSBUF_PUT(sp);
+	return error;
 }
 
 int
@@ -1109,23 +1099,15 @@ sunos32_sys_fstatfs(struct lwp *l, const
 		syscallarg(int) fd;
 		syscallarg(sunos32_statfsp_t) buf;
 	} */
-	file_t *fp;
-	struct mount *mp;
 	struct statvfs *sp;
 	int error;
 
-	/* fd_getvnode() will use the descriptor for us */
-	if ((error = fd_getvnode(SCARG(uap, fd), )) != 0)
-		return (error);
-	mp = fp->f_vnode->v_mount;
-	sp = >mnt_stat;
-	if ((error = VFS_STATVFS(mp, sp)) != 0)
-		goto out;
-	sp->f_flag = mp->mnt_flag & MNT_VISFLAGMASK;
-	error = sunstatfs(sp, SCARG_P32(uap, buf));
- out:
- 	fd_putfile(SCARG(uap, fd));
-	return (error);
+	sp = STATVFSBUF_GET();
+	error = do_sys_fstatvfs(l, SCARG(uap, fd), 0, sp);
+	if (error == 0)
+		error = sunstatfs(sp, SCARG_P32(uap, buf));
+	STATVFSBUF_PUT(sp);
+	return error;
 }
 
 int
@@ -1258,7 +1240,7 @@ static const int sreq2breq[] = {
 	PT_KILL,-1, PT_ATTACH,  PT_DETACH,
 	PT_GETREGS, PT_SETREGS, PT_GETFPREGS,   PT_SETFPREGS
 };
-static const int nreqs = sizeof(sreq2breq) / sizeof(sreq2breq[0]);
+static const size_t nreqs = __arraycount(sreq2breq);
 
 int
 sunos32_sys_ptrace(struct lwp *l, const struct sunos32_sys_ptrace_args *uap, register_t *retval)



CVS commit: src/sys/compat/sunos32

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:39 UTC 2019

Modified Files:
src/sys/compat/sunos32: sunos32_misc.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos32/sunos32_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/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:50 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/compat/sunos/sunos_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/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 21:07:50 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_misc.c

Log Message:
make this compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/compat/sunos/sunos_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/sunos/sunos_misc.c
diff -u src/sys/compat/sunos/sunos_misc.c:1.173 src/sys/compat/sunos/sunos_misc.c:1.174
--- src/sys/compat/sunos/sunos_misc.c:1.173	Wed Jul  3 14:24:50 2019
+++ src/sys/compat/sunos/sunos_misc.c	Mon Sep 23 17:07:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $	*/
+/*	$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.173 2019/07/03 18:24:50 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_misc.c,v 1.174 2019/09/23 21:07:50 christos Exp $");
 
 #include 
 #include 
@@ -277,8 +277,12 @@ sunos_sys_mount(struct lwp *l, const str
 		}
 		na.timeo = sna.timeo;
 		na.retrans = sna.retrans;
-		na.hostname = /* (char *)(u_long) */ sna.hostname;
-
+#ifdef __arch64__
+		/* XXX */
+		na.hostname = (char *)(intptr_t)sna.hostname;
+#else
+		na.hostname = sna.hostname;
+#endif
 		return do_sys_mount(l, "nfs", UIO_SYSSPACE,
 		SCARG(uap, dir), nflags, ,
 		UIO_SYSSPACE, sizeof na, );
@@ -565,7 +569,7 @@ sunos_sys_setsockopt(struct lwp *l, cons
 			name = ipoptxlat[name - SUNOS_IP_MULTICAST_IF];
 		}
 	}
-	if (SCARG(uap, valsize) > MLEN) {
+	if ((unsigned)SCARG(uap, valsize) > MLEN) {
 		error = EINVAL;
 		goto out;
 	}



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:42:29 UTC 2019

Modified Files:
src/sys/compat/sunos: syscalls.master

Log Message:
Treat valsize as unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos/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/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:42:29 UTC 2019

Modified Files:
src/sys/compat/sunos: syscalls.master

Log Message:
Treat valsize as unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/compat/sunos/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/sunos/syscalls.master
diff -u src/sys/compat/sunos/syscalls.master:1.81 src/sys/compat/sunos/syscalls.master:1.82
--- src/sys/compat/sunos/syscalls.master:1.81	Sat Jan 26 21:08:40 2019
+++ src/sys/compat/sunos/syscalls.master	Mon Sep 23 16:42:29 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.81 2019/01/27 02:08:40 pgoyette Exp $
+	$NetBSD: syscalls.master,v 1.82 2019/09/23 20:42:29 christos Exp $
 
 ;	@(#)syscalls.master	8.1 (Berkeley) 7/19/93
 
@@ -178,7 +178,7 @@
 103	UNIMPL		old socketaddr
 104	NOARGS		{ int|sys||bind(int s, void *name, int namelen); }
 105	STD		{ int|sunos_sys||setsockopt(int s, int level, int name, \
-			void *val, int valsize); }
+			void *val, u_int valsize); }
 106	NOARGS		{ int|sys||listen(int s, int backlog); }
 107	UNIMPL		vtimes
 108	STD		{ int|sunos_sys||sigvec(int signum, struct sigvec *nsv, \



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:38:27 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_ioctl.c

Log Message:
Add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/sunos/sunos_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/sunos/sunos_ioctl.c
diff -u src/sys/compat/sunos/sunos_ioctl.c:1.69 src/sys/compat/sunos/sunos_ioctl.c:1.70
--- src/sys/compat/sunos/sunos_ioctl.c:1.69	Tue Apr 23 03:45:06 2019
+++ src/sys/compat/sunos/sunos_ioctl.c	Mon Sep 23 16:38:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $	*/
+/*	$NetBSD: sunos_ioctl.c,v 1.70 2019/09/23 20:38:27 christos Exp $	*/
 
 /*
  * Copyright (c) 1993 Markus Wild.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.69 2019/04/23 07:45:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_ioctl.c,v 1.70 2019/09/23 20:38:27 christos Exp $");
 
 #include 
 #include 
@@ -439,6 +439,7 @@ sunos_sys_ioctl(struct lwp *l, const str
 		}
 
 		error = (*ctl)(fp, TIOCSETD, );
+		break;
 	}
 	case _IOW('t', 101, int):	/* sun SUNOS_TIOCSSOFTCAR */
 	{



CVS commit: src/sys/compat/sunos

2019-09-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Sep 23 20:38:27 UTC 2019

Modified Files:
src/sys/compat/sunos: sunos_ioctl.c

Log Message:
Add missing break


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/compat/sunos/sunos_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/common

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

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

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


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

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

Modified files:

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



CVS commit: src/sys/compat/common

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

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

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


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

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



CVS commit: src/sys/compat/sys

2019-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 22 23:18:53 UTC 2019

Added Files:
src/sys/compat/sys: statvfs.h

Log Message:
new files for statvfs90


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/statvfs.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/sys

2019-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 22 23:18:53 UTC 2019

Added Files:
src/sys/compat/sys: statvfs.h

Log Message:
new files for statvfs90


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/compat/sys/statvfs.h

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

Added files:

Index: src/sys/compat/sys/statvfs.h
diff -u /dev/null src/sys/compat/sys/statvfs.h:1.1
--- /dev/null	Sun Sep 22 19:18:53 2019
+++ src/sys/compat/sys/statvfs.h	Sun Sep 22 19:18:53 2019
@@ -0,0 +1,161 @@
+/*	$NetBSD: statvfs.h,v 1.1 2019/09/22 23:18:53 christos Exp $	 */
+
+/*-
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef	_COMPAT_SYS_STATVFS_H_
+#define	_COMPAT_SYS_STATVFS_H_
+
+#include 
+
+struct statvfs90 {
+	unsigned long	f_flag;		/* copy of mount exported flags */
+	unsigned long	f_bsize;	/* file system block size */
+	unsigned long	f_frsize;	/* fundamental file system block size */
+	unsigned long	f_iosize;	/* optimal file system block size */
+
+	/* The following are in units of f_frsize */
+	fsblkcnt_t	f_blocks;	/* number of blocks in file system, */
+	fsblkcnt_t	f_bfree;	/* free blocks avail in file system */
+	fsblkcnt_t	f_bavail;	/* free blocks avail to non-root */
+	fsblkcnt_t	f_bresvd;	/* blocks reserved for root */
+
+	fsfilcnt_t	f_files;	/* total file nodes in file system */
+	fsfilcnt_t	f_ffree;	/* free file nodes in file system */
+	fsfilcnt_t	f_favail;	/* free file nodes avail to non-root */
+	fsfilcnt_t	f_fresvd;	/* file nodes reserved for root */
+
+	uint64_t  	f_syncreads;	/* count of sync reads since mount */
+	uint64_t  	f_syncwrites;	/* count of sync writes since mount */
+
+	uint64_t  	f_asyncreads;	/* count of async reads since mount */
+	uint64_t  	f_asyncwrites;	/* count of async writes since mount */
+
+	fsid_t		f_fsidx;	/* NetBSD compatible fsid */
+	unsigned long	f_fsid;		/* Posix compatible fsid */
+	unsigned long	f_namemax;	/* maximum filename length */
+	uid_t		f_owner;	/* user that mounted the file system */
+
+	uint32_t	f_spare[4];	/* spare space */
+
+	char	f_fstypename[_VFS_NAMELEN]; /* fs type name */
+	char	f_mntonname[_VFS_MNAMELEN];  /* directory on which mounted */
+	char	f_mntfromname[_VFS_MNAMELEN];  /* mounted file system */
+};
+
+__BEGIN_DECLS
+#ifndef _KERNEL
+#include 
+#endif
+
+static __inline void
+statvfs_to_statvfs90(const struct statvfs *s, struct statvfs90 *s90)
+{
+	s90->f_flag = s->f_flag;
+	s90->f_bsize = s->f_bsize;
+	s90->f_frsize = s->f_frsize;
+	s90->f_iosize = s->f_iosize;
+
+	s90->f_blocks = s->f_blocks;
+	s90->f_bfree = s->f_bfree;
+	s90->f_bavail = s->f_bavail;
+	s90->f_bresvd = s->f_bresvd;
+
+	s90->f_files = s->f_files;
+	s90->f_ffree = s->f_ffree;
+	s90->f_favail = s->f_favail;
+	s90->f_fresvd = s->f_fresvd;
+
+	s90->f_syncreads = s->f_syncreads;
+	s90->f_syncwrites = s->f_syncwrites;
+
+	s90->f_asyncreads = s->f_asyncreads;
+	s90->f_asyncwrites = s->f_asyncwrites;
+
+	s90->f_fsidx = s->f_fsidx;
+	s90->f_fsid = s->f_fsid;
+	s90->f_namemax = s->f_namemax;
+	s90->f_owner = s->f_owner;
+
+	memcpy(s90->f_fstypename, s->f_fstypename, sizeof(s90->f_fstypename));
+	memcpy(s90->f_mntonname, s->f_mntonname, sizeof(s90->f_mntonname));
+	memcpy(s90->f_mntfromname, s->f_mntfromname, sizeof(s90->f_mntfromname));
+}
+
+#ifdef _KERNEL
+static __inline int
+statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l)
+{
+	struct statvfs90 *s90 = STATVFSBUF_GET();
+	int error;
+
+	statvfs_to_statvfs90(vs, s90);

CVS commit: src/sys/compat/netbsd32

2019-09-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Sep 21 06:56:51 UTC 2019

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

Log Message:
Fix netbsd32___mount50():

 - zero out fs_args32 to prevent info leaks
 - remove unused and non-functional copyin in NFS (lgtm bot)
 - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
 - make sure data_len is just big enough, to mimic the native behavior
 - don't forget to update *retval with the 32bit value
 - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/netbsd32/netbsd32_fs.c

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.82 src/sys/compat/netbsd32/netbsd32_fs.c:1.83
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.82	Wed Dec 26 08:01:40 2018
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Sep 21 06:56:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.83 2019/09/21 06:56:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.83 2019/09/21 06:56:51 maxv Exp $");
 
 #include 
 #include 
@@ -809,17 +809,21 @@ netbsd32___mount50(struct lwp *l, const 
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
 	int flags = SCARG(uap, flags);
-	void *data = SCARG_P32(uap, data);
+	void *data, *udata;
 	size_t data_len = SCARG(uap, data_len);
 	enum uio_seg data_seg;
 	size_t len;
 	int error;
  
+	udata = data = SCARG_P32(uap, data);
+	memset(_args32, 0, sizeof(fs_args32));
+
 	error = copyinstr(type, mtype, sizeof(mtype), );
 	if (error)
 		return error;
+
 	if (strcmp(mtype, MOUNT_TMPFS) == 0) {
-		if (data_len != sizeof(fs_args32.tmpfs_args))
+		if (data_len < sizeof(fs_args32.tmpfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.tmpfs_args, 
@@ -843,7 +847,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.tmpfs_args;
 		data_len = sizeof(fs_args.tmpfs_args);
 	} else if (strcmp(mtype, MOUNT_MFS) == 0) {
-		if (data_len != sizeof(fs_args32.mfs_args))
+		if (data_len < sizeof(fs_args32.mfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.mfs_args, 
@@ -864,7 +868,7 @@ netbsd32___mount50(struct lwp *l, const 
 	} else if ((strcmp(mtype, MOUNT_UFS) == 0) ||
 		   (strcmp(mtype, MOUNT_EXT2FS) == 0) ||
 		   (strcmp(mtype, MOUNT_LFS) == 0)) {
-		if (data_len > sizeof(fs_args32.ufs_args))
+		if (data_len < sizeof(fs_args32.ufs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.ufs_args, 
@@ -878,7 +882,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.ufs_args;
 		data_len = sizeof(fs_args.ufs_args);
 	} else if (strcmp(mtype, MOUNT_CD9660) == 0) {
-		if (data_len != sizeof(fs_args32.iso_args))
+		if (data_len < sizeof(fs_args32.iso_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.iso_args, 
@@ -895,7 +899,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.iso_args;
 		data_len = sizeof(fs_args.iso_args);
 	} else if (strcmp(mtype, MOUNT_MSDOS) == 0) {
-		if (data_len != sizeof(fs_args32.msdosfs_args))
+		if (data_len < sizeof(fs_args32.msdosfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.msdosfs_args, 
@@ -925,8 +929,9 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.msdosfs_args;
 		data_len = sizeof(fs_args.msdosfs_args);
 	} else if (strcmp(mtype, MOUNT_NFS) == 0) {
-		if (data_len != sizeof(fs_args32.nfs_args))
+		if (data_len < sizeof(fs_args32.nfs_args))
 			return EINVAL;
+		/* XXX: NFS requires copyin even with MNT_GETARGS */
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.nfs_args, 
 			sizeof(fs_args32.nfs_args));
@@ -952,7 +957,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
 	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
-		if (data_len > sizeof(fs_args32.null_args))
+		if (data_len < sizeof(fs_args32.null_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.null_args, 
@@ -968,10 +973,12 @@ netbsd32___mount50(struct lwp *l, const 
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
+
 	error = do_sys_mount(l, mtype, UIO_SYSSPACE, path, flags, data, data_seg,
 	data_len, retval);
 	if (error)
 		return error;
+
 	if (flags & MNT_GETARGS) {
 		data_len = *retval;
 		if (strcmp(mtype, MOUNT_TMPFS) == 0) {
@@ -989,8 +996,9 @@ netbsd32___mount50(struct lwp *l, const 
 			fs_args.tmpfs_args.ta_root_gid;
 			

CVS commit: src/sys/compat/netbsd32

2019-09-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Sep 21 06:56:51 UTC 2019

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

Log Message:
Fix netbsd32___mount50():

 - zero out fs_args32 to prevent info leaks
 - remove unused and non-functional copyin in NFS (lgtm bot)
 - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
 - make sure data_len is just big enough, to mimic the native behavior
 - don't forget to update *retval with the 32bit value
 - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/compat/netbsd32/netbsd32_fs.c

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



CVS commit: src/sys/compat

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

Modified Files:
src/sys/compat/linux/common: linux_misc.c
src/sys/compat/linux32/common: linux32_unistd.c

Log Message:
Avoid signed integer overflow when convering linux timeval to timespec

Linux accepts garbage as timeout and attempts to set it to something
meaningful. Instead of checking for valid ranges of usec, just convert
the type safely, regardless of what is inside it.


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/linux32/common/linux32_unistd.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

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

Modified Files:
src/sys/compat/linux/common: linux_misc.c
src/sys/compat/linux32/common: linux32_unistd.c

Log Message:
Avoid signed integer overflow when convering linux timeval to timespec

Linux accepts garbage as timeout and attempts to set it to something
meaningful. Instead of checking for valid ranges of usec, just convert
the type safely, regardless of what is inside it.


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.40 -r1.41 src/sys/compat/linux32/common/linux32_unistd.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_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.244 src/sys/compat/linux/common/linux_misc.c:1.245
--- src/sys/compat/linux/common/linux_misc.c:1.244	Sat Aug 24 14:21:13 2019
+++ src/sys/compat/linux/common/linux_misc.c	Fri Sep 20 15:25:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_misc.c,v 1.244 2019/08/24 14:21:13 maxv Exp $	*/
+/*	$NetBSD: linux_misc.c,v 1.245 2019/09/20 15:25:19 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.244 2019/08/24 14:21:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.245 2019/09/20 15:25:19 kamil Exp $");
 
 #include 
 #include 
@@ -875,7 +875,7 @@ linux_select1(struct lwp *l, register_t 
 		if ((error = copyin(timeout, , sizeof(ltv
 			return error;
 		uts.tv_sec = ltv.tv_sec;
-		uts.tv_nsec = ltv.tv_usec * 1000;
+		uts.tv_nsec = (long)((unsigned long)ltv.tv_usec * 1000);
 		if (itimespecfix()) {
 			/*
 			 * The timeval was invalid.  Convert it to something

Index: src/sys/compat/linux32/common/linux32_unistd.c
diff -u src/sys/compat/linux32/common/linux32_unistd.c:1.40 src/sys/compat/linux32/common/linux32_unistd.c:1.41
--- src/sys/compat/linux32/common/linux32_unistd.c:1.40	Tue Dec 26 08:30:58 2017
+++ src/sys/compat/linux32/common/linux32_unistd.c	Fri Sep 20 15:25:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_unistd.c,v 1.40 2017/12/26 08:30:58 kamil Exp $ */
+/*	$NetBSD: linux32_unistd.c,v 1.41 2019/09/20 15:25:19 kamil Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.40 2017/12/26 08:30:58 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.41 2019/09/20 15:25:19 kamil Exp $");
 
 #include 
 #include 
@@ -165,7 +165,7 @@ linux32_select1(struct lwp *l, register_
 			return error;
 
 		uts.tv_sec = utv32.tv_sec;
-		uts.tv_nsec = utv32.tv_usec * 1000;
+		uts.tv_nsec = (long)((unsigned long)utv32.tv_usec * 1000);
 
 		if (itimespecfix()) {
 			/*



CVS commit: src/sys/compat/netbsd32

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

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

Log Message:
Validate usec ranges in netbsd32___select50()

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


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_select.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_select.c
diff -u src/sys/compat/netbsd32/netbsd32_select.c:1.19 src/sys/compat/netbsd32/netbsd32_select.c:1.20
--- src/sys/compat/netbsd32/netbsd32_select.c:1.19	Fri Apr 23 15:19:20 2010
+++ src/sys/compat/netbsd32/netbsd32_select.c	Fri Sep 20 15:16:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_select.c,v 1.19 2010/04/23 15:19:20 rmind Exp $	*/
+/*	$NetBSD: netbsd32_select.c,v 1.20 2019/09/20 15:16:41 kamil Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.19 2010/04/23 15:19:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.20 2019/09/20 15:16:41 kamil Exp $");
 
 #include 
 #include 
@@ -68,6 +68,10 @@ netbsd32___select50(struct lwp *l,
 		error = copyin(SCARG_P32(uap, tv), , sizeof(tv32));
 		if (error != 0)
 			return error;
+
+		if (tv32.tv_usec < 0 || tv32.tv_usec >= 100)
+			return EINVAL;
+
 		ats.tv_sec = tv32.tv_sec;
 		ats.tv_nsec = tv32.tv_usec * 1000;
 		ts = 



CVS commit: src/sys/compat/netbsd32

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

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

Log Message:
Validate usec ranges in netbsd32___select50()

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


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

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



  1   2   3   4   >