All of lore.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: nigel@mips.com, linux-mips <linux-mips@linux-mips.org>
Subject: Re: Useless stack randomization patch
Date: Wed, 26 Sep 2007 17:20:10 +0200	[thread overview]
Message-ID: <46FA78AA.9050104@gmail.com> (raw)
In-Reply-To: <20070926150433.GA28017@linux-mips.org>

Ralf Baechle wrote:
> On Wed, Sep 26, 2007 at 04:10:14PM +0200, Franck Bui-Huu wrote:
> I suppose we should give it a sane definition.  Not sure what would be
> useful, if it should be like an ASCII string with the processor type or
> more corse grained like just "mips32r2", should ASEs be mentioned ...
> 

Well before giving any sane definition, shouldn't we know why this
dependency (ELF_PLATFORM/sp-randomization) exists at all...

Is something like the patch below better ?

		Franck

-- 8< --


diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 43143c5..e8713fb 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -150,6 +150,13 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
 	struct vm_area_struct *vma;
 
 	/*
+	 * In some cases (e.g. Hyper-Threading), we want to avoid L1
+	 * evictions by the processes running on the same package. One
+	 * thing we can do is to shuffle the initial stack for them.
+	 */
+	p = arch_align_stack(p);
+
+	/*
 	 * If this architecture has a platform capability string, copy it
 	 * to userspace.  In some cases (Sparc), this info is impossible
 	 * for userspace to get any other way, in others (i386) it is
@@ -159,14 +166,6 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
 	if (k_platform) {
 		size_t len = strlen(k_platform) + 1;
 
-		/*
-		 * In some cases (e.g. Hyper-Threading), we want to avoid L1
-		 * evictions by the processes running on the same package. One
-		 * thing we can do is to shuffle the initial stack for them.
-		 */
-
-		p = arch_align_stack(p);
-
 		u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len);
 		if (__copy_to_user(u_platform, k_platform, len))
 			return -EFAULT;

  reply	other threads:[~2007-09-26 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-26 14:10 Useless stack randomization patch Franck Bui-Huu
2007-09-26 14:22 ` Markus Gothe
2007-09-26 14:27   ` Franck Bui-Huu
2007-09-26 15:04 ` Ralf Baechle
2007-09-26 15:20   ` Franck Bui-Huu [this message]
2007-09-27 14:57     ` Ralf Baechle

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=46FA78AA.9050104@gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=nigel@mips.com \
    --cc=ralf@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.