There is some extra memory for exec-shield users to account for the address space gap that they can't use. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- um-linux-2.4.27-paolo/arch/um/kernel/um_arch.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) diff -puN arch/um/kernel/um_arch.c~exec-shield arch/um/kernel/um_arch.c --- um-linux-2.4.27/arch/um/kernel/um_arch.c~exec-shield 2005-04-15 11:12:57.000000000 +0200 +++ um-linux-2.4.27-paolo/arch/um/kernel/um_arch.c 2005-04-15 11:12:57.000000000 +0200 @@ -303,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; @@ -321,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; _