|
From: <sv...@va...> - 2015-04-07 20:44:03
|
Author: florian Date: Tue Apr 7 21:43:55 2015 New Revision: 15075 Log: Certain kernels on s390 provide extra read permissions on executable segments. See discussion here: https://bugs.kde.org/show_bug.cgi?id=345824#c4 Making sure that rx and x compare equal. Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c ============================================================================== --- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c (original) +++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c Tue Apr 7 21:43:55 2015 @@ -770,7 +770,7 @@ const HChar* filename ) { Int iLo, iHi, i; - Bool sloppyXcheck; + Bool sloppyXcheck, sloppyRcheck; /* If a problem has already been detected, don't continue comparing segments, so as to avoid flooding the output with error @@ -814,6 +814,14 @@ sloppyXcheck = False; # endif + /* Some kernels on s390 provide 'r' permission even when it was not + explicitly requested. It seems that 'x' permission implies 'r'. */ +# if defined(VGA_s390x) + sloppyRcheck = True; +# else + sloppyRcheck = False; +# endif + /* NSegments iLo .. iHi inclusive should agree with the presented data. */ for (i = iLo; i <= iHi; i++) { @@ -868,6 +876,11 @@ seg_prot |= VKI_PROT_EXEC; } + if (sloppyRcheck && (prot & (VKI_PROT_EXEC | VKI_PROT_READ)) == + (VKI_PROT_EXEC | VKI_PROT_READ)) { + seg_prot |= VKI_PROT_READ; + } + same = same && seg_prot == prot && (cmp_devino |