| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| | |
|
| |
|
|
| |
"where is the kaboom?" deraadt@
|
| |
|
|
|
|
|
|
| |
instructions to have side effects so the optimizer does not reorder
them across fnstcw/fldcw sequences. Fixes a bug seen in sqlite3 on
i386.
ok kettenis@
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
order it chooses. Reasons for choosing one register before another usually incl
ude compiled instruction size (avoidance of REX prefixes, etc.) or usage convent
ions, but somehow haven't included security implications in the compiled bytecod
e. Some bytecode is more useful in polymorphic ROP sequences than others, so it
seems prudent to try to avoid that bytecode when possible.
This patch moves EBX/RBX towards the end of the allocation preference for 32 and
64 bit general purpose registers. Some instructions using RBX/EBX/BX/BL as a de
stination register end up with a ModR/M byte of C3 or CB, which is often useful
in ROP gadgets. Because these gadgets often occur in the middle of functions, th
ey exhibit somewhat higher diversity than some other C3/CB terminated gadgets. T
his change removes about 3% of total gadgets from the kernel, but about 6% of un
ique gadgets.
There are other possible changes in this direction. BX/BL are obvious next targe
ts for avoidance, and MM3/XMM3 may also be useful to try to avoid if possible.
ok deraadt@
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is mostly needed by syspatch at the moment to be
to be able to re-link in the same order as the original
libraries were linked with by relying on the readelf(1)
and without this .(s|S) assembly files were not getting
a file directive.
A bug reports has been filed as well:
https://bugs.llvm.org/show_bug.cgi?id=34019
ok deraadt@
|
| |
|
|
| |
ok deraadt@
|
| |
|
|
| |
ok deraadt@
|
| |
|
|
|
|
| |
prevents core dumps :)
okay tedu@
|
| |
|
|
|
| |
Also from Todd Mortimer
tested by espie
|
| |
|
|
|
|
| |
clang doesn't seem to have a command line option for the feature,
so just hard wire it off. We don't need advertisements in our binaries.
ok deraadt
|
| |
|
|
|
|
|
| |
in fact, false is a much better default for UsesNonexecutableStackSection.
platforms that require it can reenable, instead, saving the rest of us an
unnecessary program header (causes trouble for some special binaries).
ok kettenis
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
the internal names we use in libc for memset and memcpy and having the
compiler optimize them as calls to memset and memcpy will lead to infinite
recursion.
This is a temporary solution while guenther@ tries to figure out a better
way to force calls from inside libc via identifiers that are of hidden
visibility.
ok jsg@, patrick@
|
| | |
|
| |
|
|
| |
development effort on OpenBSD/arm64.
|
| |
|
|
|
|
|
| |
code generation. Use dyn_case_or_null instead of a static cast to
solve the crashes in the previous code.
ok stefan@ kettenis@
|
| |
|
|
|
|
|
|
| |
on any other platform and it causes a segfault in combination with our
IR Stack Guard.
"looks reasonable" kettenis@
"looks good to me" stefan@
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ok pascal@
Original commit message:
[SSP] Do not set __guard_local to hidden for OpenBSD SSP
guard_local is defined as long on OpenBSD. If the source file contains
a definition of guard_local, it mismatches with the int8 pointer type
used in LLVM. In that case, Module::getOrInsertGlobal() returns a
cast operation instead of a GlobalVariable. Trying to set the
visibility on the cast operation leads to random segfaults (seen when
compiling the OpenBSD kernel, which also runs with stack
protection).
In the kernel, the hidden attribute does not matter. For userspace code,
guard_local is defined as hidden in the startup code. If a program
re-defines guard_local, the definition from the startup code will
either win or the linker complains about multiple definitions
(depending on whether the re-defined __guard_local is placed in the
common segment or not).
It also matches what gcc on OpenBSD does.
|
|
|
ok hackroom@
|