OpenBSD CVS

CVS log for src/libexec/ld.so/util.c


[BACK] Up to [local] / src / libexec / ld.so

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.49 / (download) - annotate - [select for diffs], Sat Jan 8 06:49:41 2022 UTC (2 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.48: +4 -2 lines
Diff to previous 1.48 (colored)

Prep .c files for removing the #includes from */archdep.h
 * replace #include "archdep.h" with #includes of what is used, pulling in
   "syscall.h", "util.h", and "archdep.h" as needed
 * delete #include <sys/syscall.h> from syscall.h
 * only pull in <sys/stat.h> to the three files that use _dl_fstat(),
   forward declare struct stat in syscall.h for the others
 * NBBY is for <sys/select.h> macros; just use '8' in dl_printf.c
 * <machine/vmparam.h> is only needed on i386; conditionalize it
 * stop using __LDPGSZ: use _MAX_PAGE_SHIFT (already used by malloc.c)
   where necessary
 * delete other bogus #includes, order legit per style: <sys/*> then
   <*/*>, then <*>, then "*"

dir.c improvement from jsg@
ok and testing assistance deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Oct 15 04:12:43 2020 UTC (3 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

make three mib[] arrays const, as was done in libc

Revision 1.47 / (download) - annotate - [select for diffs], Fri Mar 27 22:17:47 2020 UTC (4 years, 2 months ago) by matthieu
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

Add missing space in stack smash handler error message.
ok kettenis@, deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Wed May 8 22:15:48 2019 UTC (5 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.45: +9 -7 lines
Diff to previous 1.45 (colored)

On retguard systems, remove the ld.so-local stack-protector handling
functions because retguard uses hard-traps instead.
ok mortimer.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Feb 9 22:13:04 2018 UTC (6 years, 3 months ago) by mortimer
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.44: +26 -34 lines
Diff to previous 1.44 (colored)

Use a static chacha instance to fill randomdata sections. Avoids looping
over a syscall for randomdata sections larger than 256B.

ok djm@ deraadt@ kettenis@

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jan 24 07:48:37 2017 UTC (7 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

On fatal errors, kill ourselves with thrkill(0,9,NULL) instead of
simply exiting, via helper functions _dl_die(), _dl_diedie(), and
_dl_oom().

prompted by a complaint from jsing@
ok jsing@ deraadt@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Aug 12 20:39:01 2016 UTC (7 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)

the slimmed down random functions inside ld.so are strict clones of the
libc arc4random API, so call them _dl_{arc4random,arcrandombuf}
ok tedu guenther

Revision 1.42 / (download) - annotate - [select for diffs], Fri Aug 5 15:42:05 2016 UTC (7 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.41: +25 -5 lines
Diff to previous 1.41 (colored)

use a larger chunk for getentropy() and save some for next time.
coalesces some syscalls instead of one per random number.
ok deraadt

Revision 1.41 / (download) - annotate - [select for diffs], Mon Mar 21 22:41:28 2016 UTC (8 years, 2 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Rename the system call sendsyslog2 to sendsyslog.  Keep the old one
as osendsyslog for a while.  The three argument variant is the only
one that will stay.
input kettenis@;  OK deraadt@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Mar 21 01:32:48 2016 UTC (8 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.39: +3 -2 lines
Diff to previous 1.39 (colored)

Switch ld.so's stack smash handler from sendsyslog to sendsyslog2
and pass the LOG_CONS flag like libc's handler.

ok deraadt@ bluhm@ (who had a similar diff)

Revision 1.39 / (download) - annotate - [select for diffs], Sun Mar 20 02:29:51 2016 UTC (8 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

Export environ and __progname, making the latter a copy of just the filename
portion like crt0 does.  This is prep for eliminating _dl_fixup_user_env()
Mark almost everything in resolve.h as hidden, to improve code generation.

ok kettenis@ mpi@  "good time" deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 20 19:51:00 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.37: +5 -2 lines
Diff to previous 1.37 (colored)

If _dl_progname exceeds half the syslog buffer, truncate it with "...",
so that the remaining information is more visible
ok kettenis miod

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jan 16 16:18:07 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.36: +1 -2 lines
Diff to previous 1.36 (colored)

<sys/param.h> to <limits.h> conversion.  Verified binaries
ok millert, thanks to doug for process advice

Revision 1.36 / (download) - annotate - [select for diffs], Tue Dec 9 15:36:36 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
Changes since 1.35: +3 -2 lines
Diff to previous 1.35 (colored)

avoid void arithmetic. from david carlier

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jul 14 03:54:50 2014 UTC (9 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.34: +11 -1 lines
Diff to previous 1.34 (colored)

Now that we have sendsyslog(2), we can directly use it in the
(previously completely retarded) stack_smash_handler of ld.so
ok beck miod tedu

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jul 6 07:39:07 2014 UTC (9 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.33: +1 -3 lines
Diff to previous 1.33 (colored)

rm unneeded includes; prompted (partly) by kettenis@

Revision 1.33 / (download) - annotate - [select for diffs], Sun Jul 6 07:28:36 2014 UTC (9 years, 10 months ago) by otto
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

move from sysclt(KERN_ARND) to getentropy(2); ok miod@, kettenis@

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jun 21 08:00:23 2014 UTC (9 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.31: +4 -3 lines
Diff to previous 1.31 (colored)

Move to a non-zeroing _dl_malloc, a _dl_calloc and _dl_reallocarry and
fix _dl_strdup to return NULL instead of crash; ok deraadt@

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jun 14 20:31:17 2014 UTC (9 years, 11 months ago) by miod
Branch: MAIN
Changes since 1.30: +12 -2 lines
Diff to previous 1.30 (colored)

Make _dl_randombuf invoke sysctl KERN_ARND in 256-byte chunks, for this is
(currently) the largest output you can get from it.

ok deraadt@

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jun 5 08:39:07 2014 UTC (9 years, 11 months ago) by otto
Branch: MAIN
Changes since 1.29: +1 -70 lines
Diff to previous 1.29 (colored)

Move to (slightly stripped) version of libc malloc; ok deraadt@

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jan 23 01:07:45 2014 UTC (10 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

improve some types

Revision 1.28 / (download) - annotate - [select for diffs], Sat Dec 28 18:41:48 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

Do not need __guard anymore
Discussion with miod
ok kettenis

Revision 1.27 / (download) - annotate - [select for diffs], Wed Nov 13 05:41:42 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

prototype & void * math cleanup
ok guenther

Revision 1.26 / (download) - annotate - [select for diffs], Sun Jun 9 13:10:19 2013 UTC (10 years, 11 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Constify the mib argument of sysctl().
ok matthew@ millert@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jan 23 19:01:44 2013 UTC (11 years, 4 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Cache flush .plt after updating its pointers to .got during the initial
object relocation, if loaded at a different address than the one it was
compiled for; unsurprisingly fixes some spurious crashes.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Aug 28 16:39:09 2012 UTC (11 years, 9 months ago) by matthew
Branch: MAIN
Changes since 1.23: +3 -2 lines
Diff to previous 1.23 (colored)

Add __guard_local as a hidden symbol to ld.so, kernel, and every
executable and DSO (via crtbegin.c/crtbeginS.c).  Not used yet, but
needed before GCC can start emitting -fstack-protector code that uses
them instead of __guard.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Aug 22 17:06:39 2012 UTC (11 years, 9 months ago) by matthew
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Change ld.so and libc to use .openbsd.randomdata on ELF platforms for
initializing their __guard values.  For the time being, we're leaving
libc's constructor method as a backup to make sure __guard actually
gets initialized and to emit syslog warnings when it's not.

Not really an ABI change, so no shlib bump... "hold on to your butts"

ok deraadt, kettenis

Revision 1.22 / (download) - annotate - [select for diffs], Tue Aug 7 17:47:06 2012 UTC (11 years, 9 months ago) by matthew
Branch: MAIN
Changes since 1.21: +9 -11 lines
Diff to previous 1.21 (colored)

Factor out a _dl_randombuf() method from _dl_random().

Revision 1.21 / (download) - annotate - [select for diffs], Sat Oct 30 15:36:32 2010 UTC (13 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.20: +9 -7 lines
Diff to previous 1.20 (colored)

fix a 10 year old bug in the memory allocator, which affected only sparc.
sparc has 4 byte long, but needs 8 byte alignment.  recently the DIR
struct was changed to contain some off_t, which needs 8 byte alignment.
turns out the allocator calculated the bias for alignment, and then
subtracted out it's private linkage storage afterwards.  on hppa this
worked because a 8-byte object can be loaded at a 4-byte boundary; on
all other architectures the situation was either 4/4 or 8/8.
thanks for a bit of help from drahn

Revision 1.20 / (download) - annotate - [select for diffs], Thu Oct 2 20:12:08 2008 UTC (15 years, 8 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

Fix mmap() error checking to be correct 64-bit addresses. Consistently
use _dl_mmap_error() to check for mmap() errors. Adjust datatypes of
some local vars for 64-bit safety.

okay millert@ drahn@

Revision 1.19 / (download) - annotate - [select for diffs], Fri Feb 9 14:51:13 2007 UTC (17 years, 3 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.18: +1 -2 lines
Diff to previous 1.18 (colored)

readdir buffers should not get a fixed buffer size, but should be dependant
on the block size of the filesystem. Rounded up to page size for efficiency.
similar to change in libc yesterday. Should fix PR 5364.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jun 14 15:07:36 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.17: +20 -14 lines
Diff to previous 1.17 (colored)

Make _dl_malloc() deal with allocations > 4096 correctly.  Also place
unused memory chunks on the free list when making a large allocation.
OK drahn@ deraadt@

Revision 1.17 / (download) - annotate - [select for diffs], Wed Feb 25 23:36:11 2004 UTC (20 years, 3 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Fix this assumed sizeof(long) == 4 error. Would very occasionally cause
the code to attempt to zero 4 bytes of the next page.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jul 6 20:03:58 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

various proto, ansi, and knf repair.  tested on all architectures that
use it. (build may require make cleandir because of .depend balony)

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jun 9 16:10:03 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.14: +1 -7 lines
Diff to previous 1.14 (colored)

pefo 3/4 licence cleanups

Revision 1.14 / (download) - annotate - [select for diffs], Fri May 30 01:13:53 2003 UTC (21 years ago) by drahn
Branch: MAIN
Changes since 1.13: +21 -1 lines
Diff to previous 1.13 (colored)

When loading a shared object or libraries dependant object, load them
in random order. This will reduce the possiblity of a buffer overflow
being able to predict the addresss of useful code. Can be disabled
with the LD_NORANDOM environment variable for debugging purposes.
ok deraadt.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Feb 2 16:57:58 2003 UTC (21 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.12: +8 -8 lines
Diff to previous 1.12 (colored)

knf & ansi; drahn ok

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 2 23:17:36 2002 UTC (21 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

KNF; openbsd@davidkrause.com

Revision 1.11 / (download) - annotate - [select for diffs], Mon Dec 2 16:31:53 2002 UTC (21 years, 6 months ago) by naddy
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

typo; ok miod@

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 2 09:00:18 2002 UTC (21 years, 6 months ago) by miod
Branch: MAIN
Changes since 1.9: +13 -1 lines
Diff to previous 1.9 (colored)

Import propolice (http://www.trl.ibm.com/projects/security/ssp), a stack
attack protection scheme, into gcc.

This protection is enabled by default. It can be turned off by using the
-fno-stack-protector flag.

Code by Hiroaki Etoh (etoh at jp dot ibm dot com); work on openbsd-specific
integration by fgsch@, deraadt@ and myself; tests by fgsch@, naddy@ and
myself; beer drinking by myself.

Please note that system upgrades with this new code will require a new
libc and ld.so to be build and installed before the propolice-enabled
compiler can be installed.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 24 04:11:10 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

ok i found it

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jul 24 04:00:44 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +1 -1 lines
Diff to previous 1.7 (colored)

back out broken stuff until it is fixed

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jul 24 00:13:55 2002 UTC (21 years, 10 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

make more _dl_*() func params like real ones in libc

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 7 08:54:50 2002 UTC (21 years, 11 months ago) by jufi
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)


typos/grammar/better words
in comments.

Revision 1.5 / (download) - annotate - [select for diffs], Tue May 28 00:22:01 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

more KNF

Revision 1.4 / (download) - annotate - [select for diffs], Fri May 24 18:37:38 2002 UTC (22 years ago) by drahn
Branch: MAIN
Changes since 1.3: +5 -3 lines
Diff to previous 1.3 (colored)

Change _dl_strcpy() to _dl_strlcpy(), implementation taken from libc.

Revision 1.3 / (download) - annotate - [select for diffs], Fri May 24 03:44:37 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.2: +5 -6 lines
Diff to previous 1.2 (colored)

various KNF

Revision 1.2 / (download) - annotate - [select for diffs], Tue Apr 9 19:59:47 2002 UTC (22 years, 1 month ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.1: +33 -1 lines
Diff to previous 1.1 (colored)

Add the Copyrights from the respective files the code came from. ok deraadt@

Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 21 23:17:53 2002 UTC (22 years, 3 months ago) by drahn
Branch: MAIN

cleanup of MD/MI ld.so (elf), most changes by art@ cleanup by me.
tested on alpha sparc64 powerpc.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.