Commit graph

20 commits

Author SHA1 Message Date
David van Moolenbroek 93d36fc9d8 Import NetBSD rcmd, rcp, rsh, rshd
Change-Id: I83d908bbe17f04826e9b5c3a220a5bb2c3a51c80
2015-09-23 12:03:06 +00:00
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
David van Moolenbroek 3e07920fe2 Import NetBSD syslogd(8)
The primary reason for the import is a likely GPL taint of the
original MINIX3 syslogd.  As a result, this import may still
have some rough edges.

Change-Id: I5c8d26eca10fc2dd50ecc9eab44a1d483cf068a9
2015-07-26 11:57:04 +00:00
Jacob Adams c19d619d42 Importing bin/dd
Change-Id: Ibdfed821aa834419c9713dc80f698c8ed74ff269
2015-04-15 13:50:57 +02:00
Thomas Cort 93cdb3a735 mined: move to minix/usr.bin/mined
As suggested in issue #43.

Historic Locations:

Prior to this commit

  minix/commands/mined

Prior to commit 433d6423c3

  commands

Change-Id: I374ab3ff0e3b9e47779fc21e80b47fda87698242
2015-03-28 08:39:10 +01:00
Sky Liu ca78167b44 Porting grep from NetBSD
Change-Id: I6fa9e3c0a4edc4d3ff292dc5c96ac16b34d7c792
2014-09-24 15:33:57 +02:00
Sky Liu 2fde3a4846 Porting uuencode/uudecode from NetBSD
Lionel: I fixed small mistakes in the mi file, typos, missing keywords,
        and whitespace fixes.

Change-Id: If0c04b923af328838f2d0950e189bf28995bc0f0
2014-09-08 19:51:28 +02:00
Ben Gras a4d4ce4adb retire unstack & datasizes in favour of addr2line
Change-Id: Ibf5db75f3358c3c0bf81ca211a6602b333af0473
2014-09-03 19:14:13 +02:00
Lionel Sambuc d90bee9749 Importing bin/sh
/etc/profile enables by default tabcompletion, as well as emacs mode,
in order to keep the old MINIX ash behavior.

Note: The shell now refuses to source a script without a relative or
      absolute path.
      This means:
        - '. myscript.sh' fails, while
        - '. ./myscript.sh' succeeds

Change-Id: I0be89b0747bd005e4c05cadb937af86883627dc6
2014-08-29 12:56:04 -04:00
Lionel Sambuc ae8b65444d commands/test: removed
Change-Id: I5557eb2116d23c466ce82f1c8c9d18590316a0d0
2014-08-21 18:33:23 +02:00
Lionel Sambuc d4c5f15a03 commands/expr: removed
Change-Id: I374f162959c6e0d708c7b1bd66f2c7a4346c097a
2014-08-21 18:33:23 +02:00
Lionel Sambuc 5b03ef0598 commands/command: removed
Change-Id: I90d57681e7bcabebff323f27af57bab108fa6d4d
2014-08-21 18:33:23 +02:00
Lionel Sambuc 4f88696945 commands/wait: removed
Change-Id: Ie712ec86ef9bbdeffb2fafb51b64600bd118d1e2
2014-08-21 18:33:22 +02:00
Lionel Sambuc 09012edc2b commands/read: removed
Change-Id: Iaa24bb634b31932f793f02c4df10b48030ab70a0
2014-08-21 18:33:22 +02:00
Lionel Sambuc c6284ef73d commands/umask: removed
Change-Id: I0e09cd3e311dad61e72989262fef037759ae9d5d
2014-08-21 18:33:22 +02:00
Lionel Sambuc 3aa3cee7d5 commands/cd: removed
Change-Id: I438c1dfc778e23131fbd0ee1246abfb7df9437f3
2014-08-21 18:33:22 +02:00
Lionel Sambuc 594136a126 commands/getopts: removed
Change-Id: Idc9ec425749a76e2664906f2483be6071273507f
2014-08-21 18:33:21 +02:00
Ben Gras 7f5f010bbd netbsd ping & traceroute
. remove minix ping
	. add support for socket(AF_INET, SOCK_RAW, {IPPROTO_ICMP,IPPROTO_UDP})
	. gives test48 a better chance of detecting network connectivity

Change-Id: Ia678546d27ac378642f1160a141e1fc33458cce2
2014-08-21 08:07:39 -04:00
Lionel Sambuc aea6d8c922 Introduce pkgin_sets
This tool allow you to install one or more predefined package sets.

Change-Id: Id21c9e9fbd43f44f2d3b040961411428e1ae0af9
2014-08-13 16:42:57 +02:00
Lionel Sambuc 433d6423c3 New sources layout
Change-Id: Ic716f336b7071063997cf5b4dae6d50e0b4631e9
2014-07-31 16:00:30 +02:00
Renamed from commands/Makefile (Browse further)