1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00
Commit Graph

4494 Commits

Author SHA1 Message Date
jca
03fc72bb76 Install riscv_vector.h
Used at least by ports/news/nzbget

ok kettenis@
2024-12-17 13:22:38 +00:00
anton
009b798eb1 Add support for read/write of xmm/ymm registers to lldb.
ok kettenis@, robert@
2024-11-29 18:54:39 +00:00
asou
dd517d5d67 Correct display stack pointer of the kernel core. From Yuichiro NAITO.
ok asou
2024-10-31 07:37:35 +00:00
asou
2372b7954f Fix lldb doesn't analyze process core correctly.
ok kettenis@
2024-10-21 05:18:17 +00:00
tb
a3ee596dd5 gdb: fix path to ex
from Nir Lichtman
ok pascal sthen
(they okayed the ports version which I take to be an agreement with this).
2024-09-20 11:41:15 +00:00
asou
6e92fa473c lldb: shut up the warning message on quit debugging kernel core file.
The diff from Yuichiro NAITO.

ok yasuoka
2024-08-22 08:22:13 +00:00
deraadt
d8872685c9 fix comment 2024-08-18 20:14:49 +00:00
guenther
3ed9484fbb Cast to unsigned char after or'ing in the meta bit, so the compiler
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@
2024-08-16 23:09:25 +00:00
guenther
f06e49141d Delete duplicated x{m,re}alloc() declarations and add argument types
to a function pointer definition.

ok miod@
2024-08-16 22:58:54 +00:00
guenther
2aa28d40be Delete bogus test of array being NULL
ok miod@
2024-08-16 22:57:44 +00:00
guenther
626a044d7e strn?casecmp() config bits were incomplete. We have them so
just delete the bogus declarations.  Also, getopt() is in <unistd.h>
so pull that in during the remapping of it.

ok miod@
2024-08-16 22:57:03 +00:00
guenther
82ba5b1992 Fix precedence lossage reported by clang that results in
bad buffer size.

ok miod@
2024-08-16 22:53:32 +00:00
anton
2df0ffa88b Allow our linker warnings regarding misuse of libc functions to be
elevated to errors using the -Wl,--fatal-warnings option.

ok robert@
2024-08-05 06:11:42 +00:00
asou
ed4f4290d7 Possible to read the core file of a process. 2024-08-01 01:43:08 +00:00
asou
513cf72f82 Implement investigate kernel corefile to lldb. 2024-07-13 07:25:38 +00:00
mglocker
f27a193219 Fix typo in last commits comment. 2024-06-08 16:05:23 +00:00
deraadt
c066606085 Inside LLVM, Functions become marked with exposesReturnsTwice() if they
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.
2024-06-07 05:16:32 +00:00
deraadt
140e38acaf add -fret-clean option (amd64 and i386 only at first), defaulting to off.
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.
2024-06-02 15:42:19 +00:00
deraadt
896063e4d9 add -fret-clean option (amd64 and i386 only at first), defaulting to off.
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.
2024-06-02 15:40:38 +00:00
miod
776d575243 Remove target getting in the way of config.status and causing compilation
failure when using make -j; this used to be hidden because of the objective-C
generated files, which are no longer built. No change for regular make.
2024-05-24 16:44:12 +00:00
bluhm
d635388b71 Fix possible segmentation fault in Perl 5.38.2.
When calling POSIX::setlocale() with unknown locale category, Perl
could crash due to NULL dereference.

