paulfloyd / freebsd_valgrind

Git repo used to Upstream the FreeBSD Port of Valgrind
GNU General Public License v2.0
15 stars 4 forks source link

memcheck/tests/freebsd/extattr reports unexpected failure #114

Closed nbriggs closed 4 years ago

nbriggs commented 4 years ago

In this output the second report, for sys_extattr_get_file(data) is unexpected:

Syscall param extattr_get_file(nbytes) contains uninitialised byte(s)
   at 0x........: extattr_get_file (in /...libc...)
   by 0x........: main (extattr.c:35)

Syscall param sys_extattr_get_file(data) points to unaddressable byte(s)
   at 0x........: extattr_get_file (in /...libc...)
   by 0x........: main (extattr.c:35)
 Address 0x........ is not stack'd, malloc'd or (recently) free'd

from extattr.c:35:

    extattr_get_file("test1", EXTATTR_NAMESPACE_USER, "bar", buff, uninit);

The implementation in syswrap-freebsd.c which is reporting this is:

    if (ARG4)
    {
        PRE_MEM_WRITE("sys_extattr_get_file(data)", ARG4, ARG5);
    }

In this case, the uninitialized ARG5 happened to be 0xFBBFEBC8, so yes, accessing that much of ARG4 would run into unaddressable bytes.

paulfloyd commented 4 years ago

Fixed with push To https://github.com/paulfloyd/freebsd_valgrind.git 7bb5bf7af..a20556b53 freebsd -> freebsd

nbriggs commented 4 years ago

Works for me.