| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
ok gnezdo@ semarie@ mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they want to count the passage of time.
If a timecounter clock can be exposed to userland than it needs to set
its tc_user member to a non-zero value. Tested with one or multiple
counters per architecture.
The timing data is shared through a pointer found in the new ELF
auxiliary vector AUX_openbsd_timekeep containing timehands information
that is frequently updated by the kernel.
Timing differences between the last kernel update and the current time
are adjusted in userland by the tc_get_timecount() function inside the
MD usertc.c file.
This permits a much more responsive environment, quite visible in
browsers, office programs and gaming (apparently one is are able to fly
in Minecraft now).
Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!
OK from at least kettenis@, cheloha@, naddy@, sthen@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change Elf64_Half from a uint32_t type to a uint16_t type. The size of
structs do not change as the previous uses of Elf64_Half become
Elf64_Word (uint32_t).
Remove Elf64_Quarter as 16 bit values now use Elf64_Half.
Replace Elf_Byte use with unsigned char.
Change some uses of Elf64_Xword to Elf64_Addr (both uint64_t).
Corrects behaviour with libelf where the file size of a symtab section
came back as 26 not 24 as libelf determines this by the size of a the
involved types not the size of the struct in exec_elf.h. As a result
libelf's elf_getdata() returned ELF_E_SECTION due to the size of the
section not being a multiple of the file size of the section type.
This occurred with the new runtime linker for radeon shaders in
Mesa 19.2.
Sync description of Elf32 and Elf64 types in elf(5) with FreeBSD and
adjust types in structs mentioned.
ok guenther@ deraadt@
|
|
|
|
| |
committed by mistake as part of an unrelated change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
enforce a new policy: system calls must be in pre-registered regions.
We have discussed more strict checks than this, but none satisfy the
cost/benefit based upon our understanding of attack methods, anyways
let's see what the next iteration looks like.
This is intended to harden (translation: attackers must put extra
effort into attacking) against a mixture of W^X failures and JIT bugs
which allow syscall misinterpretation, especially in environments with
polymorphic-instruction/variable-sized instructions. It fits in a bit
with libc/libcrypto/ld.so random relink on boot and no-restart-at-crash
behaviour, particularily for remote problems. Less effective once on-host
since someone the libraries can be read.
For static-executables the kernel registers the main program's
PIE-mapped exec section valid, as well as the randomly-placed sigtramp
page. For dynamic executables ELF ld.so's exec segment is also
labelled valid; ld.so then has enough information to register libc's
exec section as valid via call-once msyscall(2)
For dynamic binaries, we continue to to permit the main program exec
segment because "go" (and potentially a few other applications) have
embedded system calls in the main program. Hopefully at least go gets
fixed soon.
We declare the concept of embedded syscalls a bad idea for numerous
reasons, as we notice the ecosystem has many of
static-syscall-in-base-binary which are dynamically linked against
libraries which in turn use libc, which contains another set of
syscall stubs. We've been concerned about adding even one additional
syscall entry point... but go's approach tends to double the entry-point
attack surface.
This was started at a nano-hackathon in Bob Beck's basement 2 weeks
ago during a long discussion with mortimer trying to hide from the SSL
scream-conversations, and finished in more comfortable circumstances
next to a wood-stove at Elk Lakes cabin with UVM scream-conversations.
ok guenther kettenis mortimer, lots of feedback from others
conversations about go with jsing tb sthen
|
|
|
|
|
|
|
|
|
| |
was 80 bytes in size, rather than 64 as listed in the ELF header. In Sep 2001
when ELF was being integrated into the tree, two of the ELF object types (and two
more via #define) were given different (incorrect) sizes, and hid behind an
#ifdef __alpha__ all this time. -lelf constructs the SHDR object by accumulating
sizes of types, so this was finally exposed.
A review of the tree shows no other consequences, so we can fix this now.
|
|
|
|
| |
ok guenther@
|
|
|
|
|
|
|
|
| |
to pass the real count, with a minimal .shstrtab segment for consistency.
Also, add support for PN_XNUM to readelf.
problem reported and testing by claudio@
ok kettenis@
|
|
|
|
| |
ok naddy@ jca@
|
|
|
|
| |
Required by Karel Gardas to unbreak GHC head.
|
|
|
|
|
|
|
| |
skip symbol lookup on protected symbols. Add visibility #defines to
<sys/exec_elf.h> to support that.
ok kettenis@ visa@
|
|
|
|
| |
ok guenther
|
|
|
|
| |
Reported by and ok naddy@
|
|
|
|
|
|
|
| |
and a couple of missing EM_* required to build devel/libdwarf and
devel/valgrind.
ok deraadt@, jasper@
|
|
|
|
|
|
| |
Riding previous libc bump.
ok kettenis@
|
|
|
|
| |
ok deraadt@, kettenis@, jasper@
|
|
|
|
|
|
|
|
|
|
| |
and glibc. As noted by guenther@ this is the same layout as our
Elf{32,64}_Note structs and the handful of uses we have in the tree may
switch From _Note to _Nhdr in future.
Prompted by the development version of Mesa using the Nhdr type.
ok guenther@
|
|
|
|
|
|
|
| |
link.h can be included without first including sys/types.h matching the
behaviour on other systems.
Suggested by and ok guenther@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
leaving out the size, so that
ELFNAME2(exec,makecmds)
becomes
exec_elf_makecmds
instead of
exec_elf{32,64}_makecmds
and then delete the ELFNAME2() and ELFNAMEEND() macros.
Move the prototypes for functions local to exec_elf.c to there from
exec_elf.h.
Simplify the SMALL_KERNEL conditionals around the ELF coredump code.
Change exec_conf.c to use the size-generic names and macros
Remove exec_elf{32,64}.c and just build exec_elf.c; delete the
_KERN_DO_ELF and _KERN_DO_ELF64 #defines.
ok jca@, encouragement from deraadt@ and tom@
|
|
|
|
|
|
| |
and not something we guarantee to userspace
ok jca@
|
|
|
|
| |
ok jca@
|
|
|
|
|
|
| |
of ELFDEFNNAME(NO_ADDR)
ok jca@
|
|
|
|
|
|
|
|
|
| |
as on other LP64 archs, __uint64_t, so that printf-like functions
don't require extra casting...then eliminate the extra cast in
ld.so/mips64/rtld_machine.c
discussed with miod
ok visa@
|
|
|
|
|
|
| |
struct proc to struct process.
ok deraadt@ kettenis@
|
|
|
|
|
|
| |
the ARM 64-bit Architecture.
ok phessler@
|
|
|
|
|
| |
feedback from guenther@
ok guenther@ kettenis@
|
|
|
|
| |
- fix trailing whitespace
|
|
|
|
| |
ok guenther@
|
|
|
|
| |
ok guenther@
|
|
|
|
|
|
|
| |
Don't skip DT_INIT and DT_FINI for the main executable. This matches what
Linux and Solaris do.
ok guenther@
|
|
|
|
| |
ok millert@ kettenis@
|
| |
|
| |
|
|
|
|
| |
ok kettenis@ miod@
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This can be used to pass boot parameters to the kernel which can't be passed
safely via the Open Firmware interface, such as softraid volume IDs and keys.
The kernel already reads the arguments if available but ofwboot won't provide
them until further changes are committed there.
With support from deraadt, kettenis and matthew.
ok deraadt@
|
| |
|
|
|
|
|
|
| |
Much assistance and testing by miod
ok miod@
|
|
|
|
|
|
|
| |
for all the compat layers which are now gone. Linux compat still works
because it always used another method in any case, and nothing looks at
p_os anymore.
ok jsing
|
|
|
|
|
|
|
|
| |
segments to the kernel, ld (2.15), and ld.so. Tested on alpha, amd64,
i386, macppc, and sparc64 (thanks naddy, mpi, and okan!).
Idea discussed for some time; committing now for further testing.
ok deraadt
|
|
|
|
|
|
| |
While at it clean-up and fix machine types to reflect reality.
Okay deraadt@.
|
| |
|
|
|
|
|
|
|
| |
the DT_1_FLAGS .dynamic entry and its known flag values. Remove the
unused and useless STT_NUM and PT_NUM defines.
ok miod@
|
| |
|
|
|
|
|
| |
do not follow the regular layout. Makes ld.so much happier on loongson.
ok drahn@
|
|
|
|
|
|
| |
NetBSD.
ok kurt@, drahn@, miod@
|
|
|
|
| |
64-bit machines, even though it's not used. ok art deraadt millert tom
|
|
|
|
| |
systems only; more work is necessary in ld land.
|
|
|
|
|
| |
Add new sys/_types.h header
Include machine/_types.h or sys/_types.h where applicable
|
|
|
|
| |
ok drahn@
|