Commit Graph

148 Commits

Author SHA1 Message Date
christos a3ddac400c since ln(1) now uses linkat(2) provide a dumb wrapper. 2017-06-06 19:48:42 +00:00
sevan 6b31f116cc With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not
need to be defined. This allows register_t to be typedef'd to RUMP_REGISTER_T
without conflict, as highlighted in PR kern/52206.
2017-05-11 04:33:14 +00:00
sevan 979875ac74 Revert previous change so builds can resume.
_KERNTYPES needs to be defined for NetBSD builds to succeed.
_KERNTYPES must not be defined for buildrum.sh builds to succeed.
2017-05-10 08:48:46 +00:00
sevan 9204518573 Do not define _KERNTYPES as this breaks build with buildrump.sh due to
conflicting types for register_t.
Closes PR kern/52206
Steered in the right direction by christos.
2017-05-10 01:11:51 +00:00
ozaki-r 44d072be9e Support paccept for nc 2017-02-16 08:08:01 +00:00
christos d10d9a2322 fix test lib/librumphijack/t_sh/runscript
(handle F_DUPFD_CLOEXEC that the shell is now using)
2016-12-02 20:53:36 +00:00
kre 1ec349e914 Object to dup2() if target fd is in the range of fd's that
librumphijack reserves for rump to use.

This is not normally a problem, as most applications don't attempt
to use very high fds - but /bin/sh does.

This fix is something of a kludge - really the apparent fd resource limit
ought to be lowered as well, but this is sufficient to allow the shell
to work (when its dup2() gets rejected, it just tries again with a smaller
target fd until it eventually succeeds.)   This fixes the librumphijack
shell ATF tests.

