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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 May 2011 16:24:17 -0700
From:	Andi Kleen <andi@...stfloor.org>
To:	linux-kernel@...r.kernel.org
Cc:	libc-alpha@...rceware.org, Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 3/5] EXEC: Use define for stack to argument size limit

From: Andi Kleen <ak@...ux.intel.com>

Change the hardcoded 4 constant for the argument size limit in exec
to a exported constant.

Needed for followon patch.

Open: better place for the constant?

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 fs/exec.c          |    2 +-
 include/linux/fs.h |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 5e62d26..1707832 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -225,7 +225,7 @@ struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
 		 *    to work from.
 		 */
 		rlim = current->signal->rlim;
-		if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur) / 4) {
+		if (size > ACCESS_ONCE(rlim[RLIMIT_STACK].rlim_cur) / ARG_MAX_FACTOR) {
 			put_page(page);
 			return NULL;
 		}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index dbd860a..fcd84a6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -33,6 +33,8 @@
 #define SEEK_END	2	/* seek relative to end of file */
 #define SEEK_MAX	SEEK_END
 
+#define ARG_MAX_FACTOR	4
+
 struct fstrim_range {
 	__u64 start;
 	__u64 len;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