From: Frank van Maarseveen <frankvm@frankvm.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86: Don't randomize stack unless current->personality permits it
Date: Tue, 11 Jul 2006 17:22:02 +0200 [thread overview]
Message-ID: <20060711152202.GA18149@janus> (raw)
Do not randomize stack location unless current->personality permits it.
Signed-off-by: Frank van Maarseveen <frankvm@frankvm.com>
---
The problem seems also present in
arch/um/kernel/process_kern.c
arch/x86_64/kernel/process.c
arch/i386/kernel/process.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
diff -rup a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
--- a/arch/i386/kernel/process.c 2006-06-23 16:08:13.000000000 +0200
+++ b/arch/i386/kernel/process.c 2006-07-11 14:39:20.000000000 +0200
@@ -38,6 +38,7 @@
#include <linux/kallsyms.h>
#include <linux/ptrace.h>
#include <linux/random.h>
+#include <linux/personality.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -898,7 +899,7 @@ asmlinkage int sys_get_thread_area(struc
unsigned long arch_align_stack(unsigned long sp)
{
- if (randomize_va_space)
+ if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
sp -= get_random_int() % 8192;
return sp & ~0xf;
}
next reply other threads:[~2006-07-11 15:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-11 15:22 Frank van Maarseveen [this message]
2006-07-11 20:11 ` [PATCH] x86: Don't randomize stack unless current->personality permits it Arjan van de Ven
2006-07-11 19:57 Al Boldi
2006-07-12 16:03 ` Andi Kleen
2006-07-12 20:12 ` Al Boldi
2006-07-12 20:27 ` Arjan van de Ven
2006-07-12 21:13 ` Al Boldi
2006-07-13 9:44 ` Frank van Maarseveen
2006-07-13 20:51 ` Al Boldi
2006-07-13 20:54 ` Arjan van de Ven
2006-07-15 11:29 ` Al Boldi
2006-07-15 12:22 ` Arjan van de Ven
2006-07-15 14:09 ` Al Boldi
2006-07-15 16:15 ` Arjan van de Ven
2006-07-15 17:39 ` Al Boldi
2006-07-17 15:50 ` Paulo Marques
2006-07-18 5:21 ` Al Boldi
2006-07-16 3:58 Chuck Ebbert
2006-07-16 19:49 ` Al Boldi
2006-07-19 17:02 Chuck Ebbert
2006-07-20 17:23 ` Al Boldi
2006-07-24 15:57 ` Al Boldi
2006-07-25 0:21 Chuck Ebbert
2006-07-25 4:57 ` Al Boldi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060711152202.GA18149@janus \
--to=frankvm@frankvm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).