Re: CVS commit: src/sys/compat/netbsd32
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
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
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
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
> 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
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
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
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
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
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/netbsd32
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/netbsd32
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
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
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
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
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
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
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
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
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
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
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
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/netbsd32
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
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
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
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
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
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
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
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
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
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
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/netbsd32
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
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
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
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/netbsd32
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
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
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
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
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
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
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
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/netbsd32
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
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
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
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
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
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/netbsd32
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
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/netbsd32
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
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/netbsd32
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
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.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: kamil Date: Fri Sep 20 15:09:07 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c Log Message: Validate usec ranges in compat_50_netbsd32_select() Later in the code selcommon() checks for proper timespec, check only correct usec of timeval before type conversions. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/compat/netbsd32/netbsd32_compat_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/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.39 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.39 Thu Jun 27 02:36:27 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Fri Sep 20 15:09:07 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 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.39 2019/06/27 02:36:27 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -140,6 +140,10 @@ compat_50_netbsd32_select(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
Module Name:src Committed By: kamil Date: Fri Sep 20 15:09:07 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c Log Message: Validate usec ranges in compat_50_netbsd32_select() Later in the code selcommon() checks for proper timespec, check only correct usec of timeval before type conversions. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/compat/netbsd32/netbsd32_compat_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/netbsd32
Module Name:src Committed By: christos Date: Sun Sep 15 20:26:52 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_execve.c Log Message: fix fexecve To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/compat/netbsd32/netbsd32_execve.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
Module Name:src Committed By: christos Date: Sun Sep 15 20:26:52 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_execve.c Log Message: fix fexecve To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/compat/netbsd32/netbsd32_execve.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_execve.c diff -u src/sys/compat/netbsd32/netbsd32_execve.c:1.39 src/sys/compat/netbsd32/netbsd32_execve.c:1.40 --- src/sys/compat/netbsd32/netbsd32_execve.c:1.39 Mon Sep 3 12:29:29 2018 +++ src/sys/compat/netbsd32/netbsd32_execve.c Sun Sep 15 16:26:51 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_execve.c,v 1.39 2018/09/03 16:29:29 riastradh Exp $ */ +/* $NetBSD: netbsd32_execve.c,v 1.40 2019/09/15 20:26:51 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.39 2018/09/03 16:29:29 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.40 2019/09/15 20:26:51 christos Exp $"); #include #include @@ -71,9 +71,8 @@ netbsd32_execve(struct lwp *l, const str syscallarg(netbsd32_charpp) argp; syscallarg(netbsd32_charpp) envp; } */ - const char *path = SCARG_P32(uap, path); - return execve1(l, path, SCARG_P32(uap, argp), + return execve1(l, SCARG_P32(uap, path), -1, SCARG_P32(uap, argp), SCARG_P32(uap, envp), netbsd32_execve_fetch_element); } @@ -86,13 +85,9 @@ netbsd32_fexecve(struct lwp *l, const st syscallarg(netbsd32_charpp) argp; syscallarg(netbsd32_charpp) envp; } */ - struct sys_fexecve_args ua; - NETBSD32TO64_UAP(fd); - NETBSD32TOP_UAP(argp, char * const); - NETBSD32TOP_UAP(envp, char * const); - - return sys_fexecve(l, , retval); + return execve1(l, NULL, SCARG(uap, fd), SCARG_P32(uap, argp), + SCARG_P32(uap, envp), netbsd32_execve_fetch_element); } static int
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: maxv Date: Fri Aug 23 13:59:45 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_43.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_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/netbsd32/netbsd32_compat_43.c diff -u src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57 src/sys/compat/netbsd32/netbsd32_compat_43.c:1.58 --- src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57 Sun Jan 27 02:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_43.c Fri Aug 23 13:59:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_43.h" @@ -77,6 +77,7 @@ static void netbsd32_from_stat(const struct stat *sb, struct netbsd32_stat43 *sp32) { + memset(sp32, 0, sizeof(*sp32)); sp32->st_dev = sb->st_dev; sp32->st_ino = sb->st_ino; sp32->st_mode = sb->st_mode;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: maxv Date: Fri Aug 23 13:59:45 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_43.c Log Message: Fix info leak. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_43.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/compat/netbsd32
Thanks for the quick review! The errors below should be all fixed. christos > On Aug 20, 2019, at 3:18 PM, Maxime Villard wrote: > > 1) In compat_drm_agp_info(), seems like it should be info64to32. > > 2) In compat_drm_getstats(), the assignments in the loop are inverted, it's > st32 which should be set to the values of st64, not the other way around. > > 3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?). > > 4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in > this function it seems.
Re: CVS commit: src/sys/compat/netbsd32
Le 20/08/2019 à 11:32, Christos Zoulas a écrit : Module Name:src Committed By: christos Date: Tue Aug 20 09:32:21 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c netbsd32_ioctl.h Added Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: compat32 drm ioctl support from Surya Shankar at GSoC 2019 To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.67 -r1.68 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. Pieces of code like this one which touch kernel entry points should go through proper reviewing because they can cause immense trouble. They should not be committed and enabled by default blindly like you just did. Here are my remarks: 1) In compat_drm_agp_info(), seems like it should be info64to32. 2) In compat_drm_getstats(), the assignments in the loop are inverted, it's st32 which should be set to the values of st64, not the other way around. 3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?). 4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in this function it seems. Etc, that's just after a quick glance. I will disable this code until it receives proper review.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Aug 20 14:26:06 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: >From maxv@: 1) In compat_drm_agp_info(), seems like it should be info64to32. 2) In compat_drm_getstats(), the assignments in the loop are inverted, it's st32 which should be set to the values of st64, not the other way around. 3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?). 4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in this function it seems. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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
Module Name:src Committed By: christos Date: Tue Aug 20 14:26:06 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: >From maxv@: 1) In compat_drm_agp_info(), seems like it should be info64to32. 2) In compat_drm_getstats(), the assignments in the loop are inverted, it's st32 which should be set to the values of st64, not the other way around. 3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?). 4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in this function it seems. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/compat/netbsd32/netbsd32_drm.c:1.3 --- src/sys/compat/netbsd32/netbsd32_drm.c:1.2 Tue Aug 20 05:55:49 2019 +++ src/sys/compat/netbsd32/netbsd32_drm.c Tue Aug 20 10:26:05 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */ +/* $NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $ */ /* * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $"); #include #include @@ -338,16 +338,18 @@ compat_drm_getstats(struct file *file, v return error; st64.count = st32.count; + if (st64.count > __arraycount(st64.data)) + return EINVAL; error = drm_ioctl(file, DRM_IOCTL_GET_STATS, ); if (error) return error; - // XXX: or does that need to be count? - for (int i = 0; i < __arraycount(st64.data); ++i) { - st64.data[i].value = st32.data[i].value; - st64.data[i].type = st32.data[i].type; + for (int i = 0; i < st64.count; ++i) { + st32.data[i].value = st64.data[i].value; + st32.data[i].type = st64.data[i].type; } + st32.count = st64.count; return copyout(arg, , sizeof(s32)); } @@ -565,15 +567,15 @@ compat_drm_dma(struct file *file, void * if ((error = copyin(, arg, sizeof(d32))) != 0) return error; - dma64to32(, ); + dma32to64(, ); error = drm_ioctl(file, DRM_IOCTL_DMA, ); if (error) return error; - dma32to64(, ); + dma64to32(, ); - return 0; + return copyout(arg, , sizeof(d32)); } //XXX:i commented the below line for later use @@ -592,7 +594,7 @@ compat_drm_agp_enable(struct file *file, if ((error = copyin(, arg, sizeof(m32))) != 0) return error; - m32.mode = m64.mode; + m64.mode = m32.mode; return drm_ioctl(file, DRM_IOCTL_AGP_ENABLE, ); } @@ -612,17 +614,17 @@ typedef struct drm_agp_info32 { } drm_agp_info32_t; static void -info32to64(struct drm_agp_info *i64, const drm_agp_info32_t *i32) +info64to32(drm_agp_info32_t *i32, const struct drm_agp_info *i64) { - i64->agp_version_major = i32->agp_version_major; - i64->agp_version_minor = i32->agp_version_minor; - i64->mode = i32->mode; - i64->aperture_base = i32->aperture_base; - i64->aperture_size = i32->aperture_size; - i64->memory_allowed = i32->memory_allowed; - i64->memory_used = i64->memory_used; - i64->id_vendor = i32->id_vendor; - i64->id_device = i32->id_device; + i32->agp_version_major = i64->agp_version_major; + i32->agp_version_minor = i64->agp_version_minor; + i32->mode = i64->mode; + i32->aperture_base = i64->aperture_base; + i32->aperture_size = i64->aperture_size; + i32->memory_allowed = i64->memory_allowed; + i32->memory_used = i64->memory_used; + i32->id_vendor = i64->id_vendor; + i32->id_device = i64->id_device; } static int @@ -636,7 +638,7 @@ compat_drm_agp_info(struct file *file, v if (error) return error; - info32to64(,); + info64to32(, ); return copyout(arg, , sizeof(i32));
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Aug 20 14:12:33 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 Log Message: make things compile again. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32 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/files.netbsd32 diff -u src/sys/compat/netbsd32/files.netbsd32:1.47 src/sys/compat/netbsd32/files.netbsd32:1.48 --- src/sys/compat/netbsd32/files.netbsd32:1.47 Tue Aug 20 08:25:41 2019 +++ src/sys/compat/netbsd32/files.netbsd32 Tue Aug 20 10:12:33 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.netbsd32,v 1.47 2019/08/20 12:25:41 maxv Exp $ +# $NetBSD: files.netbsd32,v 1.48 2019/08/20 14:12:33 christos Exp $ # # config file description for machine-independent netbsd32 compat code. # included by ports that need it. @@ -8,7 +8,7 @@ define compat_netbsd32 -makeoptions drmkms CPPFLAGS+="-DNETBSD32_DRMKMS" +#makeoptions drmkms CPPFLAGS+="-DNETBSD32_DRMKMS" file compat/netbsd32/netbsd32_core.c compat_netbsd32 & coredump file compat/netbsd32/netbsd32_exec_elf32.c compat_netbsd32 & exec_elf32
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Aug 20 14:12:33 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 Log Message: make things compile again. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32 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
Module Name:src Committed By: christos Date: Tue Aug 20 09:55:49 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: add NetBSD copyright. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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
Module Name:src Committed By: christos Date: Tue Aug 20 09:55:49 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: add NetBSD copyright. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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.1 src/sys/compat/netbsd32/netbsd32_drm.c:1.2 --- src/sys/compat/netbsd32/netbsd32_drm.c:1.1 Tue Aug 20 05:32:21 2019 +++ src/sys/compat/netbsd32/netbsd32_drm.c Tue Aug 20 05:55:49 2019 @@ -1,6 +1,9 @@ -/* $NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */ +/* $NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */ /* + * Copyright (c) 2019 The NetBSD Foundation, Inc. + * All rights reserved. + * * This code was written by Surya Shankar for GSoC 2019. * * Redistribution and use in source and binary forms, with or without @@ -26,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $"); #include #include
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Aug 20 09:32:21 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c netbsd32_ioctl.h Added Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: compat32 drm ioctl support from Surya Shankar at GSoC 2019 To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.67 -r1.68 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/files.netbsd32 diff -u src/sys/compat/netbsd32/files.netbsd32:1.45 src/sys/compat/netbsd32/files.netbsd32:1.46 --- src/sys/compat/netbsd32/files.netbsd32:1.45 Mon Jun 17 21:36:50 2019 +++ src/sys/compat/netbsd32/files.netbsd32 Tue Aug 20 05:32:21 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.netbsd32,v 1.45 2019/06/18 01:36:50 christos Exp $ +# $NetBSD: files.netbsd32,v 1.46 2019/08/20 09:32:21 christos Exp $ # # config file description for machine-independent netbsd32 compat code. # included by ports that need it. @@ -7,10 +7,14 @@ # own file lists. define compat_netbsd32 + +makeoptions drmkms CPPFLAGS+="-DNETBSD32_DRMKMS" + file compat/netbsd32/netbsd32_core.c compat_netbsd32 & coredump file compat/netbsd32/netbsd32_exec_elf32.c compat_netbsd32 & exec_elf32 file compat/netbsd32/netbsd32_exec_aout.c compat_netbsd32 & exec_aout file compat/netbsd32/netbsd32_netbsd.c compat_netbsd32 +file compat/netbsd32/netbsd32_drm.c compat_netbsd32 & drmkms file compat/netbsd32/netbsd32_event.c compat_netbsd32 file compat/netbsd32/netbsd32_execve.c compat_netbsd32 file compat/netbsd32/netbsd32_fd.c compat_netbsd32 Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103 Fri May 17 03:37:12 2019 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Tue Aug 20 05:32:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -1517,6 +1517,12 @@ netbsd32_ioctl(struct lwp *l, IOCTL_STRUCT_CONV_TO(DIOCLWEDGES, dkwedge_list); default: +#ifdef NETBSD32_DRMKMS + if (IOCGROUP(com) == 'd') { + error = netbsd32_drm_ioctl(fp, com, data32, l); + break; + } +#endif #ifdef NETBSD32_MD_IOCTL error = netbsd32_md_ioctl(fp, com, data32, l); #else Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.68 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67 Fri May 17 03:37:12 2019 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Tue Aug 20 05:32:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.67 2019/05/17 07:37:12 msaitoh Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.68 2019/08/20 09:32:21 christos Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -36,6 +36,9 @@ #include #include +#include +#include +#include #include /* we define some handy macros here... */ @@ -624,3 +627,5 @@ struct netbsd32_disk_strategy { #define DIOCGSTRATEGY32 _IOR('d', 125, struct netbsd32_disk_strategy) #define DIOCSSTRATEGY32 _IOW('d', 126, struct netbsd32_disk_strategy) + +int netbsd32_drm_ioctl(struct file *, unsigned long, void *, struct lwp *); Added files: Index: src/sys/compat/netbsd32/netbsd32_drm.c diff -u /dev/null src/sys/compat/netbsd32/netbsd32_drm.c:1.1 --- /dev/null Tue Aug 20 05:32:21 2019 +++ src/sys/compat/netbsd32/netbsd32_drm.c Tue Aug 20 05:32:21 2019 @@ -0,0 +1,974 @@ +/* $NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */ + +/* + * This code was written by Surya Shankar for GSoC 2019. + * + * 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 AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Aug 20 09:32:21 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c netbsd32_ioctl.h Added Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: compat32 drm ioctl support from Surya Shankar at GSoC 2019 To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.67 -r1.68 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
Module Name:src Committed By: christos Date: Thu Jun 27 02:36:27 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_rndpseudo_50.c Log Message: Include the right stuff so compat_netbsd32_50 compiles. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_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/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.38 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.39 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.38 Tue Jun 18 18:34:25 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Wed Jun 26 22:36:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.38 2019/06/18 22:34:25 kamil Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -36,10 +36,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.38 2019/06/18 22:34:25 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" +#include "opt_compat_netbsd32.h" #include "opt_ntp.h" #include "opt_quota.h" #endif Index: src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c diff -u src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.2 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3 --- src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.2 Sat Jan 26 21:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c Wed Jun 26 22:36:27 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_rndpseudo_50.c,v 1.2 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 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.2 2019/01/27 02:08:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_rnd #include #include + +#include #include /*
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Thu Jun 27 02:36:27 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_rndpseudo_50.c Log Message: Include the right stuff so compat_netbsd32_50 compiles. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_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/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:46:03 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: sort -u opt_ to remove dup. To generate a diff of this commit: cvs rdiff -u -r1.225 -r1.226 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:46:03 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: sort -u opt_ to remove dup. To generate a diff of this commit: cvs rdiff -u -r1.225 -r1.226 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.225 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.226 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.225 Tue Jun 18 12:22:54 2019 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Jun 18 12:46:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.226 2019/06/18 16:46:03 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.226 2019/06/18 16:46:03 christos Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -46,15 +46,14 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net */ #if defined(_KERNEL_OPT) +#include "opt_compat_43.h" +#include "opt_compat_netbsd.h" #include "opt_ddb.h" -#include "opt_ntp.h" #include "opt_ktrace.h" -#include "opt_compat_netbsd.h" -#include "opt_compat_43.h" -#include "opt_sysv.h" +#include "opt_ntp.h" #include "opt_quota.h" #include "opt_syscall_debug.h" -#include "opt_quota.h" +#include "opt_sysv.h" #endif #include
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:24: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.141 -r1.142 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.20 -r1.21 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.31 -r1.32 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.141 src/sys/compat/netbsd32/netbsd32_syscall.h:1.142 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.141 Mon Jun 17 21:37:04 2019 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Tue Jun 18 12:24:32 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.141 2019/06/18 01:37:04 christos Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.142 2019/06/18 16:24:32 christos Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp + * created from NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1240,9 +1240,13 @@ /* syscall: "netbsd32_futimens" ret: "int" args: "int" "const netbsd32_timespecp_t" */ #define NETBSD32_SYS_netbsd32_futimens 472 +#if defined(QUOTA) || !defined(_KERNEL_OPT) /* syscall: "netbsd32___quotactl" ret: "int" args: "const netbsd32_charp" "netbsd32_voidp" */ #define NETBSD32_SYS_netbsd32___quotactl 473 +#else +/* 473 is excluded netbsd32___quotactl */ +#endif /* syscall: "netbsd32_posix_spawn" ret: "int" args: "netbsd32_pid_tp" "const netbsd32_charp" "const netbsd32_posix_spawn_file_actionsp" "const netbsd32_posix_spawnattrp" "netbsd32_charpp" "netbsd32_charpp" */ #define NETBSD32_SYS_netbsd32_posix_spawn 474 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.140 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.141 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.140 Mon Jun 17 21:37:04 2019 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Tue Jun 18 12:24:32 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.140 2019/06/18 01:37:04 christos Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.141 2019/06/18 16:24:32 christos Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp + * created from NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2534,12 +2534,15 @@ struct netbsd32_futimens_args { syscallarg(const netbsd32_timespecp_t) tptr; }; check_syscall_args(netbsd32_futimens) +#if defined(QUOTA) || !defined(_KERNEL_OPT) struct netbsd32___quotactl_args { syscallarg(const netbsd32_charp) path; syscallarg(netbsd32_voidp) args; }; check_syscall_args(netbsd32___quotactl) +#else +#endif struct netbsd32_posix_spawn_args { syscallarg(netbsd32_pid_tp) pid; @@ -3424,8 +3427,11 @@ int netbsd32_unlinkat(struct lwp *, cons int netbsd32_futimens(struct lwp *, const struct netbsd32_futimens_args *, register_t *); +#if defined(QUOTA) || !defined(_KERNEL_OPT) int netbsd32___quotactl(struct lwp *, const struct netbsd32___quotactl_args *, register_t *); +#else +#endif int netbsd32_posix_spawn(struct lwp *, const struct netbsd32_posix_spawn_args *, register_t *); int netbsd32_recvmmsg(struct lwp *, const struct netbsd32_recvmmsg_args *, register_t *); Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.140 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.141 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.140 Mon Jun 17 21:37:04 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Tue Jun 18 12:24:32 2019 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.140 2019/06/18 01:37:04 christos Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.141 2019/06/18 16:24:32 christos Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp + * created from NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.140 2019/06/18 01:37:04 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD:
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:24: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.141 -r1.142 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.20 -r1.21 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.31 -r1.32 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
Module Name:src Committed By: christos Date: Tue Jun 18 16:23:24 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: Add ifdef for quota and include the syscall numbers header To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 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.126 src/sys/compat/netbsd32/syscalls.master:1.127 --- src/sys/compat/netbsd32/syscalls.master:1.126 Mon Jun 17 21:36:50 2019 +++ src/sys/compat/netbsd32/syscalls.master Tue Jun 18 12:23:24 2019 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp $ + $NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -50,6 +50,7 @@ #include #include +#include #include %% @@ -1124,8 +1125,12 @@ int flag); } 472 STD { int|netbsd32||futimens(int fd, \ const netbsd32_timespecp_t tptr); } +#if defined(QUOTA) || !defined(_KERNEL_OPT) 473 STD { int|netbsd32||__quotactl(const netbsd32_charp path, \ netbsd32_voidp args); } +#else +473 EXCL netbsd32___quotactl +#endif 474 NOERR { int|netbsd32||posix_spawn(netbsd32_pid_tp pid, \ const netbsd32_charp path, \ const netbsd32_posix_spawn_file_actionsp \
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:23:24 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: Add ifdef for quota and include the syscall numbers header To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 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
Module Name:src Committed By: christos Date: Tue Jun 18 16:22:54 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_quota.c Log Message: Add options for quota. To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_quota.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 16:22:54 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_quota.c Log Message: Add options for quota. To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_quota.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.224 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.225 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.224 Tue Jun 18 12:05:30 2019 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Jun 18 12:22:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net #include "opt_compat_netbsd.h" #include "opt_compat_43.h" #include "opt_sysv.h" +#include "opt_quota.h" #include "opt_syscall_debug.h" #include "opt_quota.h" #endif Index: src/sys/compat/netbsd32/netbsd32_quota.c diff -u src/sys/compat/netbsd32/netbsd32_quota.c:1.1 src/sys/compat/netbsd32/netbsd32_quota.c:1.2 --- src/sys/compat/netbsd32/netbsd32_quota.c:1.1 Mon Dec 24 15:44:39 2018 +++ src/sys/compat/netbsd32/netbsd32_quota.c Tue Jun 18 12:22:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_quota.c,v 1.1 2018/12/24 20:44:39 mrg Exp $ */ +/* $NetBSD: netbsd32_quota.c,v 1.2 2019/06/18 16:22:54 christos Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -29,7 +29,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_quota.c,v 1.1 2018/12/24 20:44:39 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_quota.c,v 1.2 2019/06/18 16:22:54 christos Exp $"); + +#ifdef _KERNEL_OPT +#include "opt_quota.h" +#endif #include #include @@ -42,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_quo #include #include +#ifdef QUOTA int netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, register_t *retval) { @@ -135,3 +140,4 @@ netbsd32___quotactl(struct lwp *l, const return do_sys_quotactl(SCARG_P32(uap, path), ); } +#endif
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: pgoyette Date: Tue Jun 18 16:05:30 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: Include opt_quota.h Fixes (at least) the amd64 build. To generate a diff of this commit: cvs rdiff -u -r1.223 -r1.224 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: pgoyette Date: Tue Jun 18 16:05:30 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: Include opt_quota.h Fixes (at least) the amd64 build. To generate a diff of this commit: cvs rdiff -u -r1.223 -r1.224 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.223 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.224 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.223 Sun Jan 27 02:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Jun 18 16:05:30 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.223 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.223 2019/01/27 02:08:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net #include "opt_compat_43.h" #include "opt_sysv.h" #include "opt_syscall_debug.h" +#include "opt_quota.h" #endif #include
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 01:37:04 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c 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.36 -r1.37 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.19 -r1.20 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.138 -r1.139 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.30 -r1.31 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_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.36 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.37 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.36 Fri Mar 1 06:06:56 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Mon Jun 17 21:37:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.36 2019/03/01 11:06:56 pgoyette Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.37 2019/06/18 01:37:03 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -36,11 +36,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.36 2019/03/01 11:06:56 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.37 2019/06/18 01:37:03 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" -#include +#include "opt_ntp.h" +#include "opt_quota.h" #endif @@ -915,6 +916,7 @@ compat_50_netbsd32_getitimer(struct lwp return copyout(, SCARG_P32(uap, itv), sizeof(s32it)); } +#ifdef QUOTA int compat_50_netbsd32_quotactl(struct lwp *l, const struct compat_50_netbsd32_quotactl_args *uap, register_t *retval) { @@ -932,6 +934,7 @@ compat_50_netbsd32_quotactl(struct lwp * NETBSD32TOP_UAP(arg, void *); return (compat_50_sys_quotactl(l, , retval)); } +#endif #ifdef NTP int @@ -1023,8 +1026,10 @@ static struct syscall_package compat_net (sy_call_t *)compat_50_netbsd32_setitimer }, { NETBSD32_SYS_compat_50_netbsd32_getitimer, 0, (sy_call_t *)compat_50_netbsd32_getitimer }, +#ifdef QUOTA { NETBSD32_SYS_compat_50_netbsd32_quotactl, 0, (sy_call_t *)compat_50_netbsd32_quotactl }, +#endif #ifdef NTP { NETBSD32_SYS_compat_50_netbsd32_ntp_gettime, 0, (sy_call_t *)compat_50_netbsd32_ntp_gettime }, Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.140 src/sys/compat/netbsd32/netbsd32_syscall.h:1.141 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.140 Sat Jan 26 21:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Mon Jun 17 21:37:04 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.140 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.141 2019/06/18 01:37:04 christos Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.120.2.19 2018/09/29 04:22:31 pgoyette Exp + * created from NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -428,12 +428,17 @@ /* syscall: "setsid" ret: "int" args: */ #define NETBSD32_SYS_setsid 147 +#if defined(QUOTA) || !defined(_KERNEL_OPT) /* syscall: "compat_50_netbsd32_quotactl" ret: "int" args: "netbsd32_charp" "int" "int" "netbsd32_voidp" */ #define NETBSD32_SYS_compat_50_netbsd32_quotactl 148 /* syscall: "compat_43_oquota" ret: "int" args: */ #define NETBSD32_SYS_compat_43_oquota 149 +#else +/* 148 is excluded compat_netbsd32_quotactl */ +/* 149 is excluded compat_netbsd32_quota */ +#endif /* syscall: "compat_43_netbsd32_ogetsockname" ret: "int" args: "int" "netbsd32_voidp" "netbsd32_intp" */ #define NETBSD32_SYS_compat_43_netbsd32_ogetsockname 150 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.139 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.140 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.139 Sat Jan 26 21:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Mon Jun 17 21:37:04 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.139 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.140 2019/06/18 01:37:04 christos Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.120.2.19 2018/09/29 04:22:31
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 01:37:04 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c 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.36 -r1.37 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.19 -r1.20 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.138 -r1.139 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.30 -r1.31 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
Module Name:src Committed By: christos Date: Tue Jun 18 01:36:50 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 syscalls.master Log Message: use option quota To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r1.125 -r1.126 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/files.netbsd32 diff -u src/sys/compat/netbsd32/files.netbsd32:1.44 src/sys/compat/netbsd32/files.netbsd32:1.45 --- src/sys/compat/netbsd32/files.netbsd32:1.44 Sat Jan 26 21:55:02 2019 +++ src/sys/compat/netbsd32/files.netbsd32 Mon Jun 17 21:36:50 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.netbsd32,v 1.44 2019/01/27 02:55:02 christos Exp $ +# $NetBSD: files.netbsd32,v 1.45 2019/06/18 01:36:50 christos Exp $ # # config file description for machine-independent netbsd32 compat code. # included by ports that need it. @@ -25,7 +25,7 @@ file compat/netbsd32/netbsd32_mqueue.c c file compat/netbsd32/netbsd32_nfssvc.c compat_netbsd32 & nfsserver file compat/netbsd32/netbsd32_ptrace.c compat_netbsd32 & ptrace file compat/netbsd32/netbsd32_rlimit.c compat_netbsd32 -file compat/netbsd32/netbsd32_quota.c compat_netbsd32 +file compat/netbsd32/netbsd32_quota.c compat_netbsd32 & quota file compat/netbsd32/netbsd32_select.c compat_netbsd32 file compat/netbsd32/netbsd32_sem.c compat_netbsd32 file compat/netbsd32/netbsd32_signal.c compat_netbsd32 Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.125 src/sys/compat/netbsd32/syscalls.master:1.126 --- src/sys/compat/netbsd32/syscalls.master:1.125 Sat Jan 26 21:08:40 2019 +++ src/sys/compat/netbsd32/syscalls.master Mon Jun 17 21:36:50 2019 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.125 2019/01/27 02:08:40 pgoyette Exp $ + $NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -40,6 +40,7 @@ #include "opt_compat_netbsd.h" #include "opt_ntp.h" #include "opt_compat_43.h" +#include "opt_quota.h" #endif #include @@ -354,11 +355,16 @@ 146 COMPAT_43 MODULAR compat_netbsd32_43 \ { int|netbsd32||killpg(int pgid, int signum); } 147 NOARGS { int|sys||setsid(void); } +#if defined(QUOTA) || !defined(_KERNEL_OPT) 148 COMPAT_50 MODULAR compat_netbsd32_50 \ { int|netbsd32||quotactl(netbsd32_charp path, int cmd, \ int uid, netbsd32_voidp arg); } 149 COMPAT_43 MODULAR compat_netbsd32_43 \ { int|sys||quota(void); } oquota +#else +148 EXCL compat_netbsd32_quotactl +149 EXCL compat_netbsd32_quota +#endif 150 COMPAT_43 MODULAR compat_netbsd32_43 \ { int|netbsd32||ogetsockname(int fdec, \ netbsd32_voidp asa, netbsd32_intp alen); }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Tue Jun 18 01:36:50 UTC 2019 Modified Files: src/sys/compat/netbsd32: files.netbsd32 syscalls.master Log Message: use option quota To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r1.125 -r1.126 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
Module Name:src Committed By: christos Date: Fri Jun 7 20:13:54 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_exec_elf32.c Log Message: Sync auxv vector generation with exec_elf.c. Fixes $ORIGIN on compat_netbsd32. Found by zerous as part of GSoC To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_exec_elf32.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
Module Name:src Committed By: christos Date: Fri Jun 7 20:13:54 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_exec_elf32.c Log Message: Sync auxv vector generation with exec_elf.c. Fixes $ORIGIN on compat_netbsd32. Found by zerous as part of GSoC To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_exec_elf32.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_exec_elf32.c diff -u src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.43 src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.44 --- src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.43 Fri Mar 1 06:06:56 2019 +++ src/sys/compat/netbsd32/netbsd32_exec_elf32.c Fri Jun 7 16:13:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_exec_elf32.c,v 1.43 2019/03/01 11:06:56 pgoyette Exp $ */ +/* $NetBSD: netbsd32_exec_elf32.c,v 1.44 2019/06/07 20:13:54 christos Exp $ */ /* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */ /* @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_elf32.c,v 1.43 2019/03/01 11:06:56 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_exec_elf32.c,v 1.44 2019/06/07 20:13:54 christos Exp $"); #define ELFSIZE 32 @@ -134,8 +134,8 @@ int netbsd32_elf32_copyargs(struct lwp *l, struct exec_package *pack, struct ps_strings *arginfo, char **stackp, void *argp) { - size_t len; - AuxInfo ai[ELF_AUX_ENTRIES], *a; + size_t len, vlen; + AuxInfo ai[ELF_AUX_ENTRIES], *a, *execname; struct elf_args *ap; int error; @@ -200,17 +200,36 @@ netbsd32_elf32_copyargs(struct lwp *l, s a->a_v = l->l_proc->p_stackbase; a++; + execname = a; + a->a_type = AT_SUN_EXECNAME; + a++; + exec_free_emul_arg(pack); + } else { + execname = NULL; } a->a_type = AT_NULL; a->a_v = 0; a++; - len = (a - ai) * sizeof(AuxInfo); + vlen = (a - ai) * sizeof(ai[0]); + + KASSERT(vlen <= sizeof(ai)); + + if (execname) { + char *path = l->l_proc->p_path; + execname->a_v = (uintptr_t)(*stackp + vlen); + len = strlen(path) + 1; + if ((error = copyout(path, (*stackp + vlen), len)) != 0) + return error; + len = ALIGN(len); + } else { + len = 0; + } if ((error = copyout(ai, *stackp, len)) != 0) return error; - *stackp += len; + *stackp += vlen + len; return 0; }
re: CVS commit: src/sys/compat/netbsd32
"Paul Goyette" writes: > Module Name: src > Committed By: pgoyette > Date: Wed Jan 30 02:00:02 UTC 2019 > > Modified Files: > src/sys/compat/netbsd32: netbsd32_compat_80.c > > Log Message: > Remove #ifdef COMPAT_80 > > The file will only be selected if "options COMPAT_80" is defined in > the config file. The COMPAT_80 macro is defined only if the option > is explicitly defined, and not if it is implicitly defined due to > inclusion of lesser-version COMPATs. actually, the problem wasn't that it's not defined (it better be!), but that the opt_foo.h wasn't / isn't included. removing the #ifdef check is the right answer, but i wanted to be sure you understood _why_ this was failing before. it still may be useful to include the opt_foo.h file -- depends on if header files may depend on it or not (and i tend to believe they should include them directly), but this file itself does not. thanks. .mrg.
re: CVS commit: src/sys/compat/netbsd32
On Dec 7, 7:34am, m...@eterna.com.au (matthew green) wrote: -- Subject: re: CVS commit: src/sys/compat/netbsd32 | can they make 32 bit trace records instead? if not, why not? Because every other syscall is making 64 bit records, so ktrace.out file is only parseable/readable by the 64 bit ktrace. Putting a 32 bit signal record inside a 64 bit record file does not make any sense (try it). When/if we fix 32 bit processes to emit 32 bit records then we can switch back. christos
re: CVS commit: src/sys/compat/netbsd32
"Christos Zoulas" writes: > Module Name: src > Committed By: christos > Date: Wed Dec 6 19:15:27 UTC 2017 > > Modified Files: > src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_signal.c > > Log Message: > disable 32 bit signal ktrace records; 32 bit traced process produce 64 bit > trace records, the only record that we can't parse is that one :-) > XXX: pullup-8 can they make 32 bit trace records instead? if not, why not? thanks. .mrg.
Re: CVS commit: src/sys/compat/netbsd32
On 2016/11/20 21:18, Michael van Elst wrote: Looks fine to me. Committed. Thank you for your review! Rin
Re: CVS commit: src/sys/compat/netbsd32
On Thu, Nov 17, 2016 at 09:46:09PM +0900, Rin Okuyama wrote: > On 2016/11/16 18:33, Michael van Elst wrote: > >So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even > >when compiled with !NTP but just return ENOTTY. > > > >N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands, > >it should also return ENOTTY. > > I wrote a patch. Besides your suggestions, I protected NTP stuff in > compat50 codes by NTP macro. Is it ok with you? Looks fine to me. -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."
Re: CVS commit: src/sys/compat/netbsd32
On 2016/11/16 18:33, Michael van Elst wrote: So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even when compiled with !NTP but just return ENOTTY. N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands, it should also return ENOTTY. I wrote a patch. Besides your suggestions, I protected NTP stuff in compat50 codes by NTP macro. Is it ok with you? Thanks, Rin --- src/sys/compat/netbsd32/netbsd32_ioctl.c.orig 2016-11-17 21:10:05.784020949 +0900 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c2016-11-17 21:17:42.250121516 +0900 @@ -1324,8 +1324,8 @@ case CLOCKCTL_CLOCK_SETTIME32: IOCTL_STRUCT_CONV_TO(CLOCKCTL_CLOCK_SETTIME, clockctl_clock_settime); -#ifdef NTP case CLOCKCTL_NTP_ADJTIME32: +#ifdef NTP { size = IOCPARM_LEN(CLOCKCTL_NTP_ADJTIME); if (size > sizeof(stkbuf)) @@ -1346,7 +1346,10 @@ break; } -#endif +#else + error = ENOTTY; + break; +#endif /* NTP */ case KIOCGSYMBOL32: IOCTL_STRUCT_CONV_TO(KIOCGSYMBOL, ksyms_gsymbol); --- src/sys/dev/clockctl.c.orig 2016-11-17 21:17:52.116138355 +0900 +++ src/sys/dev/clockctl.c 2016-11-17 21:25:27.068388985 +0900 @@ -266,7 +266,7 @@ #ifdef COMPAT_50 error = compat50_clockctlioctl(dev, cmd, data, flags, l); #else - error = EINVAL; + error = ENOTTY; #endif } @@ -328,13 +328,16 @@ error = clock_settime1(l->l_proc, args->clock_id, , true); break; } - case CLOCKCTL_ONTP_ADJTIME: +#ifdef NTP + case CLOCKCTL_ONTP_ADJTIME: { /* The ioctl number changed but the data did not change. */ error = (cd->d_ioctl)(dev, CLOCKCTL_NTP_ADJTIME, data, flags, l); break; + } +#endif default: - error = EINVAL; + error = ENOTTY; } return (error);
Re: CVS commit: src/sys/compat/netbsd32
On 2016/11/16 18:33, Michael van Elst wrote: There is a slight twist. If NTP isn't defined, the code will call the standard (64bit) ioctl handler with the assumption that the arg uses the same layout in 64bit and 32bit mode. If the ioctl handler is builtin, it won't understand the ioctl either and everything is fine. But if it is a loaded module, it might be compiled with different NTP option and so the wrong routine is called. Fortunately that's just theoretical because the module can't be loaded when compiled differently (because it references ntp_adjtime). But that is a different issue and might be solved in the future. So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even when compiled with !NTP but just return ENOTTY. N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands, it should also return ENOTTY. Thank you for pointing out the possible failure. Your suggestion sounds good to me. Thanks, Rin
Re: CVS commit: src/sys/compat/netbsd32
On Tue, Nov 15, 2016 at 07:44:52PM +0900, Rin Okuyama wrote: > On 2016/11/15 19:26, Martin Husemann wrote: > >On Tue, Nov 15, 2016 at 07:23:09PM +0900, Rin Okuyama wrote: > >>This results in build failure for most ARM environments: > >> > >> http://releng.netbsd.org/builds/HEAD/201611140950Z/ > >> > >>I think that NTP stuff should be protected by "#ifdef NTP". > >>Can I commit the attached patch? > > > >Sounds good, but don't you need to add #include "opt_ntp.h" to > >netbsd32_ioctl.c ? > > Thank you so much! I added this. Otherwise, NTP kernel gets > broken this time... There is a slight twist. If NTP isn't defined, the code will call the standard (64bit) ioctl handler with the assumption that the arg uses the same layout in 64bit and 32bit mode. If the ioctl handler is builtin, it won't understand the ioctl either and everything is fine. But if it is a loaded module, it might be compiled with different NTP option and so the wrong routine is called. Fortunately that's just theoretical because the module can't be loaded when compiled differently (because it references ntp_adjtime). But that is a different issue and might be solved in the future. So I suggest to make the compat32 code handle CLOCK_NTP_ADJTIME even when compiled with !NTP but just return ENOTTY. N.B. clockctlioctl returns EINVAL for unrecognized ioctl commands, it should also return ENOTTY. Greetings, -- Michael van Elst Internet: mlel...@serpens.de "A potential Snark may lurk in every tree."