[Bug 255698] dlerror() returns non-NULL after a successful call to dlopen()/dlsym()

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon May 10 23:48:47 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255698

--- Comment #3 from commit-hook at FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=630caa95d46191220dd457c2ae2d06460cb4f71b

commit 630caa95d46191220dd457c2ae2d06460cb4f71b
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-05-10 19:02:19 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-05-10 23:47:00 +0000

    rtld: preserve the 'seen' state of the dlerror message in errmsg_save()

    rtld preserves its current error message around calls to user init/fini
    lists, to not override original error with potential secondary errors
    caused by user code recursing into rtld.  After 4d9128da54f8f8e2a29190,
    the preservation of the string itself is not enough, the 'seen'
    indicator must be preserved as well.  Otherwise, since new code does not
    clear string (it cannot), call to _rtld_error() from errmsg_restore()
    revived whatever message was consumed last.

    Change errmsg_save() to return structure recording both 'seen' indicator
    and the message, if any.

    PR:     255698
    Reported by:    Eugene M. Kim <astralblue at gmail.com>
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days

 libexec/rtld-elf/rtld.c | 37 +++++++++++++++++++++++++------------
 1 file changed, 25 insertions(+), 12 deletions(-)

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list