doesn't complain when it's implicitly converted to plain char in an
assignment, and to make sure it's not negative when used as an array index.
ok miod@
call a setjmp-type function (protyped with __attribute__((returns_twice)).
LLVM anticipates the longjmp type function will perform a direct branch
back (rather of a push;ret combo, almost certainly due to CET
shadow-stack coherency difficulties). Since we have CET/IBT enforced,
LLVM makes that direct branch legal by placing an endbr64 immediately
after the callq. Where I was placing the ret-clean sequence... this blows
up badly, in unhibernate / resume situations.
In the Functions marked exposesReturnsTwice(), skip doing ret-clean.
(placing the ret-clear after that endbr64 is much more difficult)
observed by mglocker, diagnosed by mlarkin, kettenis, guenther.
This causes the caller to cleans the return address off the stack after
a callq completes. The option is best used in low-level libraries (such as
libc), because libc contains low-level system call stubs. The option
reduces hints (found on the stale parts of the stack) about libc.so's mapping
location, and together with random-relinking, relro got/pic, and xonly
makes some exploit methods more difficult.
ok mortimer, mlarkin, much discussion with kettenis, in snaps for 2 weeks.
This causes the caller to cleans the return address off the stack after
a callq completes. The option is best used in low-level libraries (such as
libc), because libc contains low-level system call stubs. The option
reduces hints (found on the stale parts of the stack) about libc.so's mapping
location, and together with random-relinking, relro got/pic, and xonly
makes some exploit methods more difficult.
ok mortimer, mlarkin, much discussion with kettenis, in snaps for 2 weeks.
When calling POSIX::setlocale() with unknown locale category, Perl
could crash due to NULL dereference.
found by sthen@ in smokeping build; OK afresh1@
Ever since the prehistoric zlib was removed last fall, the configure script
would complain because of a missing file:
sed: 0: /usr/src/gnu/usr.bin/cvs/zlib/Makefile.in: No such file or directory
noticed by deraadt
ok bluhm
.openbsd.syscalls section with the PT_OPENBSD_SYSCALLS phdr, even though is
does not have the ALLOC flag; otherwise the phdr gets rewritten with a size
of zero, which prevents the binary from working.
ok kettenis@
clang -S was missing a line like ".cfi_offset cr2, -16" in functions
that spill cr2 (or cr3, cr4) to the stack. This was breaking a few
C++ exceptions. This fix adds the missing CFI.
This will fix the C++ exception that was crashing egdb from
ports/devel/gdb when you did "q to quit" in the pager.
ok kettenis@ tobhe@
things are going, it will take another decade before it does. But OpenBSD
has it enabled *by default* already.
Drop the #ifdef __linux__. This should hurt other OSes when they finally
catch up with us.
ok robert@, tb@
provide a mitigation against branch speculation attacks, they also make
IBT control flow integrity less effective. Our kernel now uses IBPB to
as a mitigation against branch speculation attacks, so we can disable
retpoline PLTs again.
ok deraadt@
Upstream commit:
9d37ea95df
Already needed at least by ports/math/hdf5, prerequisite if we want to
enable linker relaxation (clang upstream defaults).
ok kettenis@
ctype_base.h is correctly installed by make includes so the transition should
be automatic. If you hit a failure with this header, make sure ctype.h and
ctype_base.h are in sync.
ok miod@ tb@
repoline PLT entries that were changed to include the necessary endbr64
instructions. But with -Wl,-znoretpolineplt we would still emit non-BIT
PLT entries under certain circumstances. Fix this.
ok deraadt@, guenther@
first six entries are in the same order as syscall arguments, such
that syscall() can just use the trapframe as the argument vector
for mi_syscall() and not need to reorder into another buffer on the
stack. This doesn't affect coredump layout or ptrace(2), but does
affect kernel crash dumps.
Possibility noted during miod@'s cleanup of the MD syscall()
implementations
ok mlarkin@ kurt@