Commit Graph

158 Commits

Author SHA1 Message Date
christos
c1167da0aa Add pathconf and lpathconf (fixes lib/librumphijack/nfs test which uses ls
which now uses lpathconf)
2020-05-27 18:55:36 +00:00
kamil
418e457ef1 Change types of DUP2ALIAS and DUP2FDMASK bit masks to unsigned
This is for consistency with the DUP2BIT change.
2020-02-10 23:21:42 +00:00
kamil
a6c4eb28f3 Avoid unportable bit shift semantics
hijack.c:451:52, left shift of 1 by 31 places cannot be represented in type 'int
2020-02-10 09:10:58 +00:00
christos
ed9ca5deea teach hijack about the new vfs syscalls 2019-09-25 20:19:59 +00:00
kamil
d3dd6160fd Stop passing -D_INCOMPLETE_XOPEN_C063 (obsolete define) 2019-09-16 00:00:56 +00:00
bad
c0bd86dc55 Linux doesn't have paccept(). 2019-02-17 23:35:50 +00:00
bad
340a53cf8b compile hijack.c with -D_INCOMPLETE_XOPEN_C063 so that AT_FDCWD is alwasy
defined for rumpkernels.
2019-02-17 23:33:20 +00:00
hannken
650b07c895 Add an option "modctl" to capture modctl(). 2018-12-16 14:03:37 +00:00
ozaki-r
79209cd2af rumphijack: don't modify a cmsg on just validating it
Pointed out by k-goda@IIJ
2018-06-28 06:20:36 +00:00
ozaki-r
a9b3bb4d56 Provide better debug messages for ioctl 2017-10-23 06:52:17 +00:00
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