Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d68c9d6ae8f1fdae7d998158adc5ee106a2f8ce6
Commit:     d68c9d6ae8f1fdae7d998158adc5ee106a2f8ce6
Parent:     96358de6bc2ab0bc5e8b44a8f3be4c9bf4a14e4f
Author:     Franck Bui-Huu <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:30:24 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:01 2007 -0700

    Break ELF_PLATFORM and stack pointer randomization dependency
    
    Currently arch_align_stack() is used by fs/binfmt_elf.c to randomize
    stack pointer inside a page. But this happens only if ELF_PLATFORM
    symbol is defined.
    
    ELF_PLATFORM is normally set if the architecture wants ld.so to load
    implementation specific libraries for optimization. And currently a
    lot of architectures just yield this symbol to NULL.
    
    This is the case for MIPS architecture where ELF_PLATFORM is NULL but
    arch_align_stack() has been redefined to do stack inside page
    randomization. So in this case no randomization is actually done.
    
    This patch breaks this dependency which seems to be useless and allows
    platforms such MIPS to do the randomization.
    
    Signed-off-by: Franck Bui-Huu <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Arjan van de Ven <[EMAIL PROTECTED]>
    Cc: Ralf Baechle <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/binfmt_elf.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 0f55b71..6e2f3b8 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -151,6 +151,14 @@ 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
@@ -160,14 +168,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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to