From f37465fd7f768a72628506956473ae69112cf774 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 16 Mar 2013 02:37:07 +0100 Subject: sysexec: fix possible segment overlap with temporary stack the kernel uses fixed area (TSTKTOP, TSTKSIZ) of the address space to temporarily map the new stack segment for exec. for 386 and arm, this area was right below the stack segment which has the problem that the program can map arbitrary segments there (even readonly). alpha and ppc dont have this problem as they map the temporary exec stack *above* the user reachable stack segement and segattach prevents one from mapping anything above or overlaping the stack. lots of arch code assumes USTKTOP being the end of userspace address space and changing this to TSTKTOP would work, but results in lots of hard to test changes. instead, we'r going to map the temporary stack programmatically finding a hole in the address space where to map it. we also lift the size limitation for arguments and allow arguments to fill the whole new stack segement. the TSTKTOP and TSTKSIZ are not used anymore so they where removed. references: http://9fans.net/archive/2013/03/203 http://9fans.net/archive/2013/03/202 http://9fans.net/archive/2013/03/197 http://9fans.net/archive/2013/03/195 http://9fans.net/archive/2013/03/181 --- sys/src/9/kw/mem.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'sys/src/9/kw') diff --git a/sys/src/9/kw/mem.h b/sys/src/9/kw/mem.h index b35e4dba7..3cc93a381 100644 --- a/sys/src/9/kw/mem.h +++ b/sys/src/9/kw/mem.h @@ -71,8 +71,6 @@ #define UTZERO (UZERO+BY2PG) /* user text start */ #define USTKTOP KZERO /* user segment end +1 */ #define USTKSIZE (8*1024*1024) /* user stack size */ -#define TSTKTOP (USTKTOP-USTKSIZE) /* sysexec temporary stack */ -#define TSTKSIZ 256 /* address at which to copy and execute rebootcode */ #define REBOOTADDR KADDR(0x100) -- cgit v1.2.3