Commit Graph

138 Commits

Author SHA1 Message Date
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
pooka 3406bd8660 Revert 1.81 and do it in a saner way with an ifdef. Later, when
the naming crisis is resolved, we can probably support rump kernel
quotas from nb5 also.
2011-03-10 09:47:32 +00:00
wiz 97b3b86219 Add serial commas. 2011-03-10 08:53:04 +00:00
pooka bbc64bd6b0 document vfs and sysctl knobs to RUMPHIJACK 2011-03-09 23:40:44 +00:00
pooka 61f25f646e Make getfh() a pathcall instead of a fhcall. while it does pertain
to file handles, it still gets passed a path and we can DTRT based
on that.
2011-03-09 23:26:19 +00:00
pooka 9d51298cb8 Make this compile/work on NetBSD 5 once again. 2011-03-09 20:48:57 +00:00
bouyer 48c24921f2 Add quotactl(2) 2011-03-09 18:45:30 +00:00
bouyer 90848eb9f1 Fix last entries, make it work again. 2011-03-09 18:06:22 +00:00
pooka 1af2e3a0a3 Add a bunch of process-wide hijack calls. Among other things, it's
now possible to use unmodified userspace binaries (rpcbind, mountd,
nfsd) to start a rump nfs service and mount file systems from it.

pain-rustique:42:~> mount
rumpfs on / type rumpfs (local)
10.1.1.1:/export on /mnt type nfs
2011-03-09 15:03:18 +00:00
pooka a30ace437f g/c unused global 2011-03-09 09:17:12 +00:00
wiz 3bc5f349f0 Remove trailing whitespace. 2011-03-08 23:51:23 +00:00