linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] [PATCH] fix writing into /dev/kmem
@ 2004-02-29  2:36 Jeff Dike
  2004-02-29 12:25 ` BlaisorBlade
  2004-02-29 16:20 ` BlaisorBlade
  0 siblings, 2 replies; 9+ messages in thread
From: Jeff Dike @ 2004-02-29  2:36 UTC (permalink / raw)
  To: user-mode-linux-devel

The patch below fixes a bug in the /dev/kmem driver which causes UML to
die if you write to it.  Of course, the kernel will die if you write random
crap to kernel memory, but at least it doesn't die in a UML-specific way.

This is a cut'n'paste from an xterm, so apply with patch -l.

				Jeff

--- drivers/char/mem.c~ 2004-01-05 11:23:32.000000000 -0500
+++ drivers/char/mem.c  2004-02-27 08:52:14.000000000 -0500
@@ -287,6 +287,7 @@
        ssize_t virtr = 0;
        char * kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
 
+       p = (unsigned long) __va(p);
        if (p < (unsigned long) high_memory) {
                wrote = count;
                if (count > (unsigned long) high_memory - p)
@@ -321,7 +322,7 @@
                free_page((unsigned long)kbuf);
        }
 
-       *ppos = p;
+       *ppos = __pa((void *) p);
        return virtr + wrote;
 }


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

end of thread, other threads:[~2004-03-09 19:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-29  2:36 [uml-devel] [PATCH] fix writing into /dev/kmem Jeff Dike
2004-02-29 12:25 ` BlaisorBlade
2004-03-02  1:31   ` Jeff Dike
2004-03-02 18:41     ` BlaisorBlade
2004-03-04  2:02       ` Jeff Dike
2004-03-08 11:50         ` BlaisorBlade
2004-02-29 16:20 ` BlaisorBlade
2004-03-02  1:11   ` Jeff Dike
2004-03-02  1:31   ` Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox