Skip to content
Snippets Groups Projects
Commit aa98e2d8 authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Richard Henderson
Browse files

linux-user: Clear translations on mprotect()


Currently it's possible to execute pages that do not have PAGE_EXEC
if there is an existing translation block. Fix by invalidating TBs
that touch the affected pages.

Signed-off-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20220817150506.592862-2-iii@linux.ibm.com>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 872f3d04
No related branches found
No related tags found
No related merge requests found
......@@ -177,9 +177,11 @@ int target_mprotect(abi_ulong start, abi_ulong len, int target_prot)
goto error;
}
}
page_set_flags(start, start + len, page_flags);
mmap_unlock();
return 0;
tb_invalidate_phys_range(start, start + len);
ret = 0;
error:
mmap_unlock();
return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment