https://bugs.kde.org/show_bug.cgi?id=377698

            Bug ID: 377698
           Summary: Missing memory check for futex() uaddr arg for
                    FUTEX_WAKE and FUTEX_WAKE_BITSET
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: diane.meirow...@oracle.com
  Target Milestone: ---

Memcheck does not do a memory check on the uaddr argument for futex for
FUTEX_WAKE and FUTEX_WAKE_BITSET cases. According to the Linux sources,
the uaddr argument is dereferenced in all cases. Here is a patch to fix this:

diff -r 231368959406 coregrind/m_syswrap/syswrap-linux.c
--- a/coregrind/m_syswrap/syswrap-linux.c       Tue Mar 14 09:47:29 2017 -0700
+++ b/coregrind/m_syswrap/syswrap-linux.c       Wed Mar 15 12:18:29 2017 -0700
@@ -1678,14 +1678,11 @@
   case VKI_FUTEX_FD:
   case VKI_FUTEX_TRYLOCK_PI:
   case VKI_FUTEX_UNLOCK_PI:
+   case VKI_FUTEX_WAKE:
+   case VKI_FUTEX_WAKE_BITSET:
      PRE_MEM_READ( "futex(futex)", ARG1, sizeof(Int) );
     break;

-   case VKI_FUTEX_WAKE:
-   case VKI_FUTEX_WAKE_BITSET:
-      /* no additional pointers */
-      break;
-

I am testing this now. It is likely that the only test cases the patch will
affect is memcheck/tests/*/scalar.c.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to