OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.76 / (download) - annotate - [select for diffs], Fri Apr 5 13:51:47 2024 UTC (2 months ago) by deraadt
Branch: MAIN
CVS Tags: HEAD
Changes since 1.75: +5 -16 lines
Diff to previous 1.75 (colored)

ld.so should stop calling msyscall(2), since it is fully neutered and
about to be removed.  Please be careful building through this, you need
a kernel at least March 29th or so to build through it, otherwise use
snapshots to cross over.
ok various people

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jan 17 13:00:05 2024 UTC (4 months, 3 weeks ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

very ugly whitespaces

Revision 1.74 / (download) - annotate - [select for diffs], Tue Jan 16 19:07:31 2024 UTC (4 months, 3 weeks ago) by deraadt
Branch: MAIN
Changes since 1.73: +24 -14 lines
Diff to previous 1.73 (colored)

Read PT_OPENBSD_SYSCALLS in libc.so, and convert it to a table for
pinsyscalls(2).
ok kettenis

Revision 1.73 / (download) - annotate - [select for diffs], Tue Dec 19 16:13:22 2023 UTC (5 months, 2 weeks ago) by deraadt
Branch: MAIN
Changes since 1.72: +1 -3 lines
Diff to previous 1.72 (colored)

whitespaces

Revision 1.72 / (download) - annotate - [select for diffs], Tue Aug 15 06:23:31 2023 UTC (9 months, 3 weeks ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored)

Skip the _dl_msyscall() invocation if tracing library loading.

Problem noted by gnezdo@
ok millert@

Revision 1.71 / (download) - annotate - [select for diffs], Wed Jul 12 19:49:06 2023 UTC (10 months, 4 weeks ago) by jasper
Branch: MAIN
Changes since 1.70: +10 -1 lines
Diff to previous 1.70 (colored)

validate alignment of ELF program headers

Revision 1.70 / (download) - annotate - [select for diffs], Sun Jan 29 20:30:56 2023 UTC (16 months, 1 week ago) by gnezdo
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.69: +8 -7 lines
Diff to previous 1.69 (colored)

Accumulate intermediate imutables locally before applying

OK deraadt

Revision 1.69 / (download) - annotate - [select for diffs], Sun Dec 4 15:42:07 2022 UTC (18 months ago) by deraadt
Branch: MAIN
Changes since 1.68: +18 -3 lines
Diff to previous 1.68 (colored)

The next step for mimmutable().  ld.so figures out what regions of memory
of startup shared library mappings can be made immutable, and also does
this for dlope() RTLD_NODELETE and subsidiary libraries.  Complexity in this
diff is due to the GNU_RELRO and OPENBSD_MUTABLE sections.
Tested in snaps for about 3 weeks, with some bootstrap related pain felt in ports
ok kettenis, much help from others.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Nov 7 10:35:26 2022 UTC (19 months ago) by deraadt
Branch: MAIN
Changes since 1.67: +3 -2 lines
Diff to previous 1.67 (colored)

dtors were broken by trying to reuse DF_1_NODELETE to hint that this
library would never unload, and could be immutable.  Pass a seperate
flag for our purposes
Noticed from regress tests by anton, ok kettenis

Revision 1.67 / (download) - annotate - [select for diffs], Sat Aug 20 14:11:31 2022 UTC (21 months, 2 weeks ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.66: +6 -9 lines
Diff to previous 1.66 (colored)

Support RTLD_NOLOAD in ld.so. From guenther@. OK jca@ guenther@

Revision 1.66 / (download) - annotate - [select for diffs], Sat Jan 8 06:49:41 2022 UTC (2 years, 5 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.65: +4 -2 lines
Diff to previous 1.65 (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.65 / (download) - annotate - [select for diffs], Tue Mar 16 18:03:06 2021 UTC (3 years, 2 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.64: +3 -1 lines
Diff to previous 1.64 (colored)

On i386 don't attempt to map shared libraries in low memory when
a large executable's .text section crosses the 512MB exec line.

Executables that have MAXTSIZ > 64MB can map above the default
512MB exec line. When this happens, shared libs that attempt to map
into low memory will find their .data section can not be mapped. ld.so
will attempt to remap the share lib at higher addresses until it can be
mapped. For very large executables like chrome this process is very
time consuming. This change detects how much of the executable's
.text section exceeds 512MB and uses that as the initial hint for
shared libs to map into which avoids attempting to map into blocked
memory.

okay deraadt@

Revision 1.64 / (download) - annotate - [select for diffs], Mon Dec 9 23:15:03 2019 UTC (4 years, 6 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.63: +10 -9 lines
Diff to previous 1.63 (colored)

When loading a library, mmap(2) may fail.  Then everything gets
unmapped and ld.so tries again with different random address layout.
In this case, use the new libc executable address for msyscall(2),
not one from the first try.  Fixes sporadic bogus syscall on i386.
OK deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Mon Dec 9 22:15:15 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.62: +3 -2 lines
Diff to previous 1.62 (colored)

print addresses upon msyscall failure, for now

Revision 1.62 / (download) - annotate - [select for diffs], Sat Nov 30 23:06:02 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.61: +8 -6 lines
Diff to previous 1.61 (colored)

Sigh, fix i386 msyscall() case to permission the correct address range.

Revision 1.61 / (download) - annotate - [select for diffs], Fri Nov 29 06:34:44 2019 UTC (4 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.60: +15 -2 lines
Diff to previous 1.60 (colored)

Repurpose the "syscalls must be on a writeable page" mechanism to
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

Revision 1.60 / (download) - annotate - [select for diffs], Fri Oct 4 17:42:16 2019 UTC (4 years, 8 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.59: +6 -4 lines
Diff to previous 1.59 (colored)

Convert the child_list member from a linked list to a vector.

ok mpi@

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 25 18:13:13 2019 UTC (5 years, 4 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.58: +20 -31 lines
Diff to previous 1.58 (colored)

On i386, ensure that the first PT_LOAD segment is below the W^X
line unless it is writable.

lld places read-only sections below the gap so this is needed
to be able to retain W^X with lld. Note however the read-only
sections below the W^X line are now executable on pre-NX
machines and a possible source of gadgets. This is a change
from Gnu ld where RO sections were ordered above the W^X line
and not executable.

okay drahn@ kettenis@ deraadt@

Revision 1.58 / (download) - annotate - [select for diffs], Fri Dec 8 05:25:20 2017 UTC (6 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Everyone knows this as ld.so, nor by the ancient name rtld.
ok guenther

Revision 1.57 / (download) - annotate - [select for diffs], Tue Jan 24 07:48:36 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.56: +3 -3 lines
Diff to previous 1.56 (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.56 / (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.55: +2 -2 lines
Diff to previous 1.55 (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.55 / (download) - annotate - [select for diffs], Mon Aug 8 21:59:20 2016 UTC (7 years, 10 months ago) by guenther
Branch: MAIN
Changes since 1.54: +10 -2 lines
Diff to previous 1.54 (colored)

Look for a PT_GNU_RELRO section per object and, if present, mprotect that
range instead of the [__got_start, __got_end) range.
On many archs this will cover _DYNAMIC too, so move up the DT_DEBUG handling
to before relocations and the mprotect are done.

ok kettenis@

Revision 1.54 / (download) - annotate - [select for diffs], Mon Jul 4 21:15:06 2016 UTC (7 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.53: +1 -6 lines
Diff to previous 1.53 (colored)

Remove prebind support: binding to symbol table indices is too fragile
for our development process.

ok kettenis@ deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Sat May 7 19:05:23 2016 UTC (8 years, 1 month ago) by guenther
Branch: MAIN
Changes since 1.52: +16 -1 lines
Diff to previous 1.52 (colored)

Use a Thread Information Block in both single and multi-threaded programs.
This stores errno, the cancelation flags, and related bits for each thread
and is allocated by ld.so or libc.a.  This is an ABI break from 5.9-stable!

Make libpthread dlopen'able by moving the cancelation wrappers into libc
and doing locking and fork/errno handling via callbacks that libpthread
registers when it first initializes.  'errno' *must* be declared via
<errno.h> now!

Clean up libpthread's symbol exports like libc.

On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec.

Testing by various, particularly sthen@ and patrick@
ok kettenis@

Revision 1.52 / (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.51: +3 -4 lines
Diff to previous 1.51 (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.51 / (download) - annotate - [select for diffs], Tue Dec 22 08:54:16 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.50: +2 -2 lines
Diff to previous 1.50 (colored)

assign pointers to NULL rather than 0

Revision 1.50 / (download) - annotate - [select for diffs], Fri Nov 6 05:12:30 2015 UTC (8 years, 7 months ago) by guenther
Branch: MAIN
Changes since 1.49: +18 -1 lines
Diff to previous 1.49 (colored)

Fix unloading of load groups when the last reference wasn't on the
load_object but rather some descendent.  Detect that case in
_dl_unload_shlib() and switch to unloading the entire group.

Based on partial analyses by Henri Kemppainen (duclare (at) guu.fi)
and Peter Hajdu (peter.ferenc.hajdu (at) gmail.com)
ok millert@

Revision 1.49 / (download) - annotate - [select for diffs], Thu Jan 22 05:48:17 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

delete annoying white space that annoy

Revision 1.48 / (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.47: +1 -2 lines
Diff to previous 1.47 (colored)

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

Revision 1.47 / (download) - annotate - [select for diffs], Thu Jul 10 09:03:01 2014 UTC (9 years, 11 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.46: +5 -2 lines
Diff to previous 1.46 (colored)

check all memory allocations; ok miod@ guenther@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Jul 9 12:54:03 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Use O_CLOEXEC to make sure fork+exec in a threaded process can't
see the fds used by dlopen()

ok otto@ miod@

Revision 1.45 / (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.44: +3 -2 lines
Diff to previous 1.44 (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.44 / (download) - annotate - [select for diffs], Mon Aug 20 23:25:07 2012 UTC (11 years, 9 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.43: +7 -1 lines
Diff to previous 1.43 (colored)

Add support for .openbsd.randomdata sections and PT_OPENBSD_RANDOMIZE
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

Revision 1.43 / (download) - annotate - [select for diffs], Sat Jul 21 06:46:58 2012 UTC (11 years, 10 months ago) by matthew
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.42: +46 -53 lines
Diff to previous 1.42 (colored)

Add a new mmap(2) flag __MAP_NOREMAP for use with MAP_FIXED to
indicate that the kernel should fail with MAP_FAILED if the specified
address is not currently available instead of unmapping it.

Change ld.so on i386 to make use of __MAP_NOREMAP to improve
reliability.

__MAP_NOREMAP diff by guenther based on an earlier diff by Ariane;
ld.so bits by guenther and me
bulk build stress testing of earlier diffs by sthen
ok deraadt; committing now for further testing

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jun 12 20:32:17 2012 UTC (11 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.41: +2 -3 lines
Diff to previous 1.41 (colored)

Fix loaded object sod matching: when we load libfoo.so.X.Y into
memory, we should be able to match other requests for libfoo.so.X.Z
against that same object.

ok kurt, kettenis

Revision 1.41 / (download) - annotate - [select for diffs], Tue May 8 14:32:01 2012 UTC (12 years, 1 month ago) by jsing
Branch: MAIN
Changes since 1.40: +6 -0 lines
Diff to previous 1.40 (colored)

Refuse to load ELF objects that contain a PT_TLS program header.
Otherwise the binary assumes that the requested TLS storage has been
allocated and will happily use it, resulting in unwanted memory corruption.

ok guenther@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Jan 9 17:01:22 2012 UTC (12 years, 5 months ago) by ariane
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.39: +11 -9 lines
Diff to previous 1.39 (colored)

Don't mmap 0 byte areas, treat them as a noop instead.

ok miod@

Revision 1.39 / (download) - annotate - [select for diffs], Mon Nov 28 20:59:03 2011 UTC (12 years, 6 months ago) by guenther
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

Add support for getting some flags from DT_FLAGS_1: new flags
DF_1_NODELETE and DF_1_INITFIRST, as well as DF_1_NOW and DF_1_GLOBAL.

Committing for kurt@ who worked out the final version; ok guenther@ drahn@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Nov 16 18:59:00 2010 UTC (13 years, 6 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.37: +3 -2 lines
Diff to previous 1.37 (colored)

Fix error message when ld.so ends up loading a different than expected
library, but other library needs the one loaded. mostly ok kurt@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Oct 25 20:34:44 2010 UTC (13 years, 7 months ago) by kurt
Branch: MAIN
Changes since 1.36: +1 -13 lines
Diff to previous 1.36 (colored)

Search loaded libs first and add support for SONAME matching. ok drahn@

Revision 1.36 / (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.35: +7 -6 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Mon May 5 02:29:02 2008 UTC (16 years, 1 month ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.34: +4 -3 lines
Diff to previous 1.34 (colored)

Constantly fill in the program header pointer and count in elf_object_t
for all objects which simplifies phdr usage in a few places.
"go for it" drahn@

Revision 1.34 / (download) - annotate - [select for diffs], Wed May 10 03:26:50 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.33: +5 -6 lines
Diff to previous 1.33 (colored)

pretty this up; ok drahn

Revision 1.33 / (download) - annotate - [select for diffs], Wed May 3 16:10:51 2006 UTC (18 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.32: +7 -1 lines
Diff to previous 1.32 (colored)

prebind - how to prelink a binary without throwing security out the window

Prelink fixes the address of libraries making 'return to libc' attacks trival,
prebind uses a different method to achieve most of the same gains, however
without adding any security conerns.

Still under development, now in-tree.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Nov 9 16:41:29 2005 UTC (18 years, 7 months ago) by kurt
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

add RTLD_NOW support to dlopen and propogate -z now to dep libs.
ok drahn@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Oct 12 20:36:16 2005 UTC (18 years, 8 months ago) by kurt
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Split grpsym_list creation away from child_list creation and change
grpsym_list order to match Sun's docs. Also corrects bugs where
grpsym_list was either not created or partially created.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Oct 9 04:29:13 2005 UTC (18 years, 8 months ago) by kurt
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

introduce object ref count macros (suggested by dale). no functional
change.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Oct 6 21:53:10 2005 UTC (18 years, 8 months ago) by kurt
Branch: MAIN
Changes since 1.28: +13 -12 lines
Diff to previous 1.28 (colored)

separate load group references from dep lib child/dload lists. move load
group refs to own per object ref counter (grprefcount) and list
(grpref_list). corrects more complex load group ref cases and side effects
from initial implementation. design ideas and ok drahn@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Oct 3 19:48:24 2005 UTC (18 years, 8 months ago) by kurt
Branch: MAIN
Changes since 1.27: +1 -5 lines
Diff to previous 1.27 (colored)

refcount corrections: count common dep libs once and centralize dep lib
refcount increments to _dl_link_sub. adjust _dl_notify_unload_shlib to
match new refcount method. ok drahn@

Revision 1.27 / (download) - annotate - [select for diffs], Sat Oct 1 19:32:22 2005 UTC (18 years, 8 months ago) by drahn
Branch: MAIN
Changes since 1.26: +18 -1 lines
Diff to previous 1.26 (colored)

handle references to load groups caused by dlopen()ing of depenant
members of the load group. work by kurt@ and myself

Revision 1.26 / (download) - annotate - [select for diffs], Wed Sep 28 21:56:24 2005 UTC (18 years, 8 months ago) by drahn
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored)

correct last commit, in both files.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Sep 27 14:47:00 2005 UTC (18 years, 8 months ago) by kurt
Branch: MAIN
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

increment refcount when opening a lib that is already open (dev/inode
case) ok drahn@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Sep 26 14:51:05 2005 UTC (18 years, 8 months ago) by drahn
Branch: MAIN
Changes since 1.23: +6 -1 lines
Diff to previous 1.23 (colored)

Fully unload dependant libraries, fixes gphoto2 bug.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Sep 16 23:19:41 2005 UTC (18 years, 8 months ago) by drahn
Branch: MAIN
Changes since 1.22: +6 -2 lines
Diff to previous 1.22 (colored)

Rework symbol lookup to more closely match sun's documentation, now
treats dlopens as load groups. ok kurt@

Revision 1.22 / (download) - annotate - [select for diffs], Tue May 31 14:31:36 2005 UTC (19 years ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.21: +1 -3 lines
Diff to previous 1.21 (colored)

removed unused var, pointed out by wilfried@

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 30 23:31:16 2005 UTC (19 years ago) by drahn
Branch: MAIN
Changes since 1.20: +1 -5 lines
Diff to previous 1.20 (colored)

unload is not to be recursive anymore, previous diff change method but
this code was missed, fixes issue seen by tedu and millert hopefully php too.

Revision 1.20 / (download) - annotate - [select for diffs], Mon May 23 19:22:11 2005 UTC (19 years ago) by drahn
Branch: MAIN
Changes since 1.19: +1 -10 lines
Diff to previous 1.19 (colored)

fixes for dlclose, ok kettenis@

Revision 1.19 / (download) - annotate - [select for diffs], Tue May 10 03:36:07 2005 UTC (19 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.18: +18 -3 lines
Diff to previous 1.18 (colored)

Recommit the destructor order fix, now that the amd64 bug was fixed.
'no problem' pval@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Apr 6 00:16:53 2005 UTC (19 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.17: +2 -17 lines
Diff to previous 1.17 (colored)

backout -- breaks at least amd64; spotted by marc

Revision 1.17 / (download) - annotate - [select for diffs], Tue Apr 5 19:29:09 2005 UTC (19 years, 2 months ago) by drahn
Branch: MAIN
Changes since 1.16: +18 -3 lines
Diff to previous 1.16 (colored)

Do a better job of running destructors in the right order.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Mar 23 19:48:05 2005 UTC (19 years, 2 months ago) by drahn
Branch: MAIN
Changes since 1.15: +3 -323 lines
Diff to previous 1.15 (colored)

Code reorganization, move copied code in library.c and library_mquery.c
into its own file. no functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Mar 22 18:03:39 2005 UTC (19 years, 2 months ago) by drahn
Branch: MAIN
Changes since 1.14: +13 -1 lines
Diff to previous 1.14 (colored)

fix PR3944 on i386 (ugh), from library.c
--
Fix some problems related to LD_LIBRARY_PATH parsing where it would not
correctly deal with current directory searches specified by "::", ":foo" or
"foo:"
--
ok mickey@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jul 5 00:47:40 2004 UTC (19 years, 11 months ago) by kjell
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.13: +20 -2 lines
Diff to previous 1.13 (colored)

Fix an issue where a shared library could be loaded at two different
locations by resolving all dlopens back to a dev/inode.

i.e. Don't load a library if the dev/inode it stats back to matches one
already in our list.

fix started (and ok'ed) drahn@. ok deraadt@.
"doesn't break anything yet" pval@ art@ brad@

Revision 1.13 / (download) - annotate - [select for diffs], Tue Sep 2 15:17:51 2003 UTC (20 years, 9 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.12: +5 -2 lines
Diff to previous 1.12 (colored)

Fix PR 3371, symbol lookup in dlopen()ed objects is not correct. Correct
behavior for RTLD_GLOBAL/RTLD_LOCAL is now supported. ok espie@

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jul 18 14:09:02 2003 UTC (20 years, 10 months ago) by drahn
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Fix print if minor of library used is is less than requested. ok tdeval@

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 6 20:03:57 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Wed Jul 2 08:18:03 2003 UTC (20 years, 11 months ago) by niklas
Branch: MAIN
Changes since 1.9: +36 -22 lines
Diff to previous 1.9 (colored)

Correct library search algorithm, wrt versioned objects

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 22 21:39:01 2003 UTC (20 years, 11 months ago) by drahn
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Dynamic linking random order fixes. This enables random library ordering.
Tested by naddy@ and others.

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

pefo 3/4 licence cleanups

Revision 1.7 / (download) - annotate - [select for diffs], Fri May 30 01:13:53 2003 UTC (21 years ago) by drahn
Branch: MAIN
Changes since 1.6: +2 -7 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Mon Apr 28 21:32:08 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.5: +7 -8 lines
Diff to previous 1.5 (colored)

Change mquery() function call signature to be the same a mmap(). It
needs the prot/flags info and passing the addresses via arg/return allows
it to be traced via ktrace better than an in/out paramter.
This adds a new mquery syscall and renames the old one to omquery.
New kernel _MUST_ be built, booted, and 'make includes' before building
ld.so with this change.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Apr 25 20:32:07 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.4: +7 -6 lines
Diff to previous 1.4 (colored)

backout mquery change, something broke when not combined with a different diff.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Apr 25 18:30:18 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.3: +7 -8 lines
Diff to previous 1.3 (colored)

change mquery() function call signature to be the same a mmap(). It
needs the prot/flags info and passing the addresses via arg/return allows
it to be traced via ktrace better than an in/out paramter.
This adds a new mquery syscall and renames the old one to omquery.
New kernel _MUST_ be built and installed before building ld.so with this change.
ok millert@ tedu@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Apr 21 14:35:50 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

Fix the load_size which is used by ldd to print end address.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Apr 18 12:38:39 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN
Changes since 1.1: +1 -9 lines
Diff to previous 1.1 (colored)

Adjusting the start is wrong. The value returned by mquery() should be used
here. Fixes a bug with emacs21. tested by marc@ and others.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Apr 17 03:40:45 2003 UTC (21 years, 1 month ago) by drahn
Branch: MAIN

mquery support, currently for i386 only.

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.