1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00
Commit Graph

4671 Commits

Author SHA1 Message Date
robert 8ba2a59033 fir crashing with scalable TypeSizes
From 537f3d3a7588d226b86590f97c4401107585e1ce Mon Sep 17 00:00:00 2001
From: Jakob Koschel <jakobkoschel@google.com>
Date: Thu, 5 Mar 2026 01:11:44 +0100
Subject: [PATCH] [SafeStack] Fix crashing with scalable TypeSizes (#180547)

On e.g. aarch64 the TypeSize of scalar types can have a size that is not
known at compile time.
Currently when safestack occurs those it simply crashes as described in
https://github.com/llvm/llvm-project/issues/175868.
2026-06-11 16:46:20 +00:00
robert c6e406052a fix a mismerged patch for defaulting to -mno-relax on OpenBSD; from Brad 2026-06-09 06:41:08 +00:00
afresh1 1a1b1c7bb8 Upstream patch for buffer overflow in 32-bit perl
* CVE-2026-8376
    https://lists.security.metacpan.org/cve-announce/msg/40396161/
    Perl versions through 5.43.10 have a heap buffer overflow when
    compiling regular expressions with a repeated fixed string on 32-bit
    builds
2026-06-09 01:37:55 +00:00
afresh1 21e0b139c0 Upstream patches for IO-Compress perl dist
* CVE-2026-48961
    https://lists.security.metacpan.org/cve-announce/msg/40434383/
    IO::Compress versions from 2.207 before 2.220 for Perl ship a
    zipdetails CLI tool that crashes with undefined subroutine on
    Info-ZIP Unix Extra Field with 8-byte UID or GID

* CVE-2026-48962
    https://lists.security.metacpan.org/cve-announce/msg/40434385/
    IO::Compress versions before 2.220 for Perl can execute arbitrary
    code in File::GlobMapper via an attacker-controlled output glob

* CVE-2025-15649
    https://lists.security.metacpan.org/cve-announce/msg/40434380/
    IO::Uncompress::Unzip versions before 2.215 for Perl propagate
    uncaught exception when parsing zip header with malformed DOS date

* CVE-2026-48959
    https://lists.security.metacpan.org/cve-announce/msg/40434381/
    IO::Uncompress::Unzip versions before 2.220 for Perl allow CPU
    exhaustion via per-byte read loop in fastForward
2026-06-09 01:37:30 +00:00
afresh1 38d736fcba Upstream patch for HTTP-Tiny perl dist
* CVE-2026-7010
    https://lists.security.metacpan.org/cve-announce/msg/39952806/
    HTTP::Tiny versions before 0.093 for Perl do not validate CRLF in
    HTTP request lines or control field header values
2026-06-09 01:36:51 +00:00
afresh1 170dab4126 Upstream patches for Archive-Tar perl dist
* CVE-2026-42496
    https://lists.security.metacpan.org/cve-announce/msg/40396459/
    Archive::Tar versions before 3.08 for Perl extract symlinks with
    attacker controlled targets outside the extraction directory

* CVE-2026-42497
    https://lists.security.metacpan.org/cve-announce/msg/40396457/
    Archive::Tar versions before 3.08 for Perl extract hardlinks to
    attacker controlled paths outside the extraction directory

* CVE-2026-9538
    https://lists.security.metacpan.org/cve-announce/msg/40396448/
    Archive::Tar versions before 3.10 for Perl allow memory exhaustion
    via attacker controlled entry size field in tar header
2026-06-09 01:36:20 +00:00
kettenis 8beb114a13 Update clzdi2.c to pull in the following commit neede because of a change
in clang brought in with the llvm 22 update:

commit 5d0e26e571c08dc4c0b2a25ed6c9f845f054fa76
Author: Koakuma <koachan@protonmail.com>
Date:   Tue Apr 29 07:36:32 2025 +0700

    [compiler-rt] Make sure __clzdi2 doesn't call itself recursively on sparc64 (#136737)

    On 64-bit platforms, libgcc doesn't ship with __clzsi2, so __builtin_clz
    gets lowered to __clzdi2. A check already exists for GCC, but as of
    commit 8210ca019839fc5430b3a95d7caf5c829df3232a clang also lowers
    __builtin_clz to __clzdi2 on sparc64.

    Update the check so that building __clzdi2 with clang/sparc64 also
    works.

ok tb@, deraadt@
2026-05-29 19:54:16 +00:00
gkoehler a909ce865e Unbreak and update powerpc retguard for llvm 22
For RETGUARD_LOAD_COOKIE when -fno-pie (as in macppc kernels), change
a relocation in -fno-pie (as in macppc kernels) from unusual S_HIGHA
"__retguard_3671@higha" to usual S_HA "__retguard_3671@ha".  This
prevents an error from lld 22,

ld: error: rasops15.o:(function rasops15_init: .text+0x2): unknown \
relocation (111) against symbol __retguard_3671

For RETGUARD_LOAD_PC in PIC code, change an instruction from 'bl .+4'
to 'bcl 20,31,.+4' to fix branch prediction.  This follows the same
change in upstream llvm,
https://github.com/llvm/llvm-project/issues/128644

ok jca@ naddy@
2026-05-29 19:32:41 +00:00
robert 01dd9eb5f3 revert upstream commit 947b9f55b5f327e14368a48fb6ce10242ea29bf3
It breaks cpp -traditional -dM

https://github.com/llvm/llvm-project/issues/200085
2026-05-29 11:53:08 +00:00
robert 8c47df8d06 add SipHash.h from llvm-22.1.6 which is shipped as a third party header 2026-05-29 11:52:13 +00:00
robert fb5f5ea15f update build infrastructure for llvm-21.1.6
thanks for all the help with testing and fixing things up
2026-05-29 11:18:29 +00:00
robert 4f961aa651 merge lldb-21.1.6 2026-05-29 11:07:21 +00:00
robert 7715a8ca53 import lldb from LLVM-21.1.6 2026-05-29 11:06:49 +00:00
robert a7e9300def merge lld-21.1.6 2026-05-29 11:06:20 +00:00
robert 61e157d395 import lld from LLVM-21.1.6 2026-05-29 11:05:54 +00:00
robert 8b3cbedc09 merge clang-21.1.6 2026-05-29 11:05:26 +00:00
robert d3ce770b47 import clang from LLVM-21.1.6 2026-05-29 11:04:28 +00:00
robert e916227ab7 merge llvm-21.1.6 2026-05-29 11:03:37 +00:00
robert d93fb232b2 import llvm from LLVM-21.1.6 2026-05-29 11:00:35 +00:00
robert b2f9966e67 lower std::deque blocksize if _LIBCPP_USE_LOWER_DEQUE_BLOCK_SIZE is defined
defining _LIBCPP_USE_LOWER_DEQUE_BLOCK_SIZE will make std::deque behave
more in line with what libstdc++ is doing by using 512 byte blocks instead
of 4096 to waste less memory

this can be used by llvm-tblgen to reduce the memory usage of some
operations which completely blow up with llvm22, so let's prepare now

https://github.com/llvm/llvm-project/issues/31782
https://chromium.googlesource.com/android_ndk/+/eecd8c2d681b019efca486f92fdda9a93f52328f%5E%21/#F0

ok deraadt@
2026-05-07 09:28:48 +00:00
jca 008d370469 Respect DEBUG so we can build perl with debug symbols
Adding -DEBUGGING in CONFIGURE_ARGS activates debug code,
-DEBUGGING=-g passes -g in CFLAGS (only -g is supported),
and -DEBUGGING=both does... both.  This is a bit confusing.
IMO DEBUG=-g should only add -g and disable executable stripping, but
not change the code that is built.  So use -Doptimize which lets us pass
arbitrary compiler flags (eg -g3), just like DEBUG does in our system
Makefiles.

Hints and ok afresh1@
2026-04-07 16:41:33 +00:00
afresh1 8eafb9a57f Update to perl 5.42.2
The two main changes are both from 5.42.1, a timezone fix and a
corner case for auto-vivification.

The CVE from 5.42.1 we had already patched and the zlib update in
5.42.2 is in code we don't use because we link against the system
zlib.

https://metacpan.org/release/SHAY/perl-5.42.1/view/pod/perldelta.pod
https://metacpan.org/release/SHAY/perl-5.42.2/view/pod/perldelta.pod

I'm not concerned -- sthen@
I think you can just commit this -- naddy@
good timing -- deraadt@
OK -- blumh@
2026-04-01 23:20:53 +00:00
afresh1 03db75a2bd Improve OpenBSD::Unveil POD
The choice of variable names made it somewhat unclear what arguments
to pass and made it seem the interface might differ from unveil(2).

ok dgl@
2026-03-30 00:00:04 +00:00
kettenis 7850a610d3 amd64 needs the quad-precision support functions as well (for __float128
support).  From Brad (with a small comment tweak).

ok rsadowski@
2026-03-02 20:33:49 +00:00
deraadt 3ae6636769 replace pledge "stdio rpath tmppath" with unveil "/tmp" "rwc" to satisfy
mktemp(3) type operations, unveil "/" "r" for reading all over the tree,
and pledge "stdio rpath wpath cpath" to permit both unveils subject to
their own limitations.
2026-02-23 16:45:16 +00:00
deraadt 0bcd6e0c21 This was using pledge "tmppath" with "rpath wpath cpath".
The "tmppath" is not needed.
ok semarie and others
2026-02-18 20:43:58 +00:00
rsadowski ab79de310e Fix PSTL backend (names) in __config_site
Upstream libc++ renamed these macros in the following commit:
https://github.com/llvm/llvm-project/commit/d423d80

We had the correct names in the libcxx* makefiles, so no ABI changes are
required.

Reported by c2qd and also provided the __config_site diff. OK robert@
2026-02-07 15:59:32 +00:00
afresh1 50ae83fbdd Apply upstream patch to fix segfault with multi-arg for loops
This is documented upstream https://github.com/perl/perl5/issues/23405

A simple trigger is

  perl -c -wE 'for my ($x, $y) (Bar->foo) {}'

Suggested by James Cook <falsifian () falsifian ! org>
Tested and OK gkoehler@
2026-01-10 23:20:43 +00:00
afresh1 bb2c65927d Delete unused syscall_emulator.c
This file is generated in the obj directory during build,
so this outdated copy should never be used.

Noticed by miod@
2026-01-10 23:16:23 +00:00
jca 0ff6482635 Install arm_neon_sve_bridge.h on aarch64
From Brad, similar diff proposed recently by jsg@, ok kettenis@
2026-01-06 22:27:48 +00:00
jca 5597866b8b Backport aarch64 SVE compile fix from upstream
From Brad, ok kettenis@
2026-01-06 22:24:03 +00:00
afresh1 cfd030a03a Apply pre-built unicore patch - perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:16:21 +00:00
afresh1 24fd63f938 Apply local patches - perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:15:22 +00:00
afresh1 2c27e31520 Fix merge issues, remove excess files - match perl-5.42.0 dist
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:14:12 +00:00
afresh1 077d0dbde0 Import perl-5.42.0
ok bluhm@
Whenever you are ready deraadt@
2025-12-26 22:12:24 +00:00
sthen b46de5080d when using install-info on compressed info files, uncompress from stdin
rather than passing "< filename" to the shell. from espie, ok tb.
leaks, but so does the surrounding code.
2025-12-14 12:37:28 +00:00
robert 55bee3f78c remove special handling of __string/* headers
we had to add special handling for the __string directory because CVS
cannot handle file to directory transitions so we had to move this
directory to __string.d and copy files over at install time, however
when libcxx19 was imported this directory was actually commited, making
rendering the handling of the special directory obsolete, but it was kept
there and it was installing files to the wrong directory
2025-12-06 09:27:54 +00:00
miod 8720e5dd16 Switch m88k to PIE by default.
ok aoyama@
2025-11-17 16:06:09 +00:00
gnezdo 077d2ea485 Fix llvm x86 frame lowering for -msave-args
The problem only shows up with KASAN builds where it causes registers
saved below SP leading to fills not finding what was spilled.

go for it dlg@
2025-11-14 09:57:02 +00:00
jca baa29930eb The libunwind guts used by libexecinfo no longer need "new" from libcxx
check_sym says: No dynamic export changes

Noticed and checked by rsadowski@
2025-11-04 13:17:05 +00:00
jca d387f9c1e6 take 2: re-apply two commits that were lost while merging the 19.1.7 update
Reintroduce a tweaked version of the IP-based caching implementation.
Implementing a custom "new" operator has the two following desirable
properties:
- make the code more standalone, not depending on "new" from libcxx.
- teach this allocator to return nullptr on memory shortage ("noexcept")
  so it can fail gracefully. If we can't allocate an item, we just don't
  cache it.
That should be more resilient to memory shortages and thus more usable
from libexecinfo.

ok rsadowski@ robert@
2025-11-04 13:09:23 +00:00
jca 2da7e0886e take 2: re-apply one commit that was lost while merging the 19.1.7 update
I've been overzealous when backing out some unrelated changes.
Re-apply requested by robert@
-------------------
    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@
2025-11-03 20:21:23 +00:00
jca 7abb703a82 Backout previous, the reintroduced code leads to a missing symbol
regress:
cc  -Wl,--export-dynamic  -o t_backtrace t_backtrace.o atf-c.o -lexecinfo
ld: error: undefined reference: operator new(unsigned long)
>>> referenced by /usr/lib/libexecinfo.so.4.0 (disallowed by --no-allow-shlib-undefined)

ok tb@
2025-11-03 18:33:06 +00:00
robert 36632bb0f3 re-apply three commits that were lost while merging the 19.1.7 update
-------------------
    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@
-------------------
    Initial IP-based caching implementation with O(logn) lookup.

    Caching implemented via red-black trees, this can be improved and
    further work is on-going to bring it closer to GNU's performance that
    uses a LRU-MRU 8-entries based caching algorithm.

    Prompted by robert@ who run into a runtime of an executed macro of
    5 minutes in libreoffice. With this the execution is reduced to 58 seconds.

    C++11 tips from espie@, rsadowski@
    Tested by robert@
    OK mortimer@, kettenis@.

--------------------
    Make the unwind cache tread-safe by declaring it thread_local. Solves
    segfaults seen on exception handling.  ok kettenis@
--------------------
2025-11-03 09:20:19 +00:00
miod 4959bc61fd Undo a bad mistake; spotted by brynet@ 2025-10-23 20:42:52 +00:00
miod 54449f37da Don't try to install {,un}protoize manpages, they no longer exist. 2025-10-23 19:35:56 +00:00
miod 9069d57f4c gcc3 is leaving the building. 2025-10-23 19:10:32 +00:00
miod acc7c06d1c gcc3 is leaving the building.
(removal done in several commits to avoid hitting
 "Protocol error: too many arguments" errors)
2025-10-23 19:09:49 +00:00
miod 43de91522a gcc3 is leaving the building. 2025-10-23 19:08:32 +00:00
miod 27664962f0 Prepare for gcc 3 leaving the building, COMPILER_VERSION can no longer get
set to "gcc3".
2025-10-23 19:06:09 +00:00