History log of /freebsd-12.1/libexec/rtld-elf/libmap.c (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0
# adbc4082 11-Feb-2019 Konstantin Belousov <[email protected]>

MFC r339877-r339879,r343564-r343566,r343580,r343754:
Untangle jemalloc and mutexes initialization.

The merge includes required warnings cleanup by arichardson, both to
avoid conflicts and to make rt

MFC r339877-r339879,r343564-r343566,r343580,r343754:
Untangle jemalloc and mutexes initialization.

The merge includes required warnings cleanup by arichardson, both to
avoid conflicts and to make rtld_malloc.c compilable with the libthr
WARNS settings.

show more ...


Revision tags: release/12.0.0
# 6c306765 26-Sep-2018 Konstantin Belousov <[email protected]>

When doing lm_add(), check for duplicates.

This is useful when lm_find() moves the match to the global mapping,
since lm_find() could be called with a same path more than once.

Reported and tested

When doing lm_add(), check for duplicates.

This is useful when lm_find() moves the match to the global mapping,
since lm_find() could be called with a same path more than once.

Reported and tested by: Andreas Longwitz <[email protected]>
Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

show more ...


# c1a0a86e 02-Sep-2018 Konstantin Belousov <[email protected]>

Style cleanup. No functional changes.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Approved by: re (rgrimes)


Revision tags: release/11.2.0
# 152036a0 29-Oct-2017 Edward Tomasz Napierala <[email protected]>

Plug memory leak on error case.

Reported by: Coverity
CID: 1382112
MFC after: 2 weeks


# a8b31c14 24-Oct-2017 Edward Tomasz Napierala <[email protected]>

Use xmalloc and read(2) instead of mmap(2) to read in libmap.conf(5).
This removes the need to call munmap(2) afterwards.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://

Use xmalloc and read(2) instead of mmap(2) to read in libmap.conf(5).
This removes the need to call munmap(2) afterwards.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12767

show more ...


# 6b61e3e4 22-Oct-2017 Edward Tomasz Napierala <[email protected]>

Don't call realpath(3) from libmap rtld code. This gets rid of a few calls
to fstatat(2) at binary startup; the difference looks like this:

--- przed 2017-10-14 13:55:49.983528000 +0100
+++ po

Don't call realpath(3) from libmap rtld code. This gets rid of a few calls
to fstatat(2) at binary startup; the difference looks like this:

--- przed 2017-10-14 13:55:49.983528000 +0100
+++ po 2017-10-14 14:10:39.134343000 +0100
@@ -1,15 +1,10 @@
mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34366173184 (0x800623000)
issetugid() = 0 (0x0)
-fstatat(AT_FDCWD,"/etc",{ mode=drwxr-xr-x ,inode=1364352,size=2560,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=1373288,size=102,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
openat(AT_FDCWD,"/etc/libmap.conf",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=1373288,size=102,blksize=32768 }) = 0 (0x0)
mmap(0x0,102,PROT_READ,MAP_PRIVATE,3,0x0) = 34366205952 (0x80062b000)
close(3) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr",{ mode=drwxr-xr-x ,inode=561792,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local",{ mode=drwxr-xr-x ,inode=561800,size=512,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local/etc",{ mode=drwxr-xr-x ,inode=653279,size=1536,blksize=32768 },AT_SYMLINK_NOFOLLOW) = 0 (0x0)
-fstatat(AT_FDCWD,"/usr/local/etc/libmap.d",0x7fffffffcf50,AT_SYMLINK_NOFOLLOW) ERR#2 'No such file or directory'
+open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,0165) ERR#2 'No such file or directory'
munmap(0x80062b000,102) = 0 (0x0)
openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
read(3,"Ehnt\^A\0\0\0\M^@\0\0\0\M-2\0\0"...,128) = 128 (0x80)

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12741

show more ...


Revision tags: release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0, release/10.3.0
# 3deca56f 31-Oct-2015 Warner Losh <[email protected]>

Rather than using the #define for path names, indirect through a char *
variable that could change for different executable types detected.


# b2a4014c 31-Oct-2015 Warner Losh <[email protected]>

Move all the paths into a new path.h to centralize them.


Revision tags: release/10.2.0, release/10.1.0
# 0fa46a42 21-Aug-2014 Pedro F. Giffuni <[email protected]>

Always check the limits of array index variables before using them.

Obtained from: DragonFlyBSD
MFC after: 1 week


Revision tags: release/9.3.0
# 490c68de 18-May-2014 Konstantin Belousov <[email protected]>

Fix LD_LIBMAP.
The r232862 passed the pointer to end of string to lmc_parse() and free().

Submitted by: Wolfgang Jenkner <[email protected]>
MFC after: 1 week


Revision tags: release/10.0.0, release/9.2.0
# 8182b3be 21-Sep-2013 Dag-Erling Smørgrav <[email protected]>

Make the directory mapping functionality, which was previously only
available in 32-bit compatibility mode, unconditional.

Overhaul the man page, which had evolved more by accretion than by design.

Make the directory mapping functionality, which was previously only
available in 32-bit compatibility mode, unconditional.

Overhaul the man page, which had evolved more by accretion than by design.

Approved by: re (gjb)
MFC after: 3 weeks

show more ...


Revision tags: release/8.4.0, release/9.1.0
# e1942829 04-Nov-2012 Jilles Tjoelker <[email protected]>

rtld: Fix fd leak with parallel dlopen and fork/exec.

Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore,
such a file descriptor may be passed to a process created by another th

rtld: Fix fd leak with parallel dlopen and fork/exec.

Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore,
such a file descriptor may be passed to a process created by another thread
running in parallel to dlopen() or fdlopen().

No other threads are expected to be running during parsing of the hints
and libmap files but the file descriptors need not be passed to child
processes so add O_CLOEXEC there as well.

This change will break fdlopen() (as used by OpenPAM) on kernels without
F_DUPFD_CLOEXEC (added in July). Note that running new userland on old
kernels is not supported.

Reviewed by: kib

show more ...


# 5c98f307 05-May-2012 Baptiste Daroussin <[email protected]>

open the resolved path
fix debug message

Submitted by: John Marino <[email protected]>
Approved by: des (mentor)


# faf66437 30-Apr-2012 Baptiste Daroussin <[email protected]>

Add two special directives to libmap.conf:
include <file>:
Parse the contents of file before continuing with the current file.
includedir <dir>:
Parse the contents of every file in dir that ends

Add two special directives to libmap.conf:
include <file>:
Parse the contents of file before continuing with the current file.
includedir <dir>:
Parse the contents of every file in dir that ends in .conf before continuing
with the current file.
Any file or directory encountered while processing include or includedir
directives will be parsed exactly once, even if it is encountered multiple
times.

Reviewed by: kib, des
Approved by: des (mentor)
MFC after: 1 month

show more ...


Revision tags: release/8.3.0
# 6fea10fb 14-Mar-2012 Konstantin Belousov <[email protected]>

Rtld on diet 3.

Stop using strerror(3) in rtld, which brings in msgcat and stdio.
Directly access sys_errlist array of errno messages with private
rtld_strerror() function.

Now,
$ size /libexec/ld-

Rtld on diet 3.

Stop using strerror(3) in rtld, which brings in msgcat and stdio.
Directly access sys_errlist array of errno messages with private
rtld_strerror() function.

Now,
$ size /libexec/ld-elf.so.1
text data bss dec hex filename
96983 2480 8744 108207 1a6af /libexec/ld-elf.so.1

Reviewed by: dim, kan
MFC after: 2 weeks

show more ...


# 68f1db20 12-Mar-2012 Konstantin Belousov <[email protected]>

Rtld on diet part 2:

Do not use stdio for libmap.conf read. Directly map the file and
parse lines from the mappings.

Reviewed by: kan
MFC after: 3 weeks


# 44976aca 06-Mar-2012 Sergey Kandaurov <[email protected]>

Cosmetic nit:
- rename isspace1() macro to the more appropriate rtld_isspace().

Discussed with: kib


# b36070f5 05-Mar-2012 Konstantin Belousov <[email protected]>

The libmap.conf initialization is performed before TLS is functional.
Since after r232498 the ctype macros require working access to
thread-local variables, rtld crashes when libmap.conf is present.

The libmap.conf initialization is performed before TLS is functional.
Since after r232498 the ctype macros require working access to
thread-local variables, rtld crashes when libmap.conf is present.

Use hand-made isspace1() macro which is enough to detect spaces in
libmap.conf.

Reported by: alc, lme, many on current@
Tested by: lme
Reviewed by: dim, kan
MFC after: 1 week

show more ...


Revision tags: release/7.4.0, release/8.2.0, release/8.1.0, release/7.3.0, release/8.0.0, release/7.2.0, release/7.1.0, release/6.4.0, release/7.0.0, release/6.3.0, release/6.2.0, release/5.5.0, release/6.1.0
# 8c6a035e 31-Jan-2006 Peter Wemm <[email protected]>

Fix a malloc overrun in 32-bit compat libmap lookup code.


Revision tags: release/6.0.0, release/5.4.0
# 5b08cb04 04-Feb-2005 Matthew N. Dodd <[email protected]>

Description from Dan:

Another handy libmap patch. Lets you do stuff like this:

LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp

If you already have a program-specific override in libmap.c

Description from Dan:

Another handy libmap patch. Lets you do stuff like this:

LD_LIBMAP="libpthread.so.1=libthr.so.1" mythreadedapp

If you already have a program-specific override in libmap.conf, note
that you must use a program-specific override in LD_LIBMAP:

LD_LIBMAP="[mythreadedapp],libpthread.so.1=libthr.so.1" mythreadedapp

PR: bin/74471
Submitted by: Dan Nelson <dnelson AT allantgroup.com>
MFC after: 2 weeks

show more ...


# d33da23f 04-Feb-2005 Matthew N. Dodd <[email protected]>

style(9)


Revision tags: release/4.11.0, release/5.3.0, release/4.10.0
# 966efcc7 24-May-2004 Matthew N. Dodd <[email protected]>

Support basename and path based constrained matches.

eg:
[foo]
...

matches any executable 'foo'

[/usr/bin/foo/]
...

matches any executable under the directory /usr/bin/foo/

Exact matches c

Support basename and path based constrained matches.

eg:
[foo]
...

matches any executable 'foo'

[/usr/bin/foo/]
...

matches any executable under the directory /usr/bin/foo/

Exact matches continue to function as before.

PR: bin/66769
Submitted-by: Dan Nelson

show more ...


# c905e45d 21-Mar-2004 Peter Wemm <[email protected]>

Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems. Most of this involves using alternate
paths, environment variables and diagnostic messages.

The build gl

Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems. Most of this involves using alternate
paths, environment variables and diagnostic messages.

The build glue is seperate.

show more ...


Revision tags: release/5.2.1
# 6e918a4d 03-Feb-2004 Max Khon <[email protected]>

Fix "warning: value computed is not used".

Found by: gcc 2.95.4 [FreeBSD]


Revision tags: release/5.2.0, release/4.9.0
# 4402996d 13-Sep-2003 Matthew N. Dodd <[email protected]>

Change libmap.c:lm_init() to return a status value; 0 for success
(libmap available) and 1 for failure. Assign this return to the
global 'libmap_disable' variable in rtld.c.

This totally prevents a

Change libmap.c:lm_init() to return a status value; 0 for success
(libmap available) and 1 for failure. Assign this return to the
global 'libmap_disable' variable in rtld.c.

This totally prevents any libmap functions from being called after
lm_init() if no config file is present.

show more ...


12