Bug 453147 - valgrind doesn't know the capset system call
Summary: valgrind doesn't know the capset system call
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-27 15:14 UTC by Lennart Poettering
Modified: 2009-12-21 09:52 UTC (History)
1 user (show)

Fixed In Version: valgrind-3.5.0-9
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-21 09:52:05 UTC
Type: ---
Embargoed:


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

Description Lennart Poettering 2008-06-27 15:14:43 UTC
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 19:10:01 UTC
triaged

Comment 2 Denys Vlasenko 2008-08-22 15:50:31 UTC
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 15:51:16 UTC
Created attachment 314812 [details]
Trivial patch which enables capset/capget for amd64

Comment 4 Denys Vlasenko 2008-08-22 15:51:59 UTC
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 14:06:11 UTC
Ping?

Comment 7 Jakub Jelinek 2009-12-21 09:52:05 UTC
Works in valgrind-3.5.0-9.


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