minix/etc
David van Moolenbroek e4d99eb9b0 Basic live rerandomization infrastructure
This commits adds a basic infrastructure to support Address Space
Randomization (ASR).  In a nutshell, using the already imported ASR
LLVM pass, multiple versions can be generated for the same system
service, each with a randomized, different address space layout.
Combined with the magic instrumentation for state transfer, a system
service can be live updated into another ASR-randomized version at
runtime, thus providing live rerandomization.

Since MINIX3 is not yet capable of running LLVM linker passes, the
ASR-randomized service binaries have to be pregenerated during
crosscompilation.  These pregenerated binaries can then be cycled
through at runtime.  This patch provides the basic proof-of-concept
infrastructure for both these parts.

In order to support pregeneration, the clientctl host script has
been extended with a "buildasr" command.  It is to be used after
building the entire system with bitcode and magic support, and will
produce a given number of ASR-randomized versions of all system
services.  These services are placed in /usr/service/asr in the
image that is generated as final step by the "buildasr" command.

In order to support runtime updating, a new update_asr(8) command
has been added to MINIX3.  This command attempts to live-update the
running system services into their next ASR-randomized versions.
For now, this command is not run automatically, and thus must be
invoked manually.

Technical notes:

- For various reasons, magic instrumentation is x86-only for now,
  and ASR functionality is therefore to be used on x86 only as well.
- The ASR-randomized binaries are placed in numbered subdirectories
  so as not to have to change their actual program names, which are
  assumed to be static in various places (system.conf, procfs).
- The root partition is typically too small to contain all the
  produced binaries, which is why we introduce /usr/service.  There
  is a symlink from /service/asr to /usr/service/asr for no other
  reason than to let userland continue to assume that all services
  are reachable through /service.
- The ASR count field (r_asr_count/ASRcount) maintained by RS is not
  used within RS in any way; it is only passed through procfs to
  userland in order to allow update_asr(8) to keep track of which
  version is currently loaded without having to maintain own state.
- Ideally, pre-instrumentation linking of a service would remove all
  its randomized versions.  Currently, the user is assumed not to
  perform ASR instrumentation and then recompile system services
  without performing ASR instrumentation again, as the randomized
  binaries included in the image would then be stale.  This aspect
  has to be improved later.
- Various other issues are flagged in the comments of the various
  parts of this patch.

Change-Id: I093ad57f31c18305591f64b2d491272288aa0937
2015-09-17 17:15:03 +00:00
..
defaults Move all services to /service 2014-07-31 16:00:31 +02:00
devmand Much USB code for ARM USB support 2014-08-29 18:52:49 +02:00
fonts
mtree Basic live rerandomization infrastructure 2015-09-17 17:15:03 +00:00
rc.capes Move all services to /service 2014-07-31 16:00:31 +02:00
root Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
skel Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
usr Add PTYFS, Unix98 pseudo terminal support 2015-06-23 17:43:46 +00:00
boot.cfg.default some small changes 2014-08-28 18:49:03 +02:00
crontab
csh.cshrc Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
csh.login Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
csh.logout Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
gettytab big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
group
hostname.file
inet.conf
Makefile Basic live rerandomization infrastructure 2015-09-17 17:15:03 +00:00
Makefile.params Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
man.conf Update whatis/apropos database configuration 2015-03-23 11:11:49 +01:00
master.passwd Removing /home/bin 2014-08-07 14:01:30 +02:00
mk.conf
motd Set the motd to point to a wiki page. 2014-09-13 23:56:50 +02:00
newfstab.sh
profile Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
protocols Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
rc rs: Update recovery policies for sched and mfs. 2015-09-17 13:34:59 +00:00
rc.cd
rc.conf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
rc.daemons.dist Importing libexec/fingerd 2013-06-02 08:14:05 -04:00
rc.shutdown big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
rc.subr Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
resolv.conf
rs.inet rs: New RS. 2015-09-16 15:30:48 +00:00
rs.single
services Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
shells Add /bin/false to /etc/shells 2014-07-28 17:05:22 +02:00
shrc Import NetBSD shell environment files 2014-11-10 16:48:56 +01:00
syslog.conf Import NetBSD syslogd(8) 2015-07-26 11:57:04 +00:00
system.conf RS/VM: proper preparation for multi-VM live update 2015-09-17 14:01:06 +00:00
termcap
termcap.big
ttys big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
utmp