SOURCES (LINUX_2_6): linux-2.6-binfmt_elf-bss-padding.patch (NEW), ...
pluto
pluto at pld-linux.org
Tue Oct 11 16:19:03 CEST 2005
Author: pluto Date: Tue Oct 11 14:19:03 2005 GMT
Module: SOURCES Tag: LINUX_2_6
---- Log message:
- .bss elf fix separated and optimized.
---- Files affected:
SOURCES:
linux-2.6-binfmt_elf-bss-padding.patch (NONE -> 1.1) (NEW), kernel-hotfixes.patch (1.1.2.63 -> 1.1.2.64)
---- Diffs:
================================================================
Index: SOURCES/linux-2.6-binfmt_elf-bss-padding.patch
diff -u /dev/null SOURCES/linux-2.6-binfmt_elf-bss-padding.patch:1.1
--- /dev/null Tue Oct 11 16:19:03 2005
+++ SOURCES/linux-2.6-binfmt_elf-bss-padding.patch Tue Oct 11 16:18:58 2005
@@ -0,0 +1,21 @@
+Nir Tzachar <tzachar at cs.bgu.ac.il> points out that if an ELF file specifies
+a zero-length bss at a whacky address, we cannot load that binary because
+padzero() tries to zero out the end of the page at the whacky address,
+and that may not be writeable.
+
+So teach load_elf_binary() to skip the bss settng altogether if the elf file
+has a zero-length bss segment.
+
+Signed-off-by: Andrew Morton <akpm at osdl.org>
+
+--- 25/fs/binfmt_elf.c~binfmt_elf-bss-padding-fix 2005-05-11 21:15:02.000000000 -0700
++++ 25-akpm/fs/binfmt_elf.c 2005-05-11 21:15:02.000000000 -0700
+@@ -905,7 +905,7 @@ static int load_elf_binary(struct linux_
+ send_sig(SIGKILL, current, 0);
+ goto out_free_dentry;
+ }
+- if (padzero(elf_bss)) {
++ if (likely(elf_bss != elf_brk) && unlikely(padzero(elf_bss))) {
+ send_sig(SIGSEGV, current, 0);
+ retval = -EFAULT; /* Nobody gets to see this, but.. */
+ goto out_free_dentry;
================================================================
Index: SOURCES/kernel-hotfixes.patch
diff -u SOURCES/kernel-hotfixes.patch:1.1.2.63 SOURCES/kernel-hotfixes.patch:1.1.2.64
--- SOURCES/kernel-hotfixes.patch:1.1.2.63 Fri Oct 7 15:05:37 2005
+++ SOURCES/kernel-hotfixes.patch Tue Oct 11 16:18:58 2005
@@ -153,14 +153,3 @@
/* Point socket buffer at the right VCC before giving to socket layer */
ATM_SKB(skb)->vcc = vcc;
---- a/fs/binfmt_elf.c 2005-09-30 23:17:35.000000000 +0200
-+++ b/fs/binfmt_elf.c 2005-10-07 11:46:27.159874250 +0200
-@@ -905,7 +905,7 @@ static int load_elf_binary(struct linux_
- send_sig(SIGKILL, current, 0);
- goto out_free_dentry;
- }
-- if (padzero(elf_bss)) {
-+ if ((elf_bss != elf_brk) && padzero(elf_bss)) {
- send_sig(SIGSEGV, current, 0);
- retval = -EFAULT; /* Nobody gets to see this, but.. */
- goto out_free_dentry;
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/kernel-hotfixes.patch?r1=1.1.2.63&r2=1.1.2.64&f=u
More information about the pld-cvs-commit
mailing list