Commit Graph

5367 Commits

Author SHA1 Message Date
pgoyette bbb252d733 Mark the nfssvc syscall as auto-loadable from the compat_netbsd32_nfssrv
module (to be committed shortly).
2015-12-01 09:10:03 +00:00
pgoyette ae0a7f84e1 Regen 2015-12-01 02:21:17 +00:00
pgoyette bc3c0dc251 Adapt to per-emulation syscall_autoload capability (the table of syscalls
that can be autoloaded is currently empty).
2015-12-01 02:20:43 +00:00
pgoyette 0b8f413125 Factor the basic dependency list out of the #ifdef _KERNEL_OPT block, since
the only difference was ksem (which is available as either built-in or
loadable module).
2015-11-30 01:31:02 +00:00
martin 76713fa86f We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.
2015-11-26 13:15:34 +00:00
christos 803cade3fe PR/50428: Rin Okuyama: support SA_RESTORER flag for rt_sigaction(2) in the
ports that support it.
2015-11-14 13:29:35 +00:00
njoly 4356aee846 Adjust compat netbsd32 clock_nanosleep(2) to match recent native
changes that return error number.
2015-10-31 17:04:39 +00:00
njoly 11983d156e Regen 2015-10-27 07:16:00 +00:00
njoly ca819d284f Fix setuid/setgid return type (void -> int) to match native. 2015-10-27 07:15:38 +00:00
njoly a4713df73f Regen. 2015-10-27 06:30:10 +00:00
njoly 2c407db9a0 Fix wrong gid types from previous. 2015-10-27 06:29:35 +00:00
njoly 1e5f19437c Regen for posix chown family cleanup. 2015-10-25 15:55:58 +00:00
njoly 754b91220a Cleanup posix chown family syscalls to match native (alpha, mips and
powerpc).
2015-10-25 15:55:05 +00:00
maxv ea498aca7e Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
2015-10-23 19:40:10 +00:00
christos e2746c9719 Handle both ioctls in both places :-) 2015-10-22 15:18:25 +00:00
maxv 6ad8aacf8e Make sure we have space for the aout header. 2015-10-18 16:59:19 +00:00
pgoyette 8a12675186 Don't release proc_lock until we're done looking at things that are
protected by the lock, particularly p_stat and p_waited.  Found by
Robert Elz.

XXX Pullup to NetBSD-7, -6, -6-0, and -6-1
2015-10-13 08:24:35 +00:00
pgoyette c0b82ae584 Ooops, spell the module name in full. "mqueue" vs "mq" 2015-10-10 05:50:34 +00:00
pgoyette 1a36963559 And yet another dependency, this time on mq 2015-10-10 04:59:46 +00:00
pgoyette 9eaaa4f91c Add another dependency for nfsserver 2015-10-10 04:53:48 +00:00
pgoyette ef916064f1 Add an additional dependency on compat_sysv 2015-10-10 04:28:04 +00:00
christos ec9d924643 rename sun ioctls 2015-09-26 04:13:39 +00:00
christos 9451a2b98d regen 2015-09-24 14:42:44 +00:00
christos 6d8b5c3e29 Regen 2015-09-24 14:40:09 +00:00
uebayasi ea72de740f Order library object build. 2015-09-07 03:44:19 +00:00
uebayasi 9068ec741b Sprinkle more done messages. 2015-09-07 03:20:18 +00:00
uebayasi dd204a345e In kernel lib build, print message when things not only start bug also end. 2015-09-06 15:34:55 +00:00
dholland 1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +00:00
pooka d8e04c9094 to garnish, dust with _KERNEL_OPT 2015-08-24 22:50:32 +00:00
mrg 957afe8e15 move some header-specific pointer-typedefs into a header-specific area. 2015-08-10 04:48:53 +00:00
maxv 56b645491f easy kmem_alloc(0)
ok shm@
2015-08-08 12:02:35 +00:00
mrg 6bc0c567c3 don't copy the first netbsd32_export_args nexports times, but actually
advance the userland pointer each entry through the loop.  oops.
2015-08-05 23:17:06 +00:00
maxv 9cd6cd69f5 Wrong logic. Here, userland can control the size and the data copied, which
basically means it can overflow kernel memory.