found by sthen@ in smokeping build; OK afresh1@
2024-05-17 18:11:58 +00:00
afresh1
fd82392917 Apply pre-built unicore patch - perl-5.38.2
ok gkoehler@
Commit and we'll fix fallout bluhm@
Right away, please deraadt@
2024-05-14 19:40:17 +00:00
afresh1
fac98b93b7 Apply local patches - perl-5.38.2
ok gkoehler@
Commit and we'll fix fallout bluhm@
Right away, please deraadt@
2024-05-14 19:39:39 +00:00
afresh1
e068048151 Fix merge issues, remove excess files - match perl-5.38.2 dist
ok gkoehler@
Commit and we'll fix fallout bluhm@
Right away, please deraadt@
2024-05-14 19:38:53 +00:00
afresh1
f2a19305cf Import perl-5.38.2
ok gkoehler@
Commit and we'll fix fallout bluhm@
Right away, please deraadt@
2024-05-14 19:36:00 +00:00
tb
90c45c291d gnu/cvs: avoid a harmless configure warning
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
2024-04-12 02:51:52 +00:00
miod
d11f3b7180 When rewriting an ELF header (i.e. in strip and objcopy), keep the
.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@
2024-04-10 19:43:16 +00:00
miod
a05426d896 Provide illop1 instruction encoding as TRAP. 2024-03-30 10:41:17 +00:00
miod
bdfcf93e44 No longer build the objective-C compiler (cc1obj). Its standard library
(libobjc) had been removed from the build years ago, there is no need to
keep the compiler.
ok beck@ joshua@
2024-03-29 06:52:50 +00:00
gkoehler
ba8279b1ec For macppc, add missing CFI for cr2, cr3, cr4
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@
2024-03-03 03:09:39 +00:00
kettenis
94b3843fdd Linux still doesn't actually implement IBT for userland. And by the pace
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@
2024-02-27 15:34:28 +00:00
kettenis
3ea6ff6a2a Revert the change that enabled retpoline thunks by default. The use of
retpolines makes IBT less useful and we have enabled additional mitigations
in our kernel now that should make them (mostly) unnecessary.

ok guenther@
2024-02-19 14:08:58 +00:00
kettenis
e134a43558 Remove "noretpolineplt" from the list of known -z flags. Missed in the
previous commit.

ok guenther@
2024-02-19 14:05:01 +00:00
kettenis
2e1a1ea9d7 Revert the change that enables retpoline PLTs by default. While these
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@
2024-02-12 10:46:10 +00:00
miod
43d0313fbb Feed more generated files to the clean target; joint work with naddy@ 2024-02-08 20:28:53 +00:00
jca
6add50f888 riscv64 fix: Handle relaxation reductions of more than 65536 bytes
Upstream commit:
9d37ea95df

Already needed at least by ports/math/hdf5, prerequisite if we want to
enable linker relaxation (clang upstream defaults).

ok kettenis@
2024-02-07 20:54:20 +00:00
jca
34cf86345c Add risc-v support code for clang -msave-restore
ok kettenis@
2024-02-06 05:07:28 +00:00
jca
c120e3490c Fix RTARCH in our Makefile and lets us access riscv-specific implementations
This brings us fp_mode.c used in softfloat code, and muldi3.S used when
the target ISA doesn't have the Multiply extension.

ok kettenis@
2024-02-06 05:00:12 +00:00
deraadt
2d3b182a09 Add minimal support for GNU_PROPERTY 2024-02-04 16:44:45 +00:00
jca
07a83dd91d Adapt base libstdc++ to the new ctype.h defines
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@
2024-02-04 13:03:26 +00:00
kettenis
293d5193af On OpenBSD we always want IBT-compatible PLT entries. Currently we use
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@
2024-02-03 11:03:48 +00:00
guenther
3b697b3f3b Swap the r10 and rcx registers in the amd64 trapframe so that the
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@
2024-01-31 06:06:28 +00:00
robert
3bef86f7bc update libcxx, libcxxabi and libunwind to 16.0.6;
tested by and input from tb@; ok kettenis@
2024-01-26 11:51:45 +00:00
robert
dc37c87a60 merge llvm libcxx 16.0.6 2024-01-26 11:49:45 +00:00
robert
4bdff4bed0 import of libcxx-16.0.6 2024-01-26 11:47:53 +00:00
robert
49dc4d0789 merge llvm libcxxabi 16.0.6 2024-01-26 11:45:17 +00:00
robert
8f1d572453 import of libcxxabi 16.0.6 2024-01-26 11:43:33 +00:00
robert
202cdb0e0a merge llvm libunwind 16.0.6 2024-01-26 11:41:32 +00:00
robert
0faf1914bf import of llvm libunwind 16.0.6 2024-01-26 11:39:01 +00:00
robert
68dd5bb185 merge llvm compiler-rt 16.0.6 2024-01-26 11:36:31 +00:00