mprotect: Fix early exit condition on page table attribute

This commit is contained in:
Tomoki Shirasawa
2018-06-05 19:44:44 +09:00
committed by Balazs Gerofi
parent 328609269b
commit 5f4dbb2c71

View File

@ -1445,7 +1445,7 @@ int change_prot_process_memory_range(struct process_vm *vm,
*/
if (range->memobj && (range->flag & VR_PRIVATE)) {
setattr &= ~PTATTR_WRITABLE;
if (clrattr == setattr == 0) {
if (!clrattr && !setattr) {
range->flag = newflag;
error = 0;
goto out;