|
From: <sv...@va...> - 2014-08-05 11:36:19
|
Author: bart Date: Tue Aug 5 11:35:48 2014 New Revision: 14232 Log: Linux system call wrappers: truncate ioctl request number to 32 bits As explained in https://bugs.kde.org/show_bug.cgi?id=331829, when passing an ioctl request number as an int to a function the request number will be sign-extended to 64 bits on 64-bit systems. Avoid that this causes Valgrind to fail to recognize an ioctl by truncating the request number to 32 bits. Modified: trunk/coregrind/m_syswrap/syswrap-linux.c Modified: trunk/coregrind/m_syswrap/syswrap-linux.c ============================================================================== --- trunk/coregrind/m_syswrap/syswrap-linux.c (original) +++ trunk/coregrind/m_syswrap/syswrap-linux.c Tue Aug 5 11:35:48 2014 @@ -5373,6 +5373,8 @@ { *flags |= SfMayBlock; + ARG2 = (UInt)ARG2; + // We first handle the ones that don't use ARG3 (even as a // scalar/non-pointer argument). switch (ARG2 /* request */) { @@ -7103,6 +7105,8 @@ { vg_assert(SUCCESS); + ARG2 = (UInt)ARG2; + /* --- BEGIN special IOCTL handlers for specific Android hardware --- */ # if defined(VGPV_arm_linux_android) || defined(VGPV_x86_linux_android) \ |