qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] linux-user mremap()
@ 2008-09-26 18:24 Vince Weaver
  2008-09-27  5:17 ` Kirill A. Shutemov
  0 siblings, 1 reply; 3+ messages in thread
From: Vince Weaver @ 2008-09-26 18:24 UTC (permalink / raw)
  To: qemu-devel


Until the linux-user mremap() problem is fixed (the one where a 64-bit 
value can be returned even on a 32-bit target), might it make sense to 
apply a patch like this?

This will at least let users know what the problem is, instead of just 
segfaulting.

Vince




Index: mmap.c
===================================================================
--- mmap.c	(revision 5321)
+++ mmap.c	(working copy)
@@ -538,6 +538,13 @@
      mmap_lock();
      /* XXX: use 5 args syscall */
      host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+#if TARGET_ABI_BITS == 32
+    if (host_addr > 0xffffffff) {
+       printf("ERROR!  mremap() returned 64-bit value on 32-bit target!\n\n");
+       exit(-1); 
+    }
+#endif 
+
      if (host_addr == -1) {
          new_addr = -1;
      } else {

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-27 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-26 18:24 [Qemu-devel] linux-user mremap() Vince Weaver
2008-09-27  5:17 ` Kirill A. Shutemov
2008-09-27 17:01   ` Vince Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).