]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - exec.c
Linux user memory access API change (initial patch by Thayne Harbaugh)
[thirdparty/qemu.git] / exec.c
diff --git a/exec.c b/exec.c
index 7987803634f67fb10da2e3d6422a33a7d04c4235..e817a4e5e226c5f12d0e91adb7126fd53dbc4779 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2510,13 +2510,19 @@ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
         if (is_write) {
             if (!(flags & PAGE_WRITE))
                 return;
-            p = lock_user(addr, len, 0);
+            /* XXX: this code should not depend on lock_user */
+            if (!(p = lock_user(VERIFY_WRITE, addr, len, 0)))
+                /* FIXME - should this return an error rather than just fail? */
+                return;
             memcpy(p, buf, len);
             unlock_user(p, addr, len);
         } else {
             if (!(flags & PAGE_READ))
                 return;
-            p = lock_user(addr, len, 1);
+            /* XXX: this code should not depend on lock_user */
+            if (!(p = lock_user(VERIFY_READ, addr, len, 1)))
+                /* FIXME - should this return an error rather than just fail? */
+                return;
             memcpy(buf, p, len);
             unlock_user(p, addr, 0);
         }