lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Fri, 22 Jan 2010 13:57:58 +0000
From:	Will Newton <will.newton@...il.com>
To:	Linux Kernel list <linux-kernel@...r.kernel.org>,
	linux-parisc@...r.kernel.org
Subject: [PATCH] exec: Use a define for maximum process stack size in 
	STACK_GROWSUP case.

Create a new define for the maximum allowed process stack size for
STACK_GROWSUP architectures. This allows the value to be overridden in
architecture specific code where necessary.

Signed-off-by: Will Newton <will.newton@...il.com>
---

The only in-tree architecture this affects is parisc. I don't have a
parisc box here to test with, but I have tested this change on an
out-of-tree Linux port with STACK_GROWSUP set.

 fs/exec.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 632b02e..d37a626 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -573,10 +573,13 @@ int setup_arg_pages(struct linux_binprm *bprm,
 	unsigned long stack_base;

 #ifdef CONFIG_STACK_GROWSUP
-	/* Limit stack size to 1GB */
+	/* Limit stack size to 1GB by default. */
+#ifndef STACK_MAX_SIZE
+#define STACK_MAX_SIZE (1 << 30)
+#endif
 	stack_base = current->signal->rlim[RLIMIT_STACK].rlim_max;
-	if (stack_base > (1 << 30))
-		stack_base = 1 << 30;
+	if (stack_base > STACK_MAX_SIZE)
+		stack_base = STACK_MAX_SIZE;

 	/* Make sure we didn't let the argument array grow too large. */
 	if (vma->vm_end - vma->vm_start > stack_base)
-- 
1.5.5.2

Download attachment "0001-exec-Use-a-define-for-maximum-process-stack-size-in.patch" of type "application/octet-stream" (1239 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