Commit Graph

2238 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 0e32284417 Fix 'is can' typo in README. 2016-10-01 14:52:09 +02:00
Ralph Holmes 5d774cce1d Fix execl(3) sentinel undefined behaviour.
execl(3) and its variants use a sentinel to terminate the variadic
argument list, in the form of a null pointer constant of type pointer to
char. POSIX mandates that NULL is a null pointer constant of type
pointer to void, which is not of an equivalent type to that required by
execl(3) and its variants, resulting in undefined behaviour.

This commit casts all such instances of NULL to pointer to char type.
For consistency, it also adds const-qualification to any such instances
which had already been casted, and were not const-qualified.
2016-09-30 23:36:49 +02:00
rocketpenguin1 6907109b7e Add -l option to chkblayout(1). 2016-09-30 17:03:29 +02:00
Nicholas De Nova a911476f59 Add readlink(1). 2016-09-29 20:10:58 -05:00
Jonas 'Sortie' Termansen 1a87b2f580 Add suggestion to use vim(1) if installed. 2016-09-29 00:01:41 +02:00
Jonas 'Sortie' Termansen a97e1ef16c Modernize carray(1) and fix missing allocation checks.
Add short options for most long options. Rename the -i option to -H, but
support -i for compatibility until the next release cycle, where -i will
become the short option of --identifier. Rename --include to --headers
and support --include until the next release cycle.

Add carray(1) manual page which makes --help unnecessary, and remove
--version as it surely matches your local Sortix version.
2016-09-29 00:01:41 +02:00
Jonas 'Sortie' Termansen 848eaaf593 Port build utilities to musl. 2016-09-29 00:01:40 +02:00
Jonas 'Sortie' Termansen 91a6ee7919 Add 24-bit graphics support to kernel. 2016-09-28 20:29:18 +02:00
Jonas 'Sortie' Termansen bc1344dacf Document clock(3) as obsolete. 2016-09-28 20:29:17 +02:00
Jonas 'Sortie' Termansen c8487ff12b Fix readlinkat(2) return value truncation. 2016-09-28 20:15:36 +02:00
Jonas 'Sortie' Termansen 394d3d7115 Fix kernel not using BRAND_DEFAULT_HOSTNAME. 2016-09-28 20:15:36 +02:00
Nicholas De Nova 6e16a2036e Add tee(1). 2016-09-25 20:07:27 -05:00
Jonas 'Sortie' Termansen 0756a7ee96 Add scanf(3) %n support. 2016-09-25 22:28:18 +02:00
Jonas 'Sortie' Termansen 0e78aec1c3 Fix console scrolling bottleneck. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 4f60e65f83 Fix cross-compilation-sins x86-64_sortix typo. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen c01fcd36c3 Fix double fsck in sysupgrade(8). 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 3831d99149 Fix sysupgrade(8) copyright. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 967c5b57d5 Fix advice/advise typos. 2016-09-25 22:27:07 +02:00
Jonas 'Sortie' Termansen c195784736 Fix sysmerge(8) out of bounds accesses and error messages. 2016-08-23 00:30:41 +02:00
Jonas 'Sortie' Termansen f28fc4ac39 Fix non-blocking recv(2) and send(2). 2016-08-22 01:47:31 +02:00
Jonas 'Sortie' Termansen 8ec5d9af44 Fix linked list and shadowing bugs in kernel clock and timer code. 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen e962f5e4cc Fix use after free in getaddrinfo(3) error case. 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen 46fbe3ec0d Fix non-relative path in sysupgrade(8). 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen 47b53f1aab Fix missing word in sysupgrade(8) error message. 2016-08-21 00:04:26 +02:00
Jonas 'Sortie' Termansen 2b6463aa95 Fix drivers not detecting PCI devices without an interrupt line. 2016-08-21 00:03:58 +02:00
Jonas 'Sortie' Termansen da89dec2e2 Fix AHCI port IDENTIFY timeout taking 10 seconds. 2016-08-21 00:03:57 +02:00
Jonas 'Sortie' Termansen 8f81f990f8 Fix undefined stack register after switch into long mode.
Thanks to dminuoso for pointing out the issue.
2016-07-29 15:20:05 +02:00
Jonas 'Sortie' Termansen 2141c95621 Fix sysupgrade(8) downgrade detection. 2016-07-29 15:20:05 +02:00
Jonas 'Sortie' Termansen 1dbd1f760a Fix missing validation of program entry points. 2016-07-29 15:20:04 +02:00
Jonas 'Sortie' Termansen b54e09ebaf Improve cross-development(7). 2016-07-23 23:30:33 +02:00
Jonas 'Sortie' Termansen 92106d4d34 Remove unnecessary tix gitignore entry. 2016-07-23 22:13:39 +02:00
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
Jonas 'Sortie' Termansen 9b98679885 Clean up errno. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 01a9779fc6 Compile libc with -ffreestanding.
This properly avoids problems where the compiler is unaware that this is the
implementation and assumes it can rely on the implementation. For instance,
it might implement calloc using a call to calloc.

Restructure the code that wrongly assumed __STDC_HOSTED__ meant userspace.
2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 1ca1a068a1 Make the branding system more neutral. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 264805a4aa Remove uname -i and -o options.
These are unportable GNU extensions that's not needed for Sortix.
2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen e4a3bb997b Check overflow in expr(1). 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 2a6a246ff4 Remove getdomainname(2). 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 1ef3c31f81 Clean up alloca.h header. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen e5ed21520c Port the editor to non-sortix operating systems. 2016-05-15 22:43:29 +02:00
Jonas 'Sortie' Termansen 63146072a4 Fix getline(3) and getdelim(3) usage. 2016-05-15 19:32:04 +02:00
Jonas 'Sortie' Termansen 8d5599ba59 Fix shift out of bounds in fnmatch(3). 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen 1fde4430fb Fix missing punctuation in hier(7). 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen f6cc06fbd1 Fix bsearch(3) performance. 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen 1826fc32cd Fix signal delivery stack alignment. 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen d9bb6da811 Fix pthread stack alignment. 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen a80bc5d011 Fix sysmerge(8) and sysupgrade(8) /etc/sortix-release error handling. 2016-05-15 01:31:48 +02:00
Jonas 'Sortie' Termansen 9995df3638 Fix use after free and memory leaks in init(8).
Thanks to Tiago Silva and Shiz for noticing these issues.
2016-05-15 01:31:48 +02:00
Jonas 'Sortie' Termansen e69565fd15 Remove compatibility with Sortix 0.9. 2016-05-15 01:31:48 +02:00
Jonas 'Sortie' Termansen f3d77725d2 Begin development of Sortix 1.1. 2016-04-04 02:36:03 +02:00