diff --git a/elks/arch/i86/kernel/process.c b/elks/arch/i86/kernel/process.c index a3695dd7c..d50a2c9bc 100644 --- a/elks/arch/i86/kernel/process.c +++ b/elks/arch/i86/kernel/process.c @@ -50,13 +50,6 @@ void stack_check(void) { segoff_t end = current->t_endbrk; -#ifdef CONFIG_EXEC_LOW_STACK - if (current->t_begstack <= current->t_enddata) { /* stack below heap?*/ - if (current->t_regs.sp < end) - return; - end = 0; - } else -#endif { /* optional: check stack over min stack*/ if (current->t_regs.sp < current->t_begstack - current->t_minstack) { diff --git a/elks/arch/i86/mm/malloc.c b/elks/arch/i86/mm/malloc.c index 06aae746d..d8fea63ae 100644 --- a/elks/arch/i86/mm/malloc.c +++ b/elks/arch/i86/mm/malloc.c @@ -249,10 +249,6 @@ int sys_brk(segoff_t newbrk) return -ENOMEM; } } -#ifdef CONFIG_EXEC_LOW_STACK - if (newbrk > current->t_endseg) - return -ENOMEM; -#endif current->t_endbrk = newbrk; return 0; diff --git a/elks/fs/exec.c b/elks/fs/exec.c index 68d1f4429..af102060e 100644 --- a/elks/fs/exec.c +++ b/elks/fs/exec.c @@ -266,18 +266,8 @@ static int execve_aout(struct inode *inode, struct file *filp, char *sptr, size_ if (esuph.msh_tbase != 0) goto error_exec3; base_data = esuph.msh_dbase; -#ifdef CONFIG_EXEC_LOW_STACK - if (base_data & 0xf) - goto error_exec3; if (base_data != 0) - debug("EXEC: New type executable stack = %x\n", base_data); - - if (add_overflow(min_len, base_data, &min_len)) /* adds stack size*/ goto error_exec3; -#else - if (base_data != 0) - goto error_exec3; -#endif break; #endif /* CONFIG_EXEC_MMODEL*/ default: @@ -293,9 +283,6 @@ static int execve_aout(struct inode *inode, struct file *filp, char *sptr, size_ goto error_exec3; case 1: len = min_len; -#ifdef CONFIG_EXEC_LOW_STACK - if (!base_data) -#endif { stack = mh.minstack? mh.minstack: INIT_STACK; if (add_overflow(len, stack, &len)) { /* add stack */ @@ -335,14 +322,6 @@ static int execve_aout(struct inode *inode, struct file *filp, char *sptr, size_ } else { stack = INIT_STACK; len = min_len; -#ifdef CONFIG_EXEC_LOW_STACK - if (base_data) { - if (add_overflow(len, INIT_HEAP, &len)) { - retval = -EFBIG; - goto error_exec3; - } - } else -#endif { if (add_overflow(len, INIT_HEAP + INIT_STACK, &len)) { retval = -EFBIG; @@ -495,14 +474,7 @@ static int execve_aout(struct inode *inode, struct file *filp, char *sptr, size_ currentp->t_enddata = (size_t)mh.dseg + (size_t)mh.bseg + base_data; currentp->t_endseg = len; currentp->t_regs.dx = currentp->t_minstack = stack; - -#ifdef CONFIG_EXEC_LOW_STACK - currentp->t_begstack = ((base_data /* Just above the top of stack */ - ? base_data - : currentp->t_endseg) - slen) & ~1; -#else currentp->t_begstack = (currentp->t_endseg - slen) & ~1; /* force even SP and argv */ -#endif fmemcpyb((char *)currentp->t_begstack, seg_data->base, sptr, ds, slen); finalize_exec(inode, seg_code, seg_data, (word_t)mh.entry, 0);