ok martin@ christos@
2015-08-02 07:37:57 +00:00
maxv 70f013c0c3 Lock before calling uvm_swap_stats(). Otherwise a race condition could
corrupt memory.
2015-07-30 09:55:57 +00:00
maxv 6647020bbc Unused inits (harmless).
Found by Brainy.
2015-07-24 13:02:52 +00:00
maxv 1e2d60e127 Memory leak, triggerable from an unprivileged user. 2015-07-22 14:25:39 +00:00
maxv fb721ebcf7 Set 'error' properly. 2015-07-22 14:06:26 +00:00
skrll 373bb6fc2c Unwrap lines. 2015-07-17 06:42:48 +00:00
martin ca5048732f Use the right type in sizeof() for copyin() in adjtime 2015-07-12 14:06:52 +00:00
njoly fc005ae43f Handle case where compat_ifioctl() is called with ocmd != cmd, as found in
compat Linux. Do not crash by ensuring that oifr is correctly set.

Fix crash reported by Robert Swindells on tech-kern@.
2015-07-11 07:43:32 +00:00
christos 1ae3462030 PR/50021: Rin Okuyama: Fix linux affinity syscalls
XXX: pullup-7
2015-07-03 02:24:28 +00:00
christos 8661aac84a whitespace police. 2015-06-30 11:56:27 +00:00
martin 90ce5da580 Fix reversed arguments in copyin(9), c.f. kern/sys_mqueue.c rev 1.39. 2015-06-30 06:01:04 +00:00
dholland 111d12c32a add missing opt_nfsserver.h 2015-06-23 06:28:29 +00:00
dholland ea5d0337c5 regen 2015-06-23 04:45:53 +00:00
dholland 91962d21a7 Don't reference netbsd32_nfssvc unless NFSSERVER is defined.
Fixes PR 49994.
2015-06-23 04:44:08 +00:00
mrg 8dc77cd94a add netbsd32 support for nfssvc(2). we do this by defining 5 copyin/out
functions that do all the ugly work, are just plain copyin/out for the
native system calls, and do the necessary translations for netbsd32.

