summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdike <jdike>2004-04-07 20:46:30 +0000
committerjdike <jdike>2004-04-07 20:46:30 +0000
commit79607fab52b970bb598191cac9661c55ccfada37 (patch)
tree98b2af136655b26f24bdae278f0298f4af8c20cf
parentf5e1a8d5d376fc002d52a239bbdaf9d9fef5b774 (diff)
downloaduml-history-79607fab52b970bb598191cac9661c55ccfada37.tar.gz
Added some extra memory for exec-shield users.
panic now causes UML to exit with status 1.
-rw-r--r--arch/um/kernel/um_arch.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index 48f353c..af7b8e7 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -27,7 +27,6 @@
#include "user_util.h"
#include "kern_util.h"
#include "kern.h"
-#include "mprot.h"
#include "mem_user.h"
#include "mem.h"
#include "umid.h"
@@ -304,7 +303,7 @@ unsigned long end_iomem;
int linux_main(int argc, char **argv)
{
- unsigned long avail;
+ unsigned long avail, diff;
unsigned long virtmem_size, max_physmem;
unsigned int i, add;
@@ -322,6 +321,16 @@ int linux_main(int argc, char **argv)
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 */
+
+ diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
+ if(diff > 1024 * 1024){
+ printf("Adding %ld bytes to physical memory to account for "
+ "exec-shield gap\n", diff);
+ physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
+ }
uml_physmem = uml_start;
@@ -387,12 +396,15 @@ int linux_main(int argc, char **argv)
return(CHOOSE_MODE(start_uml_tt(), start_uml_skas()));
}
+extern int uml_exitcode;
+
static int panic_exit(struct notifier_block *self, unsigned long unused1,
void *unused2)
{
#ifdef CONFIG_SYSRQ
handle_sysrq('p', &current->thread.regs, NULL, NULL);
#endif
+ uml_exitcode = 1;
machine_halt();
return(0);
}