| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
| |
clang defaulted to -fomit-frame-pointer when optimizing PowerPC code
for Linux and NetBSD. Now do it for all systems, including OpenBSD.
This affects both 32-bit and powerpc64 code.
ok kettenis@
|
| |
|
|
|
|
|
|
| |
Add these options from gcc to clang:
-maix-struct-return # return all structs in memory
-msvr4-struct-return # return small structs in r3/r4
ok mortimer@ jca@ deraadt@
|
| |
|
|
|
|
|
|
|
|
| |
For this architecture we use separate retguard prologue and epilogue code
for static or PIC code. In the PIC case we use some additional code before
the retguard epilogue to recover the function start address and the GOT
pointer in order to get the per-function random cookie. Much thanks to
visa@ for suggestions and advice making it all work.
ok deraadt@ visa@
|
| |
|
|
|
|
|
|
| |
Change of behaviour in latest clang upgrade noticed by jsing@ during
the Go port update, where --print-libgcc-file-name is being used which
prints the compiler-rt path.
ok kettenis@
|
| |
|
|
|
|
|
| |
Tested in snaps and package builds
Tested on amd64 by naddy@
Tested on arm64 by patrick@
Tested on octeon by visa@
|
| | |
|
| |
|
|
|
|
|
|
| |
for OpenBSD sparc64. The problem is that the integrated assembler is not
even able to compile the .S files in lib/csu or lib/libc so revert this
and use gas again. Fixes build issues with clang on sparc64.
Issue identified by jca@
OK deraadt@, patrick@, jca@
|
| |
|
|
|
|
| |
we don't need to do that again here.
From Brad
|
| |
|
|
|
|
|
|
|
| |
Prepared with help from jsg@ and mortimer@
Tested on amd64 by bcallah@, krw@, naddy@
Tested on arm64 by patrick@
Tested on macppc by kettenis@
Tested on octeon by visa@
Tested on sparc64 by claudio@
|
| | |
|
| | |
|
| |
|
|
|
| |
it will be there.
problem found by naddy@, "heck yeah" kettenis@
|
| |
|
|
|
|
| |
enabled.
ok visa@
|
| |
|
|
|
|
|
| |
stack protector. Fixes 'unused arguments' warning when this argument is
given.
Noticed by robert@, ok robert@
|
| |
|
|
|
|
| |
are close to release, so punt the change till after-release
easier for everyoned and especially naddy
ok tedu
|
| |
|
|
|
|
| |
optimization flags.
ok kettenis@ visa@
|
| |
|
|
| |
ok millert@
|
| |
|
|
| |
ok deraadt@
|
| |
|
|
|
|
|
|
|
|
| |
- Target all four kinds of return bytes (c2, c3, ca, cb)
- Fix up instructions using both ModR/M and SIB bytes
- Force alignment before instructions with return bytes in immediates
- Force alignment before instructions that have return bytes in their encoding
- Add a command line switch to toggle the functionality.
ok deraadt@
|
| |
|
|
|
| |
With fixes from mortimer@ (thanks!)
Tested by many, especially naddy@ (thanks!)
|
| | |
|
| |
|
|
|
|
|
|
| |
Upstream references:
https://reviews.llvm.org/D31557
https://reviews.llvm.org/D48515
OK kettenis@
|
| |
|
|
| |
ok deraadt@
|
| |
|
|
|
|
| |
profiler(gprof) work properly.
ok mpi
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
random cookies to protect access to function return instructions, with the
effect that the integrity of the return address is protected, and function
return instructions are harder to use in ROP gadgets.
On function entry the return address is combined with a per-function random
cookie and stored in the stack frame. The integrity of this value is verified
before function return, and if this check fails, the program aborts. In this way
RETGUARD is an improved stack protector, since the cookies are per-function. The
verification routine is constructed such that the binary space immediately
before each ret instruction is padded with int03 instructions, which makes these
return instructions difficult to use in ROP gadgets. In the kernel, this has the
effect of removing approximately 50% of total ROP gadgets, and 15% of unique
ROP gadgets compared to the 6.3 release kernel. Function epilogues are
essentially gadget free, leaving only the polymorphic gadgets that result from
jumping into the instruction stream partway through other instructions. Work to
remove these gadgets will continue through other mechanisms.
Remaining work includes adding this mechanism to assembly routines, which must
be done by hand. Many thanks to all those who helped test and provide feedback,
especially deaadt, tb, espie and naddy.
ok deraadt@
|
| | |
|
| |
|
|
|
|
|
| |
the "soft" floating-point ABI but this does allow the compiler to generate
FPU instructions.
ok deraadt@
|
| | |
|
| | |
|
| |
|
|
| |
"where is the kaboom?" deraadt@
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
they can perform strange transforms and optimizations. Some of those could
gain a slight advantage, but would avoid the variety of important runtime
checks our malloc(3) code does. In essence, the transforms performed are
considered "anti-mitigation".
ok kettenis robert, discussions with others
|
| |
|
|
|
|
| |
warning
ok kettenis@, deraadt@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
as defined. This is done to prevent dangerous optimisations which could
remove security critical overflow checks.
Base gcc has -fno-strict-overflow by default, with clang this is
identical to -fwrapv.
Prompted by naddy@ discovering a hang with a clang compiled i386 kernel
that was resolved with -fwrapv.
ok kettenis@ pascal@
|
| |
|
|
|
|
|
|
| |
runtime support code libcompiler_rt for this. This code uses functions that
live in libpthread, so code that uses TLS support will need to be linked
with -lpthread. This should allow more ports to build with base clang.
ok espie@
|
| | |
|
| |
|
|
| |
development effort on OpenBSD/arm64.
|
| |
|
|
|
|
|
|
| |
don't enforce it yet, but we want to go down that road. Additionally
the Pine64 seems to boot up with strict alignment on by default, so
this also implicitly fixes efiboot on that hardware.
ok kettenis@ phessler@ visa@
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
to our linker. Additionally, we need to make sure the library path is
prefixed with the cross directory, which is sysroot.
ok kettenis@
|
| |
|
|
| |
cluebat & ok kettenis@
|
| |
|
|
| |
ok patrick@
|
| |
|
|
| |
looks good to stefan@
|
| |
|
|
|
|
|
| |
does not tell our linker to produce that header for statically linked
binaries. Just create that header for all binaries and we are fine.
ok guenther@
|