| Age | Commit message (Collapse) | Author | 
|---|
|  | X-Gentoo-Bug:376977
X-Gentoo-Bug-URL:https://bugs.gentoo.org/show_bug.cgi?id=376977 | 
|  | How to reproduce 1-byte overflow:
```
$ FEATURES=-test CFLAGS="-fsanitize=address -O0 -ggdb3" emerge -1 openrc
=================================================================
==1==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff0efd8710
    at pc 0x000000402076 bp 0x7fff0efd7d50 sp 0x7fff0efd7d40
WRITE of size 1 at 0x7fff0efd8710 thread T0
    #0 0x402075  (/sbin/openrc-init+0x402075)
    #1 0x3cf6e2070f in __libc_start_main (/lib64/libc.so.6+0x3cf6e2070f)
    #2 0x4013b8  (/sbin/openrc-init+0x4013b8)
Address 0x7fff0efd8710 is located in stack of thread T0 at offset 2432 in frame
    #0 0x401cfb  (/sbin/openrc-init+0x401cfb)
  This frame has 3 object(s):
    [32, 160) 'signals'
    [192, 344) 'sa'
    [384, 2432) 'buf' <== Memory access at offset 2432 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow ??:0 ??
```
The problem here is in the code handling reads from 'init.ctl':
```
int main(int argc, char **argv) {
...
    char buf[2048];
    for (;;) {
        /* This will block until a command is sent down the pipe... */
        fifo = fopen(RC_INIT_FIFO, "r");
        count = fread(buf, 1, 2048, fifo);
        buf[count] = 0;
        ...
    }
```
`buf[count] = 0;` writes outside the buffer when `fread()` returns non-truncated read.
This fixes #138. | 
|  | Avoids issues with missing prototypes causing truncation of pointers.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> | 
|  | Only close the log if we successfully opened it.
Reported-by: Brian Evans <grknight@gentoo.org>
Tested-by: Brian Evans <grknight@gentoo.org>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> | 
|  | X-Gentoo-Bug: 618888
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=618888 | 
|  |  | 
|  | To be more compatible with sysvinit, move to single user mode if no
options are specified on the command line. | 
|  |  | 
|  | This is similar to the sysvinit killall5 utility.  It should only be used
in service scripts, so it will not be installed in the path.
This closes #129. | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | rc-status now shows the amount of time a supervised daemon has been
active as well as the number of times it has been respawned during the
current respawn period. | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | This will allow rc-status to display an uptime and restart count for
supervised processes. | 
|  |  | 
|  | This creates --respawn-delay, --respawn-max and --respawn-period. It was
suggested that it would be easier to follow if the options were
separated.
This is for #126. | 
|  | Allow limiting the number of times supervise-daemon will attempt to respawn a
daemon once it has died to prevent infinite respawning. Also, set a
reasonable default limit (10 times in a 5 second period).
This is for issue #126. | 
|  |  | 
|  |  | 
|  | Both the child and supervisor need access to these file descriptors. | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  |  | 
|  | The only signals we handle are SIGINT and SIGCHLD, so block all others
and unblock them in the child process before we start a rurnlevel. | 
|  | This will allow the re-execution of the init process after upgrading
OpenRC. | 
|  | File /var/run/ld-elf32.so.hints is used on FreeBSD 64bit multilib
This fixes #125. | 
|  |  | 
|  | openrc-init.c and openrc-shutdown.c are based on code which was written by
James Hammons <jlhamm@acm.org>, so I would like to publically
thank him for his work. | 
|  |  | 
|  | This fixes #122 | 
|  |  | 
|  | killprocs always succeeds and savecache is not required by mount-ro, so
we can just start after both of these have run. | 
|  |  | 
|  |  | 
|  | We do not need to care about the path on the shebang line of a service
script as long as the shebang line ends with "openrc-run".
This fixes #119 and #120. | 
|  | The clock services had a very long list of "before" dependencies that
referred to other services within OpenRC. For ease of maintenance,
convert these to "after clock" dependencies in the individual services. | 
|  |  | 
|  | Using wildcards in dependencies causes issues when rc_parallel is set to
yes because it can lead to deadlocks.
All dependencies need to be explicit rather than implicit.
This is the first stage of moving this direction. | 
|  | Since we check for /sys/firmware/efi/efivars, we do not need to check
for /sys/firmware/efi
Since Failing to mount efivarfs is not critical, we silence the error
message from mount. | 
|  |  | 
|  |  | 
|  | The agetty service is an alternate way to manage gettys with agetty
under Linux which is separate from an external init system. | 
|  | This is for #112. |