A better, more comprehensive, fix would be good...
2016-08-11 09:48:57 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
pooka 1dfc153377 Remember that dlsym() tends to fail on PowerPC during init (or at least
tended), so call rumphijack_dlsym() instead to be safe.
2015-08-25 13:50:19 +00:00
pooka 4e9c298177 allow mmap() to be called before init runs 2015-08-25 13:45:00 +00:00
riastradh ee14e9e637 Define the expansion of the VFORK macro, not the symbol `VFORK'.
Fixes hijacking processes that vfork and exec.  Symptom was the child
would spin with read/EAGAIN <-> kevent/EBADF because the inheritance
mechanism relied on setting the holyfd to -1 on fork...which didn't
happen if we didn't hijack vfork.

ok pooka@
2015-04-11 12:54:41 +00:00
pooka 367e4a103c Wrap utimensat() only if present on host
fixes buildrump.sh on NetBSD 6.1.5
2015-03-05 00:26:17 +00:00
pooka 8ce52db1d0 Make ATCALL() behave for absolute paths too. 2015-03-04 23:42:26 +00:00
pooka 8651603956 Define a generic ATCALL() and use it to implement utimensat() 2015-03-04 23:31:49 +00:00
enami 02c2c060ff Also hijack futimens(2) so that t_sh test passes. 2015-03-03 01:24:39 +00:00
enami a4c990f5c2 Hijack utimensat(2) so that t_vfs test passes after cp(1)/mv(1) are
changed to use the system call.  Linux also has this system call, but
not tested this on linux.
2015-03-03 00:19:07 +00:00
pooka 23dfcd7408 Use autoconf for rump kernel posix hypercall layer.
This gets rid of homegrown hacks and puts all probes in one place.

Tested for NetBSD (build.sh + anita) and Linux (buildrump.sh)
2014-11-04 19:05:17 +00:00
pooka df2711f4e7 In case of no dup2'd fd's, make sure that F_CLOSEM for the
rump kernel starts from 0.

Fixes rumphijack fdoff test (notably, this bug had nothing to do with
fdoff, and was exposed >3 years after writing the test when rump kernels
started providing fd's 0/1/2)
2014-08-12 23:47:09 +00:00
gson 1c06c49918 Ignore the contents of revents when poll() returns failure.
This is one more part to the fix for PR kern/46464.  Patch
from pooka.
2014-07-21 14:23:43 +00:00
gson 6aaac7c3e2 Do not assert that the two threads do not simultanously notify each
other, because sometimes they do.  Should fix PR kern/46464.  OK pooka.
2014-07-19 14:14:21 +00:00
justin 95e41b89b5 Add Android support for rump kernel.
Reviewed by pooka@
2014-04-02 17:09:23 +00:00
tron 4923acbfbe Make sure that "_FORTIFY_SOURCE" really gets undefined even if "USE_SSP"
is set to "yes" to fix build problems caused by the recent change to
this makefile.
2014-01-18 18:37:30 +00:00
christos fa1b665884 don't need to include anything before bsd.lib.mk since we don't use any
variables
2014-01-10 15:54:29 +00:00
martin 6f65a8d103 ACTIVE_CC can only be used after include of bsd.own.mk 2014-01-10 15:00:16 +00:00
pooka 0f188198a5 use <rump/rumpuser_port.h> 2013-09-10 16:53:06 +00:00
pooka 3fc5dcaa4f remove unnecessary <sys/poll.h> -- musl whines when it's included 2013-07-31 12:23:25 +00:00
pooka 5cbd60062e Override ssp also in case where it doesn't come intrinsically
from the compiler.
2013-07-29 10:13:21 +00:00
pooka 2eebe6e2de Extend #undef _FORTIFY_SOURCE to both files to avoid compiler
warning for -O0 and fortify combination.

from Alessio Sergi via github
2013-07-27 17:37:29 +00:00
pooka 1b3ff08420 Support Linuxen where libc ioctl has cmd as int unstead of unsigned long. 2013-07-22 12:11:03 +00:00
pooka 40fd6d6fa3 Fixes when compiling against musl libc.
from Justin Cormack via private email
2013-07-20 18:46:15 +00:00
pooka a940e06527 sys/cdefs.h should come from rumpuser_port.h
Noticed by Justin Cormack while building against musl libc.
2013-07-18 22:58:35 +00:00
pooka f78e8a8efa * avoid problems if the platform calls readlink() from dlsym()
* alias __read_chk() to read() on Linux (technically, though,
  it should call host __read_chk() instead of read())
2012-10-16 12:56:10 +00:00
martin 550571fe00 When emulating poll/select better tell the events of the host kernel
apart from those received from the rump kernel. Also handle timeout.
Patch from pooka.
2012-09-12 10:35:10 +00:00
pooka bcc69e9323 one more patch for supporting linux-based networking clients 2012-09-03 12:07:42 +00:00
pooka 82e980c205 More fixes for Linux (or glibc, really). 2012-09-03 11:33:35 +00:00
pooka c62329f7d3 Make librumphijack compile and work on Linux. Do not try to hijack
calls which are not supported on Linux and therefore cannot be
handled by the rump kernel side syscall emulation (not that they'd
be present in the calling binaries anyway).
2012-08-25 18:00:06 +00:00
riastradh 16b71d29d9 Implement link(2) in rumphijack. Add a couple trivial test cases. 2012-08-04 03:56:47 +00:00
yamt b4228b70f2 implement descriptor passing. 2012-06-29 13:20:25 +00:00
abs 9e66e6d75e Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2012-06-25 22:32:43 +00:00
martin 91d93016c8 poll(), pollts() and select() all return int values, but in the hijack
emulation of them these get passed as exit values from a pthread as
a void* (c.f. pthread_join(), pthread_exit()).
Do not use the address of an int variable for these, but provide the address
of a void* and assign the value afterwards.
Fixes hijacking of pollts/select on 64bit big endian hosts.
Spotted by and fix from pooka.
2012-04-18 10:37:37 +00:00
matt fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
dholland 59b296daa7 Change the syscall API for quotas over to the new non-proplib one.
- struct vfs_quotactl_args -> struct quotactl_args
   - add sys/stdint.h to sys/quotactl.h for clean userland build
   - install sys/quotactl.h in /usr/include
   - update set lists for same
   - add new marshalling code in libquota
   - add new unmarshalling code in vfs_syscalls.c
   - discard proplib interpreter code in vfs_quotactl.c
   - add dispatching code for the 14 quotactl ops in vfs_quotactl.c
   - mark the proplib quotactl syscall obsolete
   - add a new syscall number for the new quotactl syscall
   - change the name of the syscall to __quotactl()
   - remove the decl of the old quotactl from quota/quotaprop.h
   - add a decl of the new quotactl to sys/quotactl.h
   - update the libc build
   - update ktruss
   - remove proplib marshalling code from libquota
   - update copy of syscall table in gdb ppc sources
   - hack rumphijack to accomodate new quotactl name (as I recall,
     pooka wanted such a name change to simplify something, but I
     don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
2012-02-01 05:34:38 +00:00
joerg 77abb554dc Disable Fortification for pthread and rump stubs. 2011-04-21 13:38:14 +00:00
martin 211a501951 Backout previous, it breaks lots of tests (tests/lib/librumphijack for
example).
2011-04-21 08:21:13 +00:00
he b974c45b30 Move the forward declaration of _sys_readlink() outside of the #if,
so that the build succeeds even if _FORTIFY_SOURCE isn't > 0.
2011-04-13 12:40:54 +00:00
christos e6eca274ad Fix SSP builds (Vladimir Kirillov) 2011-04-12 19:49:48 +00:00
pooka 0dc6decc72 document fdoff 2011-03-14 15:21:22 +00:00
pooka e5eecf0660 fdoff is descriptive enough 2011-03-14 15:15:47 +00:00
pooka c9038b2d6c Make fdoffset configurable. Also, enforce that host descriptors
are smaller than the offset.
2011-03-14 15:13:26 +00:00
pooka 563593515e Use rumphijack_dlsym() to figure out where __sysctl() is during
init.  Otherwise powerpc dlsym() DTWT and returns NULL.
(now i have no idea why dlsym() it works from rcinit(), but i'll
opt to not care)

Hah, only took 15min to debug that crap this time around.  I'm
quickly approaching zero-time with it.
2011-03-10 23:02:56 +00:00