| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\ |
|
| |\
| | |
| | | |
fix ordering cycle with private tmp
|
| | | |
|
| |\ \
| | | |
| | | | |
Add GitHub Actions continuous integration script
|
| | |/ |
|
|/ / |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|\ |
|
| |\
| | |
| | | |
configure.ac: Bump soname (1.9.7 contained an ABI-breaking change)
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
haveged.service: Tighten-down security settings
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- ProtectHome: Prevent access to /home, /root, /run/user.
- ProtectHostname: Forbid the service from changing the current hostname.
- ProtectKernelLogs: Forbid the service from overwriting the klog ring buffer.
- ProtectKernelModules: Forbid loading and unloading kernel modules.
The last 3 are particularly relevant, as haveged requires CAP_SYS_ADMIN
through its use of ioctl(2).
|
| | | |
|
| | |
| | |
| | |
| | | |
No capabilities(7) are granted through execve(2); this setting cannot be undone.
|
|\ \ \
| | | |
| | | | |
don't use SOCK_CLOEXEC or SOCK_NONBLOCK if not available
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Avoids these errors:
havegecmd.c: In function ‘cmd_listen’:
havegecmd.c:105: error: ‘SOCK_CLOEXEC’ undeclared (first use in this function)
havegecmd.c:105: error: (Each undeclared identifier is reported only once
havegecmd.c:105: error: for each function it appears in.)
havegecmd.c:105: error: ‘SOCK_NONBLOCK’ undeclared (first use in this function)
havegecmd.c: In function ‘cmd_connect’:
havegecmd.c:154: error: ‘SOCK_CLOEXEC’ undeclared (first use in this function)
havegecmd.c:154: error: ‘SOCK_NONBLOCK’ undeclared (first use in this function)
|
|\ \ \
| | | |
| | | | |
haveged: fix crash on shutdown in threaded mode
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The bug happens when havege is built with --enable-threads.
On shutdown the following crash happens:
```
3109 p = mem2chunk (mem);
(gdb) bt
#0 __GI___libc_free (mem=0x7f630c066000) at malloc.c:3109
#1 0x00007f630c035f9e in havege_destroy (hptr=0x564b56b6b900) at havege.c:197
#2 0x0000564b561c3dca in error_exit (format=<optimized out>) at haveged.c:708
#3 0x0000564b561c33f1 in run_daemon (argv=0x7ffce7627758, path=0x564b56b6b2a0
```
valgrind helped me to understand it was a mmap() / free()
mismatch:
```
For lists of detected and suppressed errors, rerun with: -s
ERROR SUMMARY: 14 errors from 2 contexts (suppressed: 0 from 0)
Invalid free() / delete / delete[] / realloc()
at 0x48389CB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x48AED9F: havege_destroy (havege.c:197)
by 0x10BCA5: error_exit (haveged.c:708)
by 0x10B1B7: run_daemon (haveged.c:573)
by 0x10B1B7: main (haveged.c:470)
Address 0x4845000 is in a rw- anonymous segment
```
It happens due to a few factors:
1. havege is built in threaded mode, there parent pid is stored in shared
memory and is expected to free resources.
2. havege is ran in daemon mode, that means havege changes pid when detaches
from terminal with daemon().
Combination of [1.] and [2.] causes main process to avoid munmap()
and inctead fallback to free() at:
```c
void havege_destroy(H_PTR hptr)
{
...
if (!havege_exit(hptr)) // <- here incorrect pid-based detection happens
return;
if (0 != (temp=hptr->io_buf)) {
hptr->io_buf = 0;
free(temp); // <--- here free() happens
}
```
The change adds a helper to update parent pid with `havege_reparent` helper.
It might not be a very clean fix, but it should be good enough to illustrate
the problem.
Bug: https://bugs.gentoo.org/720286
Reported-by: Marcin Mirosław
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|\ \ \
| |/ /
|/| | |
Use POSIX shell comparison for equality
|
|/ / |
|
|\ \
| |/
|/| |
build: Fix compilation with --enable-threads
|
|/
|
|
|
|
|
|
|
|
|
| |
Previously failed with:
havegetune.c:190:12: error: ‘BUILD_THREAD’ undeclared (first use in this function); did you mean ‘BUILD_THREADS’?
190 | *bp++ = BUILD_THREAD;
| ^~~~~~~~~~~~
| BUILD_THREADS
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Service file updates
|
| |
| |
| |
| |
| | |
This is required when starting in early userspace, for example booting
without initramfs.
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
fix segv at start
|