diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2003-05-30 01:13:54 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2003-05-30 01:13:54 +0000 |
commit | e0412874e2e423e326125c2e936d4d27d7f2e87b (patch) | |
tree | a812a7dd7f9a4d94243a97d3947e66fe9d372314 /libexec/ld.so/dlfcn.c | |
parent | 441e1efd56d21b17558bc2e2803d3409279c359b (diff) |
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.
Diffstat (limited to 'libexec/ld.so/dlfcn.c')
-rw-r--r-- | libexec/ld.so/dlfcn.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c index d68c1dc9491..6212043ce27 100644 --- a/libexec/ld.so/dlfcn.c +++ b/libexec/ld.so/dlfcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dlfcn.c,v 1.25 2003/04/28 22:51:25 marc Exp $ */ +/* $OpenBSD: dlfcn.c,v 1.26 2003/05/30 01:13:53 drahn Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -65,6 +65,7 @@ dlopen(const char *libname, int how) _dl_thread_kern_stop(); object = _dl_load_shlib(libname, _dl_objects, OBJTYPE_DLO); + _dl_link_sub(object, _dl_objects); _dl_thread_kern_go(); if (object == 0) return((void *)0); @@ -93,6 +94,7 @@ dlopen(const char *libname, int how) libname = dynobj->dyn.strtab + dynp->d_un.d_val; _dl_thread_kern_stop(); depobj = _dl_load_shlib(libname, dynobj, OBJTYPE_LIB); + _dl_link_sub(depobj, dynobj); _dl_thread_kern_go(); if (!depobj) _dl_exit(4); |