Commit Graph

14637 Commits

Author SHA1 Message Date
joerg
9674b81ed9 Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.
2011-02-22 05:45:05 +00:00
christos
10e6f9749d remove duplicate weak aliases 2011-02-21 22:07:44 +00:00
pooka
a63f48d68d If minfd for F_DUPFD is >= hijackoff, assume it means a minimum
value in the rump kernel and adjust accordingly.
2011-02-21 20:11:56 +00:00
pooka
b1f4a8807b disallow mmap(MAP_FILE) from a rump kernel fd 2011-02-21 13:19:35 +00:00
pooka
dc0a4e21dd Actually, we need both lseek and _lseek so that out-of-libc references
go to the right place instead of directly to __lseek.  Seeking in
mplayer works now.
2011-02-21 12:55:21 +00:00
pooka
463ea53fc5 hijack:
1) {,f,l}chflags (used e.g. by cp(1))
  2) p{read,write}{,v} (used by many)
2011-02-21 12:51:06 +00:00
pooka
611baabe1a xfer rump_server(1), downgrade experimentalness level a bit 2011-02-21 08:50:45 +00:00
pooka
aa7f369f19 v-node -> vnode
(for consistency)
2011-02-21 07:11:11 +00:00
joerg
4bf46019d9 Redo the SSP wrappers to be transparent on the resulting object files.
This works by having the inline wrapper calling a second function which
uses renaming to output the correct function name.
2011-02-21 00:40:07 +00:00
pooka
3c9255c1a2 fix tests/lib/librumphijack/t_asyncio:invafd -- dual poll on invalid fd 2011-02-20 23:47:04 +00:00
pooka
d9a5e73fe5 minor clarification 2011-02-20 14:21:04 +00:00
pooka
6d9d147305 fix symlink pathname examination (rationale-to-joerg: so that it works) 2011-02-19 19:17:33 +00:00
pooka
9c67a5d8a0 hijack __getcwd() 2011-02-19 13:10:35 +00:00
pooka
bfd70564a0 and now with less crazy whitespace 2011-02-19 13:09:40 +00:00
pooka
9cb130af6b support PF_OROUTE and PF_MPLS where available 2011-02-19 13:07:53 +00:00
joerg
e189b01ad3 Support the different weakref semantic in GCC 4.2 and clang. 2011-02-18 23:41:57 +00:00
joerg
86df96f692 Allow building with the changed weakref semantic in GCC 4.2 and clang. 2011-02-18 23:37:36 +00:00
christos
01d6c84859 PR/44599: Steven Vernon: libedit acts as if no data read if editmode is turned
off because nread is uninitialized in the edit disabled case.
2011-02-18 20:53:05 +00:00
pooka
5191458a1c hijack libc-internal name for lseek so that libc-internal callers
go to the right kernel too.
2011-02-18 19:27:06 +00:00
pooka
4674f09289 I think I skipped the class where they taught that multiplication
is done before addition...
2011-02-18 16:22:10 +00:00
pooka
f836d17195 Improve isrmt() check: it cannot be a rmt fd if there are no pipes
open for the fd.  Prevents collision with rumphijack.

Also, prevent potential hyperspace memory access.

Does someone want to write tests for this facility?
2011-02-18 16:10:09 +00:00
pooka
c0f2e1965c block cross-kernel rename in the other direction also 2011-02-18 14:44:46 +00:00
pooka
ff90450826 fix rename 2011-02-18 14:33:11 +00:00
pooka
b8883bd5ec uhm, put PF_LOCAL on the socketlist 2011-02-18 14:25:04 +00:00
pooka
0e29006e71 give the signmonkey a banana 2011-02-18 13:04:52 +00:00
pooka
c89b586dc4 Document .Ev RUMPHIJACK 2011-02-18 12:22:46 +00:00
pooka
45c58b6c6a Use the env variable RUMPHIJACK to specify what facilities should
be hijacked.  If it's not specified, the default is
"path=/rump,socket=all:nolocal".

So, if you're moof and want to relive your domain/os days (??),
you can do this:

pain-rustique:51:~> setenv RUMPHIJACK 'path=//'
pain-rustique:52:~> df //dev
Filesystem   1K-blocks       Used      Avail %Cap Mounted on
rumpfs                1          1          0 100% /
pain-rustique:53:~> df /dev
Filesystem   1K-blocks       Used      Avail %Cap Mounted on
/dev/wd0a       1019864     280640     688232  28% /
2011-02-18 11:41:32 +00:00
pooka
aedd7db813 Support rest of file types in vtype -> s_ifmt 2011-02-17 17:55:36 +00:00
pooka
7379975cf9 Support mount/unmount too. So, things are now generally at a stage
where you can mount a file system with a userspace server *without*
it having to go through puffs.

Say, you first start a server with ffs capability and map a host
ffs image into it:

	rump_server -lrumpvfs -lrumpfs_ffs \
	    -d key=/ffsimg,hostpath=ffs2.img,size=e unix:///tmp/ffsserv

Then, configure your shell to talk to the rump server:

	setenv RUMP_SERVER unix:///tmp/ffsserv
	setenv LD_PRELOAD /usr/lib/librumphijack.so

