Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e384f41409cb9e543fbc84b375e2ba46cbcbec6a
Commit:     e384f41409cb9e543fbc84b375e2ba46cbcbec6a
Parent:     ee211b37aa98123b1d9b19d228011e632a4bbe75
Author:     Ian Wienand <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 20 14:12:46 2007 +1100
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Wed Dec 19 11:06:40 2007 -0800

    [IA64] set_thread_area fails in IA32 chroot
    
    I tried to upgrade an IA32 chroot on my IA64 to a new glibc with TLS.
    It kept dying because set_thread_area was returning -ESRCH
    (bugs.debian.org/451939).
    
    I instrumented arch/ia64/ia32/sys_ia32.c:get_free_idx() and ended up
    seeing output like
    
    [pid] idx   desc->a  desc->b
    -----------------------------
    [2710] 0 -> c6b0ffff 40dff31b
    [2710] 1 -> 0 0
    [2710] 2 -> 0 0
    
    [2710] 0 -> c6b0ffff 40dff31b
    [2710] 1 -> c6b0ffff 40dff31b
    [2710] 2 -> 0 0
    
    [2711] 0 -> c6b0ffff 40dff31b
    [2711] 1 -> c6b0ffff 40dff31b
    [2711] 2 -> 48c0ffff 40dff317
    
    which suggested to me that TLS pointers were surviving exec() calls,
    leading to GDT pointers filling up and the eventual failure of
    get_free_idx().
    
    I think the solution is flushing the tls array on exec.
    
    Signed-Off-By: Ian Wienand <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/process.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index a70ad18..7377d32 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -739,6 +739,7 @@ flush_thread (void)
                ia32_drop_ia64_partial_page_list(current);
                current->thread.task_size = IA32_PAGE_OFFSET;
                set_fs(USER_DS);
+               memset(current->thread.tls_array, 0, 
sizeof(current->thread.tls_array));
        }
 #endif
 }
-
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