A simple '&' is not sufficiant. With mmapping_flags == PROT_READ and prot == PROT_READ|PROT_WRITE the check produces the wrong result. Change the check to make sure that prot is a subset of mmapping_flags. https://bugzilla.gnome.org/show_bug.cgi?id=730559