with this i'm able to run 32 bit nfsd and mountd on 64 bit kernel and
mount the file systems remotely.
2015-06-22 10:35:00 +00:00
mrg bad97058ff s/sparc64/native 64 bit/ in a comment... 2015-06-21 14:03:38 +00:00
martin de7fce508e Implement trivial conversion for pset_* 2015-06-21 12:54:33 +00:00
martin 44c9bcba16 Regen (pset_*) 2015-06-21 12:52:40 +00:00
martin dd2a19c8fb Add pset_* calls 2015-06-21 12:51:33 +00:00
martin 562fee01d0 Cosmetics: fill in details about some currently unimplemented syscalls. 2015-06-21 12:29:48 +00:00
martin bcae189392 Move compat calls, requested by mrg@ 2015-06-21 08:47:15 +00:00
martin 4a59e4a66e Fix compat/versioning confusion and add the missing new versioned ones. 2015-06-21 08:32:36 +00:00
martin b56ceb540f regen (versioned mq_* calls) 2015-06-21 08:29:52 +00:00
martin d86daecc04 Add the two versioned mq_* calls I missed in the last round 2015-06-21 08:28:36 +00:00
msaitoh 34476fc305 Add missing sys/kauth.h 2015-06-21 06:51:05 +00:00
martin 021a80b600 Implement modctl, sigqueinfo and mq_* 2015-06-20 19:58:40 +00:00
martin 95e5bbaeef Regen (sigqueinfo, modctl, mq_*) 2015-06-20 19:56:24 +00:00
martin 2cfad306cd Add sigqueuinfo, modctl and mq_*. 2015-06-20 19:55:07 +00:00
martin 59c35335bf Implement posix_fallocate and fdiscard compat 2015-06-16 10:42:38 +00:00
martin 681b650f7f Regen for posix_fallocate and fdiscard 2015-06-16 10:42:13 +00:00
martin 74085ed4a7 Add posix_fallocate and fdiscard 2015-06-16 10:41:34 +00:00
matt 93b5ceb986 Fix a comment. 2015-06-16 07:29:46 +00:00
christos 9198a032e7 we need compat_sysv now. 2015-06-13 22:17:04 +00:00
matt d99aa73f39 Force *stackp to (uintptr_t) before possibly moving to a smaller pointer size. 2015-06-11 02:54:00 +00:00
roy cb53724789 Add support for NPF ioctls. 2015-06-01 16:07:27 +00:00
roy 555a592508 Back out prior
gimpy1@ we don't #include driver .h in netbsd32
2015-06-01 00:15:07 +00:00
roy 643289594b Revert prior change, optionally include PPPOE and SPPP support again.
Fix compat_netbsd32 module building by enforcing both.
2015-05-31 23:40:19 +00:00
roy cf18a8ed2e It seems we cannot depend on kernel config in modules, so always compile
in PPP(,oE) support.
2015-05-31 22:58:50 +00:00
roy fc67b5dc14 Add support for PPPOEGETPARMS and PPPOESETPARMS. 2015-05-31 22:19:41 +00:00
roy 27cf308b62 Support SPPPGETAUTHCFG and SPPPSETAUTHCFG. 2015-05-31 22:16:16 +00:00
roy c4fd6408ee Fixup ifdrv parameter order. 2015-05-31 15:08:14 +00:00
njoly dc12bdee6f Regen for write(2) size argument fix. 2015-05-31 10:50:04 +00:00
njoly e72b8ff8b4 Fix write(2) size argument (int -> size_t). 2015-05-31 10:49:27 +00:00
matt aeae3560b3 Fix netbsd32 ifdrv copy routines to not use memcpy. 2015-05-27 21:56:43 +00:00
matt 0d007d00e3 Add missing SIOCGDRVSPEC32
Fix SIOCGETSGCNT32
2015-05-27 21:42:43 +00:00
rtr d3607ec6c2 convert remaining linux_get_sa() users to use linux_get_sa_sb() and
pass the pointer to the sockaddr in msghdr.msg_name, while removing
the MSG_NAMEMBUF flag.

now that the original linux_get_sa() is unused remove it and to make
function names consistent again rename linux_get_sa_sb() to linux_get_sa().
2015-05-24 17:07:26 +00:00
rtr 04ca548b64 get rid of unnecessary use of mbuf to hold sockaddr, which was leaked...
while here change use to typed pointer sockaddr * instead of void * which
also lets us get rid of sasize variable used to track length (since we
can now use sa_len easily)
2015-05-23 15:27:55 +00:00
matt 95b88ec007 Use Elf_Sym 2015-05-20 07:24:49 +00:00
matt 0828cd07d4 Rework ksym defines and includes. 2015-05-20 04:37:45 +00:00
matt cdbc8d4e56 Only define the KIOC netbsd32 stuff if the KIOC ioctls have been defined. 2015-05-20 04:09:37 +00:00
matt d0c9fc59d2 Change the ksyms ioctls to more compat_netbsd32 friendly. Use _IOWR ioctls
to avoid extra copyouts.  With these changes, netstat and vmstat work on
mips64eb with the normal N32 userland and a N64 kernel.
2015-05-20 02:45:20 +00:00
martin c5617ba863 Implement SIOCIFGCLONERS for netbsd32, so ifconfig -C works. 2015-05-18 06:38:59 +00:00
matt b2ae998f66 machine_arch on mips depends on the ABI so we need a routine to return
the right value.
2015-05-17 18:52:37 +00:00
matt fd223cea42 Simplify a tiny bit. 2015-05-15 07:56:25 +00:00
matt c3824aa5ce In lwp_ctl, convert ptr to 32 bits before copyout. 2015-05-15 07:52:51 +00:00
matt 397eb68d6f Fix _lwp_ctl for big endian 64-bit platforms. (little-endian too but not
as noticable).
2015-05-15 07:45:15 +00:00
pgoyette 9681555f60 The compat_sysv module now depends on sysv_ipc module. 2015-05-13 02:08:20 +00:00
christos 6ebc227033 rump is compiled with COMPAT_OSOCK not COMPAT_OIFREQ and the code in if.c
is not handling this case properly. Make this work by checking again if
we need to convert struct ifreq here, and if we do, we do it ourselves.
2015-05-12 20:42:46 +00:00
pgoyette 0caf2564d1 Fix the #ifdef _MODULE stuff so that the syscall packages and sysctl stuff
gets handled properly even in built-in module case.

