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

--- Comment #38 from Mark Wielaard <[email protected]> ---
(In reply to Mark Wielaard from comment #37)
> >  static
> > -Bool is_valid_for( UInt kinds, Addr start, SizeT len, UInt prot )
> > +Bool is_valid_for( UInt kinds, Addr start, SizeT len, UInt prot, Bool madv 
> > )
> >  {
> >     Int  i, iLo, iHi;
> >     Bool needR, needW, needX;
> > +   Bool needGuardPageCheck = False;
> >  
> >     if (len == 0)
> >        return True; /* somewhat dubious case */
> > @@ -1267,11 +1472,22 @@ Bool is_valid_for( UInt kinds, Addr start, SizeT 
> > len, UInt prot )
> >             && (needW ? nsegments[i].hasW : True)
> >             && (needX ? nsegments[i].hasX : True) ) {
> >           /* ok */
> > +#if defined(VGO_linux)
> > +           if ( nsegments[i].hasGuardPages ) {
> > +              needGuardPageCheck = True;
> > +           }
> > +#endif
> >        } else {
> >           return False;
> >        }
> >     }
> >  
> > +#if defined(VKI_MADV_GUARD_INSTALL)
> > +   if (madv && needGuardPageCheck && VG_(is_guarded)(start)) {
> > +      return False;
> > +   }
> > +#endif
> > +
> >     return True;
> >  }
> 
> Pick #if defined(VGO_linux) in both cases.  Do you really need the
> Bool madv? A guarded page is not valid for any kind, except when
> checking for VKI_PROT_NONE (so no read/write/execute) flag set. So I
> think you can use needGuardPageCheck = (prot == VKI_PROT_NONE) here.

I meant needGuardPageCheck = (prot != VKI_PROT_NONE);

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

Reply via email to