Commit Graph

16 Commits

Author SHA1 Message Date
pooka 5064fa59e6 A bunch of improvements:
* don't hold spc mutex while sending data
* use send() for the banner to avoid SIGPIPE in case a client
  connects and immediately goes away
* fix error path locking
* use kevent() instead of pollts() in the client.  Apparently that
  is the only sensible way for a library to support both multithreading
  and signal-reentrancy in a race-free manner.
  (can I catch all signals with one kevent instead of installing
  NSIG different ones??)
* mark client comm descriptor non-blocking so that clients have
  better signal-interruptibility (we now sleep in signal-accepting
  kevent() instead of signal-masked recvfrom())
2011-01-10 19:49:43 +00:00
pooka 55d21df89f Separate rw_data and rw_done. Otherwise we don't get wakeups for
requests which have a 0-length response (such as copyin 0/0).

This change makes links(1) work against a rump kernel which contains
rumpnet_local.  The presence of unix domain sockets caused links
to select() with 0 fds and a timeout, and because copyin never woke
up in the kernel the application blocked indefinitely.
2011-01-09 14:10:03 +00:00
pooka 91aad9bd60 Make rumpclient impervious to LD_PRELOAD syscall hijacking by using
dlsym(RTLD_NEXT) to lookup a host_syscall() function pointer which
is used instead of syscall() to communicate with the kernel server.

WARNING: popular opinion classifies this as "ugly code".  if you
have a weak heart/mind/soul/sole meuniere, read max. 1 line of the
diff per day, preferably with food.
2011-01-07 19:37:51 +00:00
pooka c45d9404c0 Make rumpclient syscalls safe to call from signal handlers. 2011-01-06 06:57:14 +00:00
pooka fd993ea3d0 Support fork() for rumpclient users. 2011-01-05 17:14:50 +00:00
pooka 393eecc12a Have the client and server perform some sort of handshake first.
It's pretty much a placeholder for now.  One plan for the future
is to require some sort of authentication for superuser clients.
The code will need a little massage then, though, to prevent DoS
attacks.
2010-12-16 17:05:44 +00:00
pooka 3c4a27f7cd Print a banner a connecting client. The banner contains rump sp
protocol version, os name, os revision and machine.
2010-12-16 12:38:20 +00:00
pooka cc95cda0d4 lintsquelch 2010-11-30 22:30:43 +00:00
pooka fbdc3da9ae Change RUMP_SP_CLIENT to RUMP_SERVER. The former was, in addition
to being annoying to write, slightly misguiding, since it contains
the server url.
2010-11-30 14:24:40 +00:00
pooka d402686fe2 Remove remaining panic()s from server-side code. Also, allow to
send an out-of-band error.  Make the client retry syscall requests
if this error is EAGAIN, fail them otherwise.
2010-11-29 16:08:03 +00:00
pooka 6b71288c49 *facepalm*, adjust remote copyinstr to work in cases where the end
of the max copyin extends to an unmapped page.

Noticed, as usual, by tests.
2010-11-25 17:59:02 +00:00
pooka 5e5fac56c7 update locking proto, use unputwait 2010-11-24 17:03:39 +00:00
pooka 85503d7b13 Install rumpclient to /lib to allow non-/usr users.
pointed out by tron (thanks!)
2010-11-23 12:41:47 +00:00
pooka 52f22b2c6a Start working on making the syscall proxy code threadsafe. The
basics are there, but a few more tweaks are needed.  The reason
I'm committing it now is that the code was mindnumbingly boring to
write (no wonder it took me almost 3 years to get it done), and I
might burn it if it's not in a safe place.
2010-11-19 15:25:49 +00:00
pooka 83463bddd0 use -1/errno for failure: it's much more convenient for the users 2010-11-05 13:50:48 +00:00
pooka 6b1f3dc0a5 Add library for rump syscall client stubs. 2010-11-04 21:01:28 +00:00