linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] Patch for UML running on exec-shield hosts
@ 2004-02-01 12:54 M A Young
  2004-02-01 20:09 ` Jeff Dike
  0 siblings, 1 reply; 2+ messages in thread
From: M A Young @ 2004-02-01 12:54 UTC (permalink / raw)
  To: user-mode-linux-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 347 bytes --]

Here is a revised version of my patch to address the UML crash when you
try to run it on a host kernel with exec-shield enabled, such as on fedora
core 1. The change is that it increases the value of the physmem_size for
exec-shield users, so they actually get the memory they asked for (and
adds zero in the non-exec shield case).

	Michael Young

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1835 bytes --]

diff -Naur linux-2.4.22/arch/um/kernel/tt/mem.c.orig linux-2.4.22/arch/um/kernel/tt/mem.c
--- linux-2.4.22/arch/um/kernel/tt/mem.c.orig	2003-11-11 21:52:30.000000000 +0000
+++ linux-2.4.22/arch/um/kernel/tt/mem.c	2003-11-12 20:06:37.000000000 +0000
@@ -18,7 +18,7 @@
 	if(!jail || debug)
 		remap_data(UML_ROUND_DOWN(&_stext), UML_ROUND_UP(&_etext), 1);
 	remap_data(UML_ROUND_DOWN(&_sdata), UML_ROUND_UP(&_edata), 1);
-	remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(brk_start), 1);
+	remap_data(UML_ROUND_DOWN(&__bss_start), UML_ROUND_UP(&_end), 1);
 }
 
 #ifdef CONFIG_HOST_2G_2G
diff -Naur linux-2.4.22/arch/um/kernel/tt/process_kern.c.orig linux-2.4.22/arch/um/kernel/tt/process_kern.c
--- linux-2.4.22/arch/um/kernel/tt/process_kern.c.orig	2003-11-11 21:52:30.000000000 +0000
+++ linux-2.4.22/arch/um/kernel/tt/process_kern.c	2003-11-12 20:07:46.000000000 +0000
@@ -405,7 +405,7 @@
 	protect_memory(start, end - start, 1, w, 1, 1);
 
 	start = (unsigned long) UML_ROUND_DOWN(&__bss_start);
-	end = (unsigned long) UML_ROUND_UP(brk_start);
+	end = (unsigned long) UML_ROUND_UP(&_end);
 	protect_memory(start, end - start, 1, w, 1, 1);
 
 	mprotect_kernel_vm(w);
diff -Naur linux-2.6.1/arch/um/kernel/um_arch.c.orig linux-2.6.1/arch/um/kernel/um_arch.c
--- linux-2.6.1/arch/um/kernel/um_arch.c.orig	2004-02-01 12:39:59.000000000 +0000
+++ linux-2.6.1/arch/um/kernel/um_arch.c	2004-02-01 12:41:53.000000000 +0000
@@ -324,6 +324,10 @@
 
 	brk_start = (unsigned long) sbrk(0);
 	CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start);
+	/* Increase physical memory size for exec-shield users
+	so they actually get what they asked for. This should
+	add zero for non-exec shield users */
+	physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
 
 	uml_physmem = uml_start;
 

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

* Re: [uml-devel] Patch for UML running on exec-shield hosts
  2004-02-01 12:54 [uml-devel] Patch for UML running on exec-shield hosts M A Young
@ 2004-02-01 20:09 ` Jeff Dike
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2004-02-01 20:09 UTC (permalink / raw)
  To: M A Young; +Cc: user-mode-linux-devel

On Sun, Feb 01, 2004 at 12:54:41PM +0000, M A Young wrote:
> Here is a revised version of my patch to address the UML crash when you
> try to run it on a host kernel with exec-shield enabled, such as on fedora
> core 1. 

Applied, thanks.

> The change is that it increases the value of the physmem_size for
> exec-shield users, so they actually get the memory they asked for (and
> adds zero in the non-exec shield case).

I'm not so sure about this part.  I need to think about it.

				Jeff


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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] 2+ messages in thread

end of thread, other threads:[~2004-02-01 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-01 12:54 [uml-devel] Patch for UML running on exec-shield hosts M A Young
2004-02-01 20:09 ` Jeff Dike

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