Mirror of most important branches of the main Sortix repository
Go to file
Jonas 'Sortie' Termansen 2e03bd94d3 Add protection against sigreturn oriented programming (SROP).
This change hardens against invalid calls to sigreturn, which is a very
useful gadget when compromising a process. The system call now verifies
it is a real return from a signal and aborts the process otherwise. This
should render such attacks impossible in threads that are not servicing a
signal, and infeasible in threads that are handling signals they are yet to
return from.

The kernel now keeps track for each thread how many signals are being
handled but haven't returned yet.

Each thread now has a random signal value. It is re-randomized when the
thread handles a signal and the current signal counter is zero. This is
xorred with the context address and used as canary on the stack during
signal dispatch, protecting the saved context on the stack. This works
mostly like the regular stack protector.

The kernel now keeps track of the stack pointer for a single handled
signal per thread. It doesn't seem worth it to keep track of multiple
handled signals, as more than one is rare. Note that each delivered signal
will not necessarily result in a sigreturn because it is valid for a thread
to longjmp(3) out of a signal handler to a valid jmp_buf.

The sigreturn system call will abort if either:

- It was not called from the kernel sigreturn page.
- The thread is not currently processing a signal.
- The thread is processing a single signal, and the stack pointer did not
  have the expected value.
- It fails to read the context on the stack.
- The canary is wrong.
2016-05-15 22:43:29 +02:00
bench Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
build-aux Remove compatibility with Sortix 0.9. 2016-05-15 01:31:48 +02:00
carray Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
disked Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
dispd Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
doc Add sysinstall(8), sysmerge(8), and sysupgrade(8). 2016-02-21 18:41:11 +01:00
editor Port the editor to non-sortix operating systems. 2016-05-15 22:43:29 +02:00
ext Fix handling of unmountable filesystems. 2016-03-26 16:07:22 +01:00
games Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
init Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
kblayout Add keyboard layout collection. 2015-12-19 02:21:15 +01:00
kblayout-compiler Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
kernel Add protection against sigreturn oriented programming (SROP). 2016-05-15 22:43:29 +02:00
libc Clean up errno. 2016-05-15 22:43:29 +02:00
libm Remove libm exec-include directory. 2016-01-25 17:39:57 +01:00
libmount Fix handling of unmountable filesystems. 2016-03-26 16:07:22 +01:00
login Make the branding system more neutral. 2016-05-15 22:43:29 +02:00
mkinitrd Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
regress Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sf Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
sh Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
share/man Fix missing punctuation in hier(7). 2016-05-15 19:30:51 +02:00
sysinstall Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
tix Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
trianglix Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
update-initrd Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
utils Remove uname -i and -o options. 2016-05-15 22:43:29 +02:00
.gitignore Remove non-existent directories from .gitignore. 2016-03-06 14:55:03 +01:00
LICENSE Relicense Sortix to the ISC license. 2016-03-05 22:21:50 +01:00
Makefile Remove compatibility with Sortix 0.9. 2016-05-15 01:31:48 +02:00
README Update README for the 1.0 release. 2016-03-06 23:06:46 +01:00

README

The Sortix Operating System
===========================

Sortix is a small self-hosting operating-system aiming to be a clean and modern
POSIX implementation.  It is a hobbyist operating system written from scratch
with its own base system, including kernel and standard library, as well as
ports of third party software.  It has a straightforward installer and is can be
developed under itself.  Releases come with the source code in /src, ready for
tinkering.

It has been in development since 2011 by a single developer and contributors.
Though the system is stable and capable right now, it is still early in
development, and a number of crucial features haven't been made yet.  Releases
are made yearly and future releases will add features such as networking, SMP,
and USB that were skipped in favor of becoming self-hosting now.

Documentation
-------------

The system is documented as manual pages.  Introductory system usage is covered
in the user-guide(7) manual page.

Links
-----

For more information, please visit the official website:

  https://sortix.org/

Building Sortix
---------------

Development of Sortix under itself is covered in development(7).

Development from another operating system is covered in cross-development(7).

You can view the cross-development(7) manual page with this command:

  man share/man/man7/cross-development.7

License
-------

Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.

Sortix is free software licensed under the ISC license as described in the
LICENSE file.  It also contains permissively licensed code from other projects.