aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user-exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/user-exec.c b/user-exec.c
index be6bc4f64c..d8c2ad9f2f 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -97,7 +97,8 @@ static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
pc, address, is_write, *(unsigned long *)old_set);
#endif
/* XXX: locking issue */
- if (is_write && page_unprotect(h2g(address), pc, puc)) {
+ if (is_write && h2g_valid(address)
+ && page_unprotect(h2g(address), pc, puc)) {
return 1;
}