Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Feb 2025 13:49:16 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 284563] Holes in struct rtld_utrace
Message-ID:  <bug-284563-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 284563
           Summary: Holes in struct rtld_utrace
           Product: Base System
           Version: 14.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: pjfloyd@wanadoo.fr

The definition of struct rtld_utrace is

struct utrace_rtld {
        char sig[RTLD_UTRACE_SIG_SZ];
        int event;
        /* 4 byte hole */
        void *handle;
        void *mapbase;                  /* Used for 'parent' and 'init/fini=
' */
        size_t mapsize;
        int refcnt;                     /* Used for 'mode' */
        /* 4 byte hole */
        char name[MAXPATHLEN];
};

And the interface for utrace is

335     AUE_NULL        STD|CAPENABLED {
                int utrace(
                    _In_reads_bytes_(len) const void *addr,
                    size_t len
                );
        }

I don't know what other uses of utrace exise, but rtld ld_utrace_log does n=
ot
memset utrace_rtld  to 0 before filling the fields, leaving the holes
uninitialized.

This poses a problem for Valgrind memcheck testing the syscall parameters. =
At
present it just uses the pointer and length to indicate memory that will be
read in the syscall (abd should be initialized). I can fix this in Valgrind=
 by
using struct utrace_rtld.

I think that a better fix would be on the FreeBSD side by putting the 'even=
t'
and 'refcnt' fields together. Would that be possible without breaking backw=
ards
compatibility?

--=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-284563-227>