XXX
Whatever was I thinking when I put those conditionals in?  And wouldn't it
be a wonderful thing to have some atf regression tests to actually catch
errors in the compat{,_sysv} modules?   :)
2015-05-11 10:32:13 +00:00
pgoyette ff00f0b594 Split the SYSV* compat code out into a separate compat_sysv module.
For monolithic kernels, both modules will be compiled as "built-ins",
while modular environments will be able to load the SYSVSEM, SYSVSHM,
and SYSVMSG code independant from the rest of compat.

This is a necessary precursor step to making the "STD" SYSV* code
into a separate module.

Tested in both monolithic and modular environments with no errors
seen.
2015-05-10 07:41:15 +00:00
rtr fd12cf39ee make connect syscall use sockaddr_big and modify pr_{send,connect}
nam parameter type from buf * to sockaddr *.

final commit for parameter type changes to protocol user requests

* bump kernel version to 7.99.15 for parameter type changes to pr_{send,connect}
2015-05-02 17:18:03 +00:00
rtr eddf3af3c6 make accept, getsockname and getpeername syscalls use sockaddr_big and modify
pr_{accept,sockname,peername} nam parameter type from mbuf * to sockaddr *.

* retained use of mbuftypes[MT_SONAME] for now.
* bump to netbsd version 7.99.12 for parameter type change.

patch posted to tech-net@ 2015/04/19
2015-04-24 22:32:37 +00:00
rtr c40869fd3c clean up the way ti_bind() was converted to use sockaddr_big.
instead of using the original sockaddr_{in,un} structures for storage
use the single sockaddr_big structure instead.

while here ditch superfluous assignment of sockaddr sb_len since the
assignment is already performed in netaddr_to_sockaddr_{in,un}
2015-04-19 19:17:37 +00:00
riastradh 37553abcc1 No need for <sys/rnd.h> here either. Missed this one yesterday too. 2015-04-14 12:19:57 +00:00
nat ca58739ce4 Include rndio.h for missing defines. 2015-04-14 06:11:15 +00:00
rtr a2ba5e69ab * change pr_bind to accept struct sockaddr * instead of struct mbuf *
* update protocol bind implementations to use/expect sockaddr *
  instead of mbuf *
* introduce sockaddr_big struct for storage of addr data passed via
  sys_bind; sockaddr_big is of sufficient size and alignment to
  accommodate all addr data sizes received.
* modify sys_bind to allocate sockaddr_big instead of using an mbuf.
* bump kernel version to 7.99.9 for change to pr_bind() parameter type.

Patch posted to tech-net@
  http://mail-index.netbsd.org/tech-net/2015/03/15/msg005004.html

The choice to use a new structure sockaddr_big has been retained since
changing sockaddr_storage size would lead to unnecessary ABI change. The
use of the new structure does not preclude future work that increases
the size of sockaddr_storage and at that time sockaddr_big may be
trivially replaced.

Tested by mrg@ and myself, discussed with rmind@, posted to tech-net@
2015-04-03 20:01:07 +00:00
ozaki-r 248367a4ce Regen 2015-03-23 07:54:44 +00:00
ozaki-r 5afb55419b Add linux_systrace_args.c for arm 2015-03-23 07:52:36 +00:00