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

            Bug ID: 408091
           Summary: Missing pkey syscalls
           Product: valgrind
           Version: 3.15 SVN
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: m...@klomp.org
  Target Milestone: ---

Since linux 4.9 there are a couple of syscalls to handle memory protection
keys.

Valgrind doesn't support memory protection keys and the RDPKRU/WRPKRU
instructions to update the new PKRU register.

But the syscalls have some use without that support.
First pkey_alloc () can be used to check whether memory protection keys are
usage:

       pkey_alloc() is always safe to call regardless of whether or not the
       operating system supports protection keys.  It can be used in lieu of
       any other mechanism for detecting pkey support and will simply fail
       with the error ENOSPC if the operating system has no pkey support.

Secondly pkey_mprotect can be used even without a real pkey:

If the key allocation fails due to lack of support for memory protection keys,
the pkey_mprotect call can usually be skipped. In this case, the region will
not be protected by default. It is also possible to call pkey_mprotect with a
key value of -1, in which case it will behave in the same way as mprotect.

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

Reply via email to