Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 2021 17:51:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 248184] readlink("/proc/curproc/file") returns arbitrary correct name for programs with more than one link (name)
Message-ID:  <bug-248184-227-GJaHXYZ09j@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-248184-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-248184-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248184

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

URL:
https://cgit.FreeBSD.org/src/commit/?id=3D0c10648fbb758bb76fd29330b7fe1bc51=
9252325

commit 0c10648fbb758bb76fd29330b7fe1bc519252325
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-10-23 00:24:08 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-10-28 17:49:31 +0000

    exec: provide right hardlink name in AT_EXECPATH

    For this, use vn_fullpath_hardlink() to resolve executable name for
    execve(2).

    This should provide the right hardlink name, used for execution, instead
    of random hardlink pointing to this binary.  Also this should make the
    AT_EXECNAME reliable for execve(2), since kernel only needs to resolve
    parent directory path, which should always succeed (except pathological
    cases like unlinking a directory).

    PR:     248184
    Reviewed by:    markj
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D32611

 sys/kern/kern_exec.c | 38 ++++++++++++++++++++++++++++----------
 1 file changed, 28 insertions(+), 10 deletions(-)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-248184-227-GJaHXYZ09j>