Create a mountpoint and mount the file system:

	pain-rustique:60:~> sh
	$ cd /rump
	$ ls
	dev
	$ ls -l
	total 1
	drwxr-xr-x  2 root  wheel  512 Feb 17 18:00 dev
	$ mkdir mnt
	$ mount_ffs /ffsimg /rump/mnt
	mount_ffs: Warning: realpath /ffsimg: No such file or directory
	$ df -h mnt
	Filesystem        Size       Used      Avail %Cap Mounted on
	/ffsimg           496M       380M        91M  80% /mnt
	$ du -sckh *
	192K    dev
	380M    mnt
	381M    total
	$ umount -R mnt
	$ df -h mnt
	Filesystem        Size       Used      Avail %Cap Mounted on
	rumpfs            1.0K       1.0K         0B 100% /
	$

(note, you need -R to umount due to various degrees of unsuccesful
magic it attempts to perform without it)
2011-02-17 17:18:08 +00:00
wiz
cd90032d22 Use more appropriate markup. Fix a typo. 2011-02-17 17:03:17 +00:00
joerg
6f7bc0c1ed Deal with changes in the weak_reference semantic in GCC 4.2 and later. 2011-02-17 16:44:48 +00:00
pooka
78bedf0f20 st_blocks is in units of DEV_BSIZE, not st_blksize.
from Derrik Pates
2011-02-17 15:41:34 +00:00
pooka
b4ff8b5f63 In case dup2(n, n+FDOFF) is done, the caller thinks there are two
distinct file descriptors, but the rump kernel thinks they are both
the same.  Now, if either one is closed by the application, "both"
will be closed in the rump kernel.  To fix this, maintain an
alias-mask.  It's not a perfect solution, though (consider e.g.
F_SETFL).  Maybe we should actually dup the fd and maintain a
mapping table?

Also, prevent the host from opening file descriptors onto the places
in the fd namespace that have been dupped.

These together fix "cat < /rump/foo" in a hijacked /bin/sh.
(the first one makes sure stdin is open in cat and the second one
makes sure it doesn't try to cat something from /usr/share/locale
instead of stdin)
2011-02-17 15:20:10 +00:00
pooka
df19bb20b9 fix signature. from pgoyette 2011-02-17 12:52:33 +00:00
pooka
4d5a38cb17 Hijack pathname-based system calls. Now all paths starting with
/rump are hijacked to go to the rump server.  So you can e.g. start
a hijacked shell and cd to /rump:

$ cd /rump
$ pwd
/rump
$ ls -l dev/null
crwxr-xr-x  1 root  wheel  2, 2 Feb 17 12:35 dev/null
$ ls -l /dev/null
crw-rw-rw-  1 root  wheel  2, 2 Dec 22  2009 /dev/null
$ chmod 0 /dev/null
chmod: /dev/null: Operation not permitted
$ chmod 0 dev/null
$ ls -l /rump/dev/null
c---------  1 root  wheel  2, 2 Feb 17 12:35 /rump/dev/null

(of course the rump server must have vfs loaded for that to work)
2011-02-17 12:23:58 +00:00
pooka
cd3bc9a153 sprinkle a few references (just a diet sprinkling really) 2011-02-16 23:51:50 +00:00
pooka
2e866e7646 add some excuse of a manpage for librumpclient 2011-02-16 23:45:40 +00:00
tron
aa934b7969 Include "sys/null.h" to get the definition of NULL. 2011-02-16 22:35:41 +00:00
tron
f1f20d6adf Fix build with SSP enabled. 2011-02-16 20:20:25 +00:00
pooka
f8af939582 fix signature of rumpclient_fork() 2011-02-16 19:58:01 +00:00
pooka
246da2148a document RUMPHIJACK_RETRYCONNECT 2011-02-16 19:46:42 +00:00
pooka
2e5776377c * set default server connection retry to 0 (no reconnection attempts).
while for some cases attempting retry after server restart works
  brilliantly (e.g. firefox), in other cases it's quite disasterous
  (sshd doesn't like its file descriptors going missing and does not
  attempt to reopen them, leading to a quite catastophic loop of
  EBADF once the server does come back)
* rename RUMPHIJACK_RETRY to the slightly more sensible
  RUMPHIJACK_RETRYCONNECT
2011-02-16 19:26:58 +00:00
pooka
36f6818061 Support vfork. Add rumpclient wrapper for daemon(3). 2011-02-16 17:56:46 +00:00
pooka
f4ba3dcd9e Push the fiddly tasks for exec and fork from rumphijack to rumpclient.
This makes it possible easily execute those operations also from
non-hijacked rump clients (plus fixes one memory leak in an error
branch).
2011-02-16 15:33:46 +00:00
christos
c464e0ebc5 Fix non-fortify build. 2011-02-15 16:29:09 +00:00
pooka
3129d3ab75 Cleanup server socket before sending back "ok" for halt. Fixes
some occasionally-seen race conditions in tests which do server
restarts (e.g. the raidframe tests).
2011-02-15 16:10:41 +00:00
pooka
172a314918 dup() is now implemented using fcntl() 2011-02-15 14:01:52 +00:00
pooka
8b62780ace Properly implement fcntl commands: F_DUPFD, F_CLOSEM, F_MAXFD 2011-02-15 13:59:28 +00:00
pooka
5e301bc45b support HANDSHAKE_EXEC 2011-02-15 10:37:07 +00:00
matt
9fbae4ec6b Add -D_KMEMUSER to CPPFLAGS 2011-02-14 18:27:24 +00:00