Bug 453147 - valgrind doesn't know the capset system call
valgrind doesn't know the capset system call
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: valgrind (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-27 11:14 EDT by Lennart Poettering
Modified: 2009-12-21 04:52 EST (History)
1 user (show)

See Also:
Fixed In Version: valgrind-3.5.0-9
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-21 04:52:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Trivial patch which enables capset/capget for amd64 (944 bytes, patch)
2008-08-22 11:51 EDT, Denys Vlasenko
no flags Details | Diff

  None (edit)
Description Lennart Poettering 2008-06-27 11:14:43 EDT
valgrind doesn't recognize the capset system call on x86_64. capset has been
around for years now, it would be good if valgrind would be able to deal with it.
Comment 1 John Poelstra 2008-06-27 15:10:01 EDT
triaged
Comment 2 Denys Vlasenko 2008-08-22 11:50:31 EDT
Reproducer:

#undef _POSIX_SOURCE
#include <sys/capability.h>
#include <stdio.h>
int main() {
        struct __user_cap_header_struct h;
        struct __user_cap_data_struct d;
        h.version = _LINUX_CAPABILITY_VERSION;
        h.pid = 0;
        capget(&h, &d);
        /* unpatched valgrind complains that we use uninitialized data: */
        printf("effective %x\n", d.effective);
        printf("permitted %x\n", d.permitted);
        printf("inheritable %x\n", d.inheritable);
        return 0;
}

# gcc t.c -lcap
# valgrind ./a.out
==22535== Memcheck, a memory error detector.
==22535== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==22535== Using LibVEX rev 1804, a library for dynamic binary translation.
==22535== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==22535== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==22535== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==22535== For more details, rerun with: -v
==22535==
--22535-- WARNING: unhandled syscall: 125
--22535-- You may be able to write your own handler.
--22535-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--22535-- Nevertheless we consider this a bug.  Please report
--22535-- it at http://valgrind.org/support/bug_reports.html.
==22535== Use of uninitialised value of size 8
==22535==    at 0x3824845E89: _itoa_word (in /lib64/libc-2.8.so)
==22535==    by 0x382484900D: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400640: main (in /root/srcdevel/valgrind/fix/a.out)
==22535==
==22535== Conditional jump or move depends on uninitialised value(s)
==22535==    at 0x3824845E90: _itoa_word (in /lib64/libc-2.8.so)
==22535==    by 0x382484900D: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400640: main (in /root/srcdevel/valgrind/fix/a.out)
==22535==
==22535== Conditional jump or move depends on uninitialised value(s)
==22535==    at 0x382484908E: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400640: main (in /root/srcdevel/valgrind/fix/a.out)
effective 0
==22535==
==22535== Use of uninitialised value of size 8
==22535==    at 0x3824845E89: _itoa_word (in /lib64/libc-2.8.so)
==22535==    by 0x382484900D: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400652: main (in /root/srcdevel/valgrind/fix/a.out)
==22535==
==22535== Conditional jump or move depends on uninitialised value(s)
==22535==    at 0x3824845E90: _itoa_word (in /lib64/libc-2.8.so)
==22535==    by 0x382484900D: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400652: main (in /root/srcdevel/valgrind/fix/a.out)
==22535==
==22535== Conditional jump or move depends on uninitialised value(s)
==22535==    at 0x382484908E: vfprintf (in /lib64/libc-2.8.so)
==22535==    by 0x3824851079: printf (in /lib64/libc-2.8.so)
==22535==    by 0x400652: main (in /root/srcdevel/valgrind/fix/a.out)
permitted 0
...
Comment 3 Denys Vlasenko 2008-08-22 11:51:16 EDT
Created attachment 314812 [details]
Trivial patch which enables capset/capget for amd64
Comment 4 Denys Vlasenko 2008-08-22 11:51:59 EDT
With patched valgrind:

# ./vg-in-place /root/srcdevel/valgrind/fix/a.out
==22602== Memcheck, a memory error detector.
==22602== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==22602== Using LibVEX rev exported, a library for dynamic binary translation.
==22602== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==22602== Using valgrind-3.4.0.SVN, a dynamic binary instrumentation framework.
==22602== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==22602== For more details, rerun with: -v
==22602==
effective ffffffff
permitted ffffffff
inheritable 0
==22602==
==22602== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 1)
==22602== malloc/free: in use at exit: 0 bytes in 0 blocks.
==22602== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==22602== For counts of detected errors, rerun with: -v
==22602== All heap blocks were freed -- no leaks are possible.
Comment 6 Lennart Poettering 2008-12-18 09:06:11 EST
Ping?
Comment 7 Jakub Jelinek 2009-12-21 04:52:05 EST
Works in valgrind-3.5.0-9.

Note You need to log in before you can comment on or make changes to this bug.