rpms/kernel/devel linux-2.6-devmem.patch, 1.11, 1.12 linux-2.6-execshield.patch, 1.41, 1.42 linux-2.6-proc-self-maps-fix.patch, 1.7, 1.8 linux-2.6-squashfs.patch, 1.12, 1.13
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Thu Nov 23 22:00:38 UTC 2006
Author: dwmw2
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv10299
Modified Files:
linux-2.6-devmem.patch linux-2.6-execshield.patch
linux-2.6-proc-self-maps-fix.patch linux-2.6-squashfs.patch
Log Message:
rediffed patches from Arnd (#217077)
linux-2.6-devmem.patch:
arch/i386/mm/init.c | 19 +++++
arch/ia64/mm/init.c | 7 ++
arch/powerpc/mm/mem.c | 14 ++++
arch/s390/mm/init.c | 5 +
arch/x86_64/mm/init.c | 42 ++++++++++++
drivers/char/mem.c | 144 ++++++-------------------------------------
fs/proc/kcore.c | 2
include/asm-alpha/page.h | 2
include/asm-arm/page.h | 2
include/asm-arm26/page.h | 2
include/asm-cris/page.h | 2
include/asm-h8300/page.h | 2
include/asm-i386/page.h | 2
include/asm-ia64/page.h | 1
include/asm-m68k/page.h | 2
include/asm-m68knommu/page.h | 2
include/asm-mips/page.h | 2
include/asm-parisc/page.h | 2
include/asm-powerpc/page.h | 2
include/asm-ppc/page.h | 2
include/asm-s390/page.h | 2
include/asm-sh/page.h | 2
include/asm-sh64/page.h | 2
include/asm-sparc/page.h | 2
include/asm-sparc64/page.h | 2
include/asm-um/page.h | 1
include/asm-v850/page.h | 2
include/asm-x86_64/page.h | 4 +
28 files changed, 152 insertions(+), 123 deletions(-)
Index: linux-2.6-devmem.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-devmem.patch,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- linux-2.6-devmem.patch 15 Oct 2006 00:32:32 -0000 1.11
+++ linux-2.6-devmem.patch 23 Nov 2006 22:00:34 -0000 1.12
@@ -1,7 +1,8 @@
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/arch/i386/mm/init.c linux-1050/arch/i386/mm/init.c
---- linux-1020/arch/i386/mm/init.c
-+++ linux-1050/arch/i386/mm/init.c
-@@ -229,6 +229,25 @@ static inline int page_is_ram(unsigned l
+Index: linux-2.6/arch/i386/mm/init.c
+===================================================================
+--- linux-2.6.orig/arch/i386/mm/init.c
++++ linux-2.6/arch/i386/mm/init.c
+@@ -233,6 +233,25 @@ int page_is_ram(unsigned long pagenr)
return 0;
}
@@ -27,10 +28,11 @@
#ifdef CONFIG_HIGHMEM
pte_t *kmap_pte;
pgprot_t kmap_prot;
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/arch/ia64/mm/init.c linux-1050/arch/ia64/mm/init.c
---- linux-1020/arch/ia64/mm/init.c
-+++ linux-1050/arch/ia64/mm/init.c
-@@ -230,6 +230,13 @@ free_initrd_mem (unsigned long start, un
+Index: linux-2.6/arch/ia64/mm/init.c
+===================================================================
+--- linux-2.6.orig/arch/ia64/mm/init.c
++++ linux-2.6/arch/ia64/mm/init.c
+@@ -263,6 +263,13 @@ free_initrd_mem (unsigned long start, un
}
}
@@ -44,10 +46,11 @@
/*
* This installs a clean page in the kernel's page table.
*/
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/arch/ppc64/mm/init.c linux-1050/arch/ppc64/mm/init.c
---- linux-1020/arch/powerpc/mm/mem.c
-+++ linux-1050/arch/powerpc/mm/mem.c
-@@ -46,6 +46,7 @@
+Index: linux-2.6/arch/powerpc/mm/mem.c
+===================================================================
+--- linux-2.6.orig/arch/powerpc/mm/mem.c
++++ linux-2.6/arch/powerpc/mm/mem.c
+@@ -45,6 +45,7 @@
#include <asm/prom.h>
#include <asm/lmb.h>
#include <asm/sections.h>
@@ -55,7 +58,7 @@
#include <asm/vdso.h>
#include "mmu_decl.h"
-@@ -352,6 +352,19 @@ void __init mem_init(void)
+@@ -343,6 +344,19 @@ void __init mem_init(void)
max_mapnr = max_pfn;
totalram_pages += free_all_bootmem();
#endif
@@ -75,12 +78,13 @@
for_each_online_pgdat(pgdat) {
for (i = 0; i < pgdat->node_spanned_pages; i++) {
if (!pfn_valid(pgdat->node_start_pfn + i))
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/arch/s390/mm/init.c linux-1050/arch/s390/mm/init.c
---- linux-1020/arch/s390/mm/init.c
-+++ linux-1050/arch/s390/mm/init.c
-@@ -253,6 +253,11 @@ void __init paging_init(void)
+Index: linux-2.6/arch/s390/mm/init.c
+===================================================================
+--- linux-2.6.orig/arch/s390/mm/init.c
++++ linux-2.6/arch/s390/mm/init.c
+@@ -241,6 +241,11 @@ void __init paging_init(void)
}
- #endif /* CONFIG_ARCH_S390X */
+ #endif /* CONFIG_64BIT */
+int page_is_ram (unsigned long pagenr)
+{
@@ -90,12 +94,42 @@
void __init mem_init(void)
{
unsigned long codesize, reservedpages, datasize, initsize;
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/arch/x86_64/mm/init.c linux-1050/arch/x86_64/mm/init.c
---- linux-1020/arch/x86_64/mm/init.c
-+++ linux-1050/arch/x86_64/mm/init.c
-@@ -397,6 +397,26 @@ static inline int page_is_ram (unsigned
+Index: linux-2.6/arch/x86_64/mm/init.c
+===================================================================
+--- linux-2.6.orig/arch/x86_64/mm/init.c
++++ linux-2.6/arch/x86_64/mm/init.c
+@@ -452,6 +452,28 @@ void __init clear_kernel_mapping(unsigne
+ __flush_tlb_all();
+ }
- extern int swiotlb_force;
++static inline int page_is_ram (unsigned long pagenr)
++{
++ int i;
++
++ for (i = 0; i < e820.nr_map; i++) {
++ unsigned long addr, end;
++
++ if (e820.map[i].type != E820_RAM) /* not usable memory */
++ continue;
++ /*
++ * !!!FIXME!!! Some BIOSen report areas as RAM that
++ * are not. Notably the 640->1Mb area. We need a sanity
++ * check here.
++ */
++ addr = (e820.map[i].addr+PAGE_SIZE-1) >> PAGE_SHIFT;
++ end = (e820.map[i].addr+e820.map[i].size) >> PAGE_SHIFT;
++ if ((pagenr >= addr) && (pagenr < end))
++ return 1;
++ }
++ return 0;
++}
++
+ /*
+ * Memory hotplug specific functions
+ */
+@@ -534,6 +556,26 @@ int __add_pages(struct zone *z, unsigned
+ }
+ #endif
+/*
+ * devmem_is_allowed() checks to see if /dev/mem access to a certain address is
@@ -120,10 +154,11 @@
static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules,
kcore_vsyscall;
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/drivers/char/mem.c linux-1050/drivers/char/mem.c
---- linux-1020/drivers/char/mem.c
-+++ linux-1050/drivers/char/mem.c
-@@ -111,6 +111,22 @@ static inline int valid_phys_addr_range(
+Index: linux-2.6/drivers/char/mem.c
+===================================================================
+--- linux-2.6.orig/drivers/char/mem.c
++++ linux-2.6/drivers/char/mem.c
+@@ -102,6 +102,22 @@ static inline int valid_mmap_phys_addr_r
}
#endif
@@ -146,7 +181,7 @@
/*
* This funcion reads the *physical* memory. The f_pos points directly to the
* memory location.
-@@ -160,6 +176,8 @@ static ssize_t read_mem(struct file * fi
+@@ -151,6 +167,8 @@ static ssize_t read_mem(struct file * fi
*/
ptr = xlate_dev_mem_ptr(p);
@@ -155,7 +190,7 @@
if (copy_to_user(buf, ptr, sz))
return -EFAULT;
buf += sz;
-@@ -217,6 +235,8 @@ static ssize_t write_mem(struct file * f
+@@ -208,6 +226,8 @@ static ssize_t write_mem(struct file * f
*/
ptr = xlate_dev_mem_ptr(p);
@@ -163,20 +198,21 @@
+ return -EPERM;
copied = copy_from_user(ptr, buf, sz);
if (copied) {
- ssize_t ret;
-@@ -270,6 +290,8 @@ static ssize_t read_kmem(struct file *fi
- ssize_t read, virtr, sz;
+ written += sz - copied;
+@@ -357,6 +377,8 @@ static ssize_t read_kmem(struct file *fi
+ ssize_t low_count, read, sz;
char * kbuf; /* k-addr because vread() takes vmlist_lock rwlock */
+ return -EPERM;
+
read = 0;
- virtr = 0;
if (p < (unsigned long) high_memory) {
-@@ -432,67 +432,6 @@ static ssize_t read_kmem(struct file *fi
+ low_count = count;
+@@ -432,126 +454,6 @@ static ssize_t read_kmem(struct file *fi
+ return read;
}
-
+-
-static inline ssize_t
-do_write_kmem(void *p, unsigned long realp, const char __user * buf,
- size_t count, loff_t *ppos)
@@ -238,16 +274,6 @@
-}
-
-
- /*
- * This function writes to the *virtual* memory as seen by the kernel.
- */
---- linux-2.6.18.noarch/drivers/char/mem.c~ 2006-10-14 19:02:57.000000000 -0400
-+++ linux-2.6.18.noarch/drivers/char/mem.c 2006-10-14 19:03:07.000000000 -0400
-@@ -454,65 +454,6 @@ static ssize_t read_kmem(struct file *fi
- return read;
- }
-
--
-/*
- * This function writes to the *virtual* memory as seen by the kernel.
- */
@@ -309,25 +335,26 @@
#if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__)
static ssize_t read_port(struct file * file, char __user * buf,
size_t count, loff_t *ppos)
-@@ -717,7 +617,6 @@ static struct file_operations mem_fops =
- static struct file_operations kmem_fops = {
+@@ -818,7 +720,6 @@ static const struct file_operations mem_
+ static const struct file_operations kmem_fops = {
.llseek = memory_lseek,
.read = read_kmem,
- .write = write_kmem,
.mmap = mmap_kmem,
.open = open_kmem,
- };
-@@ -823,7 +722,6 @@ static const struct {
- struct file_operations *fops;
+ .get_unmapped_area = get_unmapped_area_mem,
+@@ -954,7 +855,6 @@ static const struct {
+ const struct file_operations *fops;
} devlist[] = { /* list of minor devices */
{1, "mem", S_IRUSR | S_IWUSR | S_IRGRP, &mem_fops},
- {2, "kmem", S_IRUSR | S_IWUSR | S_IRGRP, &kmem_fops},
{3, "null", S_IRUGO | S_IWUGO, &null_fops},
- #if defined(CONFIG_ISA) || !defined(__mc68000__)
+ #if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__)
{4, "port", S_IRUSR | S_IWUSR | S_IRGRP, &port_fops},
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/fs/proc/kcore.c linux-1050/fs/proc/kcore.c
---- linux-1020/fs/proc/kcore.c
-+++ linux-1050/fs/proc/kcore.c
+Index: linux-2.6/fs/proc/kcore.c
+===================================================================
+--- linux-2.6.orig/fs/proc/kcore.c
++++ linux-2.6/fs/proc/kcore.c
@@ -25,7 +25,7 @@
static int open_kcore(struct inode * inode, struct file * filp)
@@ -337,8 +364,10 @@
}
static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *);
---- linux-2.6.17.noarch/include/asm-alpha/page.h~ 2006-09-17 11:29:02.000000000 -0400
-+++ linux-2.6.17.noarch/include/asm-alpha/page.h 2006-09-17 11:29:22.000000000 -0400
+Index: linux-2.6/include/asm-alpha/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-alpha/page.h
++++ linux-2.6/include/asm-alpha/page.h
@@ -93,6 +93,8 @@ typedef unsigned long pgprot_t;
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
@@ -348,22 +377,24 @@
#include <asm-generic/memory_model.h>
#include <asm-generic/page.h>
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-arm/page.h linux-1050/include/asm-arm/page.h
---- linux-1020/include/asm-arm/page.h
-+++ linux-1050/include/asm-arm/page.h
-@@ -192,6 +192,8 @@ static inline int get_order(unsigned lon
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+Index: linux-2.6/include/asm-arm/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-arm/page.h
++++ linux-2.6/include/asm-arm/page.h
+@@ -192,6 +192,8 @@ typedef unsigned long pgprot_t;
+
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-arm26/page.h linux-1050/include/asm-arm26/page.h
---- linux-1020/include/asm-arm26/page.h
-+++ linux-1050/include/asm-arm26/page.h
-@@ -110,6 +110,8 @@ static inline int get_order(unsigned lon
+Index: linux-2.6/include/asm-arm26/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-arm26/page.h
++++ linux-2.6/include/asm-arm26/page.h
+@@ -95,6 +95,8 @@ typedef unsigned long pgprot_t;
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
@@ -371,45 +402,50 @@
+
#endif /* __KERNEL__ */
- #endif
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-cris/page.h linux-1050/include/asm-cris/page.h
---- linux-1020/include/asm-cris/page.h
-+++ linux-1050/include/asm-cris/page.h
-@@ -99,6 +99,8 @@ static inline int get_order(unsigned lon
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+ #include <asm-generic/page.h>
+Index: linux-2.6/include/asm-cris/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-cris/page.h
++++ linux-2.6/include/asm-cris/page.h
+@@ -76,6 +76,8 @@ typedef struct { unsigned long pgprot; }
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _CRIS_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-h8300/page.h linux-1050/include/asm-h8300/page.h
---- linux-1020/include/asm-h8300/page.h
-+++ linux-1050/include/asm-h8300/page.h
-@@ -99,6 +99,8 @@ extern unsigned long memory_end;
-
- #endif /* __ASSEMBLY__ */
+Index: linux-2.6/include/asm-h8300/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-h8300/page.h
++++ linux-2.6/include/asm-h8300/page.h
+@@ -78,6 +78,8 @@ extern unsigned long memory_end;
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _H8300_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-i386/page.h linux-1050/include/asm-i386/page.h
---- linux-1020/include/asm-i386/page.h
-+++ linux-1050/include/asm-i386/page.h
-@@ -119,6 +119,8 @@ static __inline__ int get_order(unsigned
+Index: linux-2.6/include/asm-i386/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-i386/page.h
++++ linux-2.6/include/asm-i386/page.h
+@@ -108,6 +108,8 @@ extern int sysctl_legacy_va_layout;
- extern int sysctl_legacy_va_layout;
+ extern int page_is_ram(unsigned long pagenr);
+extern int devmem_is_allowed(unsigned long pagenr);
+
#endif /* __ASSEMBLY__ */
#ifdef __ASSEMBLY__
---- linux-2.6.18.noarch/include/asm-ia64/page.h~ 2006-10-14 19:04:40.000000000 -0400
-+++ linux-2.6.18.noarch/include/asm-ia64/page.h 2006-10-14 19:04:44.000000000 -0400
+Index: linux-2.6/include/asm-ia64/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-ia64/page.h
++++ linux-2.6/include/asm-ia64/page.h
@@ -227,5 +227,6 @@ get_order (unsigned long size)
(((current->personality & READ_IMPLIES_EXEC) != 0) \
? VM_EXEC : 0))
@@ -417,56 +453,62 @@
+#define devmem_is_allowed(x) 1
# endif /* __KERNEL__ */
#endif /* _ASM_IA64_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-m68k/page.h linux-1050/include/asm-m68k/page.h
---- linux-1020/include/asm-m68k/page.h
-+++ linux-1050/include/asm-m68k/page.h
-@@ -190,6 +190,8 @@ static inline void *__va(unsigned long x
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+Index: linux-2.6/include/asm-m68k/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-m68k/page.h
++++ linux-2.6/include/asm-m68k/page.h
+@@ -177,6 +177,8 @@ static inline void *__va(unsigned long x
+
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _M68K_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-m68knommu/page.h linux-1050/include/asm-m68knommu/page.h
---- linux-1020/include/asm-m68knommu/page.h
-+++ linux-1050/include/asm-m68knommu/page.h
-@@ -96,6 +96,8 @@ extern unsigned long memory_end;
+Index: linux-2.6/include/asm-m68knommu/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-m68knommu/page.h
++++ linux-2.6/include/asm-m68knommu/page.h
+@@ -77,6 +77,8 @@ extern unsigned long memory_end;
- #endif /* __ASSEMBLY__ */
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _M68KNOMMU_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-mips/page.h linux-1050/include/asm-mips/page.h
---- linux-1020/include/asm-mips/page.h
-+++ linux-1050/include/asm-mips/page.h
-@@ -148,4 +148,6 @@ static __inline__ int get_order(unsigned
- #define WANT_PAGE_VIRTUAL
- #endif
+Index: linux-2.6/include/asm-mips/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-mips/page.h
++++ linux-2.6/include/asm-mips/page.h
+@@ -178,4 +178,6 @@ typedef struct { unsigned long pgprot; }
+
+ #endif /* defined (__KERNEL__) */
+#define devmem_is_allowed(x) 1
+
#endif /* _ASM_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-parisc/page.h linux-1050/include/asm-parisc/page.h
---- linux-1020/include/asm-parisc/page.h
-+++ linux-1050/include/asm-parisc/page.h
-@@ -157,6 +157,8 @@ extern int npmem_ranges;
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+Index: linux-2.6/include/asm-parisc/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-parisc/page.h
++++ linux-2.6/include/asm-parisc/page.h
+@@ -169,6 +169,8 @@ extern int npmem_ranges;
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _PARISC_PAGE_H */
---- linux-2.6.16.noarch/include/asm-ppc/page.h~ 2006-03-28 10:16:25.000000000 -0500
-+++ linux-2.6.16.noarch/include/asm-ppc/page.h 2006-03-28 10:16:35.000000000 -0500
-@@ -174,6 +174,8 @@ extern __inline__ int get_order(unsigned
- /* We do define AT_SYSINFO_EHDR but don't use the gate mecanism */
+Index: linux-2.6/include/asm-ppc/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-ppc/page.h
++++ linux-2.6/include/asm-ppc/page.h
+@@ -173,6 +173,8 @@ extern __inline__ int get_order(unsigned
+ /* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
#define __HAVE_ARCH_GATE_AREA 1
+#define devmem_is_allowed(x) 1
@@ -474,10 +516,12 @@
#include <asm-generic/memory_model.h>
#endif /* __KERNEL__ */
#endif /* _PPC_PAGE_H */
---- linux-2.6.14/include/asm-powerpc/page.h~ 2005-11-15 12:12:43.000000000 -0500
-+++ linux-2.6.14/include/asm-powerpc/page.h 2005-11-15 12:13:21.000000000 -0500
-@@ -174,6 +174,8 @@ extern int page_is_ram(unsigned long pfn
-
+Index: linux-2.6/include/asm-powerpc/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-powerpc/page.h
++++ linux-2.6/include/asm-powerpc/page.h
+@@ -191,6 +191,8 @@ extern const char *arch_vma_name(struct
+ #include <asm-generic/memory_model.h>
#endif /* __ASSEMBLY__ */
+#define devmem_is_allowed(x) 1
@@ -485,56 +529,60 @@
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-s390/page.h linux-1050/include/asm-s390/page.h
---- linux-1020/include/asm-s390/page.h
-+++ linux-1050/include/asm-s390/page.h
-@@ -203,6 +203,8 @@ page_get_storage_key(unsigned long addr)
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+Index: linux-2.6/include/asm-s390/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-s390/page.h
++++ linux-2.6/include/asm-s390/page.h
+@@ -148,6 +148,8 @@ page_get_storage_key(unsigned long addr)
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _S390_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-sh/page.h linux-1050/include/asm-sh/page.h
---- linux-1020/include/asm-sh/page.h
-+++ linux-1050/include/asm-sh/page.h
-@@ -139,6 +139,8 @@ static __inline__ int get_order(unsigned
-
+Index: linux-2.6/include/asm-sh/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-sh/page.h
++++ linux-2.6/include/asm-sh/page.h
+@@ -124,5 +124,7 @@ typedef struct { unsigned long pgprot; }
+ #define __HAVE_ARCH_GATE_AREA
#endif
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
-
#endif /* __ASM_SH_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-sh64/page.h linux-1050/include/asm-sh64/page.h
---- linux-1020/include/asm-sh64/page.h
-+++ linux-1050/include/asm-sh64/page.h
-@@ -132,6 +132,8 @@ extern __inline__ int get_order(unsigned
-
- #endif
+Index: linux-2.6/include/asm-sh64/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-sh64/page.h
++++ linux-2.6/include/asm-sh64/page.h
+@@ -115,5 +115,7 @@ typedef struct { unsigned long pgprot; }
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
-
#endif /* __ASM_SH64_PAGE_H */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-sparc/page.h linux-1050/include/asm-sparc/page.h
---- linux-1020/include/asm-sparc/page.h
-+++ linux-1050/include/asm-sparc/page.h
-@@ -176,6 +176,8 @@ extern unsigned long pfn_base;
- #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+Index: linux-2.6/include/asm-sparc/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-sparc/page.h
++++ linux-2.6/include/asm-sparc/page.h
+@@ -163,6 +163,8 @@ extern unsigned long pfn_base;
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* __KERNEL__ */
#endif /* _SPARC_PAGE_H */
---- linux-2.6.18.noarch/include/asm-sparc64/page.h~ 2006-10-11 17:32:57.000000000 -0400
-+++ linux-2.6.18.noarch/include/asm-sparc64/page.h 2006-10-11 17:33:07.000000000 -0400
+Index: linux-2.6/include/asm-sparc64/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-sparc64/page.h
++++ linux-2.6/include/asm-sparc64/page.h
@@ -141,6 +141,8 @@ typedef unsigned long pgprot_t;
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
@@ -544,35 +592,38 @@
#include <asm-generic/page.h>
#endif /* __KERNEL__ */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-um/page.h linux-1050/include/asm-um/page.h
---- linux-1020/include/asm-um/page.h
-+++ linux-1050/include/asm-um/page.h
-@@ -123,6 +123,7 @@ static __inline__ int get_order(unsigned
+Index: linux-2.6/include/asm-um/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-um/page.h
++++ linux-2.6/include/asm-um/page.h
+@@ -113,6 +113,7 @@ extern unsigned long uml_physmem;
- extern struct page *arch_validate(struct page *page, int mask, int order);
+ extern struct page *arch_validate(struct page *page, gfp_t mask, int order);
#define HAVE_ARCH_VALIDATE
+#define devmem_is_allowed(x) 1
extern void arch_free_page(struct page *page, int order);
#define HAVE_ARCH_FREE_PAGE
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-v850/page.h linux-1050/include/asm-v850/page.h
---- linux-1020/include/asm-v850/page.h
-+++ linux-1050/include/asm-v850/page.h
-@@ -141,6 +141,8 @@ extern __inline__ int get_order (unsigne
- #define __va(x) ((void *)__phys_to_virt ((unsigned long)(x)))
-
+Index: linux-2.6/include/asm-v850/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-v850/page.h
++++ linux-2.6/include/asm-v850/page.h
+@@ -126,6 +126,8 @@ typedef unsigned long pgprot_t;
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#define devmem_is_allowed(x) 1
+
#endif /* KERNEL */
#endif /* __V850_PAGE_H__ */
-diff -urNp --exclude-from=/home/davej/.exclude linux-1020/include/asm-x86_64/page.h linux-1050/include/asm-x86_64/page.h
---- linux-1020/include/asm-x86_64/page.h
-+++ linux-1050/include/asm-x86_64/page.h
-@@ -138,6 +138,10 @@ extern __inline__ int get_order(unsigned
-
- #define __HAVE_ARCH_GATE_AREA 1
+Index: linux-2.6/include/asm-x86_64/page.h
+===================================================================
+--- linux-2.6.orig/include/asm-x86_64/page.h
++++ linux-2.6/include/asm-x86_64/page.h
+@@ -138,6 +138,10 @@ typedef struct { unsigned long pgprot; }
+ #include <asm-generic/memory_model.h>
+ #include <asm-generic/page.h>
+#ifndef __ASSEMBLY__
+extern int devmem_is_allowed(unsigned long pagenr);
@@ -581,34 +632,3 @@
#endif /* __KERNEL__ */
#endif /* _X86_64_PAGE_H */
---- linux-2.6.13/arch/x86_64/mm/init.c~ 2005-09-13 01:17:03.000000000 -0400
-+++ linux-2.6.13/arch/x86_64/mm/init.c 2005-09-13 01:18:03.000000000 -0400
-@@ -414,6 +414,28 @@ unsigned long next_ram_page (unsigned lo
-
- EXPORT_SYMBOL_GPL(next_ram_page);
-
-+static inline int page_is_ram (unsigned long pagenr)
-+{
-+ int i;
-+
-+ for (i = 0; i < e820.nr_map; i++) {
-+ unsigned long addr, end;
-+
-+ if (e820.map[i].type != E820_RAM) /* not usable memory */
-+ continue;
-+ /*
-+ * !!!FIXME!!! Some BIOSen report areas as RAM that
-+ * are not. Notably the 640->1Mb area. We need a sanity
-+ * check here.
-+ */
-+ addr = (e820.map[i].addr+PAGE_SIZE-1) >> PAGE_SHIFT;
-+ end = (e820.map[i].addr+e820.map[i].size) >> PAGE_SHIFT;
-+ if ((pagenr >= addr) && (pagenr < end))
-+ return 1;
-+ }
-+ return 0;
-+}
-+
- /*
- * devmem_is_allowed() checks to see if /dev/mem access to a certain address is
- * valid. The argument is a physical page number.
linux-2.6-execshield.patch:
arch/i386/kernel/cpu/common.c | 7 +
arch/i386/kernel/process.c | 59 +++++++++++++
arch/i386/kernel/smp.c | 3
arch/i386/kernel/sysenter.c | 5 -
arch/i386/kernel/traps.c | 93 ++++++++++++++++++++
arch/i386/mm/init.c | 6 +
arch/i386/mm/mmap.c | 6 -
arch/i386/mm/pageattr.c | 8 +
arch/ia64/ia32/binfmt_elf32.c | 2
arch/powerpc/kernel/vdso.c | 3
arch/x86_64/ia32/ia32_binfmt.c | 6 -
arch/x86_64/ia32/syscall32.c | 4
arch/x86_64/kernel/process.c | 6 -
arch/x86_64/kernel/setup64.c | 40 --------
arch/x86_64/mm/fault.c | 2
arch/x86_64/mm/mmap.c | 98 +++++++++++++++++----
drivers/char/random.c | 7 +
fs/binfmt_elf.c | 147 +++++++++++++++++++++++++-------
fs/proc/array.c | 8 +
fs/proc/base.c | 8 -
fs/proc/task_mmu.c | 29 +++++-
include/asm-i386/a.out.h | 2
include/asm-i386/desc.h | 14 +++
include/asm-i386/elf.h | 6 +
include/asm-i386/mmu.h | 4
include/asm-i386/page.h | 5 +
include/asm-i386/pgalloc.h | 1
include/asm-i386/processor.h | 8 +
include/asm-ia64/pgalloc.h | 4
include/asm-powerpc/elf.h | 3
include/asm-powerpc/pgalloc.h | 5 +
include/asm-ppc/pgalloc.h | 5 +
include/asm-s390/pgalloc.h | 4
include/asm-sparc/pgalloc.h | 4
include/asm-sparc64/pgalloc.h | 4
include/asm-x86_64/pgalloc.h | 7 +
include/linux/mm.h | 16 +++
include/linux/resource.h | 5 -
include/linux/sched.h | 9 ++
include/linux/sysctl.h | 3
kernel/signal.c | 33 +++++++
kernel/sysctl.c | 56 ++++++++++++
mm/fremap.c | 16 ++-
mm/mmap.c | 183 +++++++++++++++++++++++++++++++++++++++--
mm/mprotect.c | 6 +
mm/mremap.c | 4
46 files changed, 802 insertions(+), 152 deletions(-)
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.41 -r 1.42 linux-2.6-execshield.patch
Index: linux-2.6-execshield.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-execshield.patch,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- linux-2.6-execshield.patch 7 Nov 2006 01:08:53 -0000 1.41
+++ linux-2.6-execshield.patch 23 Nov 2006 22:00:34 -0000 1.42
@@ -1,7 +1,8 @@
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/arch/i386/kernel/cpu/common.c linux-810/arch/i386/kernel/cpu/common.c
---- linux-802/arch/i386/kernel/cpu/common.c
-+++ linux-810/arch/i386/kernel/cpu/common.c
-@@ -428,6 +428,13 @@ void __cpuinit identify_cpu(struct cpuin
+Index: linux-2.6/arch/i386/kernel/cpu/common.c
+===================================================================
+--- linux-2.6.orig/arch/i386/kernel/cpu/common.c
++++ linux-2.6/arch/i386/kernel/cpu/common.c
+@@ -437,6 +437,13 @@ void __cpuinit identify_cpu(struct cpuin
if (disable_pse)
clear_bit(X86_FEATURE_PSE, c->x86_capability);
@@ -15,10 +16,11 @@
/* If the model name is still unset, do table lookup. */
if ( !c->x86_model_id[0] ) {
char *p;
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/arch/i386/kernel/process.c linux-810/arch/i386/kernel/process.c
---- linux-802/arch/i386/kernel/process.c
-+++ linux-810/arch/i386/kernel/process.c
-@@ -646,6 +646,8 @@ struct task_struct fastcall * __switch_t
+Index: linux-2.6/arch/i386/kernel/process.c
+===================================================================
+--- linux-2.6.orig/arch/i386/kernel/process.c
++++ linux-2.6/arch/i386/kernel/process.c
+@@ -647,6 +647,8 @@ struct task_struct fastcall * __switch_t
/* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
__unlazy_fpu(prev_p);
@@ -27,7 +29,7 @@
/*
* Reload esp0.
-@@ -906,3 +908,60 @@ unsigned long arch_align_stack(unsigned
+@@ -907,3 +909,60 @@ unsigned long arch_align_stack(unsigned
sp -= get_random_int() % 8192;
return sp & ~0xf;
}
@@ -88,9 +90,10 @@
+ current->mm->brk = new_brk;
+}
+
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/arch/i386/kernel/smp.c linux-810/arch/i386/kernel/smp.c
---- linux-802/arch/i386/kernel/smp.c
-+++ linux-810/arch/i386/kernel/smp.c
+Index: linux-2.6/arch/i386/kernel/smp.c
+===================================================================
+--- linux-2.6.orig/arch/i386/kernel/smp.c
++++ linux-2.6/arch/i386/kernel/smp.c
@@ -23,6 +23,7 @@
#include <asm/mtrr.h>
@@ -99,7 +102,7 @@
#include <mach_apic.h>
/*
-@@ -324,6 +325,8 @@ fastcall void smp_invalidate_interrupt(s
+@@ -325,6 +326,8 @@ fastcall void smp_invalidate_interrupt(s
unsigned long cpu;
cpu = get_cpu();
@@ -108,9 +111,10 @@
if (!cpu_isset(cpu, flush_cpumask))
goto out;
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/arch/i386/kernel/sysenter.c linux-810/arch/i386/kernel/sysenter.c
---- linux-802/arch/i386/kernel/sysenter.c
-+++ linux-810/arch/i386/kernel/sysenter.c
+Index: linux-2.6/arch/i386/kernel/sysenter.c
+===================================================================
+--- linux-2.6.orig/arch/i386/kernel/sysenter.c
++++ linux-2.6/arch/i386/kernel/sysenter.c
@@ -118,7 +118,8 @@ static struct vm_operations_struct sysca
extern void SYSENTER_RETURN;
@@ -121,1672 +125,1748 @@
{
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/arch/i386/kernel/traps.c linux-810/arch/i386/kernel/traps.c
---- linux-802/arch/i386/kernel/traps.c
-+++ linux-810/arch/i386/kernel/traps.c
-@@ -565,7 +565,82 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", inv
- DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
- DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
- DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
--DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
+@@ -126,7 +127,7 @@ int arch_setup_additional_pages(struct l
+ int ret;
+
+ down_write(&mm->mmap_sem);
+- addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0);
++ addr = get_unmapped_area_prot(NULL, 0, PAGE_SIZE, 0, 0, 1);
+ if (IS_ERR_VALUE(addr)) {
+ ret = addr;
+ goto up_fail;
+Index: linux-2.6/kernel/sysctl.c
+===================================================================
+--- linux-2.6.orig/kernel/sysctl.c
++++ linux-2.6/kernel/sysctl.c
+@@ -77,6 +77,28 @@ extern int sysctl_drop_caches;
+ extern int percpu_pagelist_fraction;
+ extern int compat_log;
+
++extern unsigned int vdso_enabled, vdso_populate;
+
++int exec_shield = (1<<0);
++/* exec_shield is a bitmask:
++ 0: off; vdso at STACK_TOP, 1 page below TASK_SIZE
++ (1<<0) 1: on [also on if !=0]
++ (1<<1) 2: force noexecstack regardless of PT_GNU_STACK
++ The old settings
++ (1<<2) 4: vdso just below .text of main (unless too low)
++ (1<<3) 8: vdso just below .text of PT_INTERP (unless too low)
++ are ignored because the vdso is placed completely randomly
++*/
+
-+/*
-+ * lazy-check for CS validity on exec-shield binaries:
-+ *
-+ * the original non-exec stack patch was written by
-+ * Solar Designer <solar at openwall.com>. Thanks!
-+ */
-+static int
-+check_lazy_exec_limit(int cpu, struct pt_regs *regs, long error_code)
++static int __init setup_exec_shield(char *str)
+{
-+ struct desc_struct *desc1, *desc2;
-+ struct vm_area_struct *vma;
-+ unsigned long limit;
-+
-+ if (current->mm == NULL)
-+ return 0;
-+
-+ limit = -1UL;
-+ if (current->mm->context.exec_limit != -1UL) {
-+ limit = PAGE_SIZE;
-+ spin_lock(¤t->mm->page_table_lock);
-+ for (vma = current->mm->mmap; vma; vma = vma->vm_next)
-+ if ((vma->vm_flags & VM_EXEC) && (vma->vm_end > limit))
-+ limit = vma->vm_end;
-+ spin_unlock(¤t->mm->page_table_lock);
-+ if (limit >= TASK_SIZE)
-+ limit = -1UL;
-+ current->mm->context.exec_limit = limit;
-+ }
-+ set_user_cs(¤t->mm->context.user_cs, limit);
-+
-+ desc1 = ¤t->mm->context.user_cs;
-+ desc2 = get_cpu_gdt_table(cpu) + GDT_ENTRY_DEFAULT_USER_CS;
-+
-+ if (desc1->a != desc2->a || desc1->b != desc2->b) {
-+ /*
-+ * The CS was not in sync - reload it and retry the
-+ * instruction. If the instruction still faults then
-+ * we won't hit this branch next time around.
-+ */
-+ if (print_fatal_signals >= 2) {
-+ printk("#GPF fixup (%ld[seg:%lx]) at %08lx, CPU#%d.\n", error_code, error_code/8, regs->eip, smp_processor_id());
-+ printk(" exec_limit: %08lx, user_cs: %08lx/%08lx, CPU_cs: %08lx/%08lx.\n", current->mm->context.exec_limit, desc1->a, desc1->b, desc2->a, desc2->b);
-+ }
-+ load_user_cs_desc(cpu, current->mm);
-+ return 1;
-+ }
++ get_option (&str, &exec_shield);
+
-+ return 0;
++ return 1;
+}
+
-+/*
-+ * The fixup code for errors in iret jumps to here (iret_exc). It loses
-+ * the original trap number and error code. The bogus trap 32 and error
-+ * code 0 are what the vanilla kernel delivers via:
-+ * DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
-+ *
-+ * In case of a general protection fault in the iret instruction, we
-+ * need to check for a lazy CS update for exec-shield.
-+ */
-+fastcall void do_iret_error(struct pt_regs *regs, long error_code)
-+{
-+ int ok = check_lazy_exec_limit(get_cpu(), regs, error_code);
-+ put_cpu();
-+ if (!ok && notify_die(DIE_TRAP, "iret exception", regs,
-+ error_code, 32, SIGSEGV) != NOTIFY_STOP) {
-+ siginfo_t info;
-+ info.si_signo = SIGSEGV;
-+ info.si_errno = 0;
-+ info.si_code = ILL_BADSTK;
-+ info.si_addr = 0;
-+ do_trap(32, SIGSEGV, "iret exception", 0, regs, error_code,
-+ &info);
[...3072 lines suppressed...]
+
-+ err = 0;
-+ while (*pages) {
-+ struct page *page = *pages++;
-+ get_page(page);
-+ err = install_page(mm, vma, addr, page, vma->vm_page_prot);
-+ if (err) {
-+ put_page(page);
-+ break;
-+ }
-+ addr += PAGE_SIZE;
++__setup("print-fatal-signals=", setup_print_fatal_signals);
+
+ static int
+ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
+@@ -1795,6 +1826,8 @@ relock:
+ * Anything else is fatal, maybe with a core dump.
+ */
+ current->flags |= PF_SIGNALED;
++ if (print_fatal_signals)
++ print_fatal_signal(regs, signr);
+ if (sig_kernel_coredump(signr)) {
+ /*
+ * If it was able to dump core, this kills all
+Index: linux-2.6/mm/fremap.c
+===================================================================
+--- linux-2.6.orig/mm/fremap.c
++++ linux-2.6/mm/fremap.c
+@@ -67,13 +67,15 @@ int install_page(struct mm_struct *mm, s
+ * caller about it.
+ */
+ err = -EINVAL;
+- inode = vma->vm_file->f_mapping->host;
+- size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+- if (!page->mapping || page->index >= size)
+- goto unlock;
+- err = -ENOMEM;
+- if (page_mapcount(page) > INT_MAX/2)
+- goto unlock;
++ if (vma->vm_file) {
++ inode = vma->vm_file->f_mapping->host;
++ size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
++ if (!page->mapping || page->index >= size)
++ goto unlock;
++ err = -ENOMEM;
++ if (page_mapcount(page) > INT_MAX/2)
++ goto unlock;
+ }
-+
-+ return err;
-+}
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/mm/mprotect.c linux-810/mm/mprotect.c
---- linux-802/mm/mprotect.c
-+++ linux-810/mm/mprotect.c
+
+ if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte))
+ inc_mm_counter(mm, file_rss);
+Index: linux-2.6/mm/mprotect.c
+===================================================================
+--- linux-2.6.orig/mm/mprotect.c
++++ linux-2.6/mm/mprotect.c
@@ -23,6 +23,7 @@
#include <linux/swapops.h>
#include <asm/uaccess.h>
@@ -1795,7 +1875,7 @@
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
-@@ -136,7 +136,7 @@ mprotect_fixup(struct vm_area_struct *vm
+@@ -135,7 +136,7 @@ mprotect_fixup(struct vm_area_struct *vm
struct mm_struct *mm = vma->vm_mm;
unsigned long oldflags = vma->vm_flags;
long nrpages = (end - start) >> PAGE_SHIFT;
@@ -1804,7 +1884,7 @@
pgoff_t pgoff;
int error;
int dirty_accountable = 0;
-@@ -202,6 +202,9 @@ success:
+@@ -201,6 +202,9 @@ success:
dirty_accountable = 1;
}
@@ -1814,10 +1894,11 @@
if (is_vm_hugetlb_page(vma))
hugetlb_change_protection(vma, start, end, vma->vm_page_prot);
else
-diff -urNp --exclude-from=/home/davej/.exclude linux-802/mm/mremap.c linux-810/mm/mremap.c
---- linux-802/mm/mremap.c
-+++ linux-810/mm/mremap.c
-@@ -387,8 +387,8 @@ unsigned long do_mremap(unsigned long ad
+Index: linux-2.6/mm/mremap.c
+===================================================================
+--- linux-2.6.orig/mm/mremap.c
++++ linux-2.6/mm/mremap.c
+@@ -389,8 +389,8 @@ unsigned long do_mremap(unsigned long ad
if (vma->vm_flags & VM_MAYSHARE)
map_flags |= MAP_SHARED;
@@ -1828,101 +1909,3 @@
ret = new_addr;
if (new_addr & ~PAGE_MASK)
goto out;
-
-
-Date: Fri, 29 Sep 2006 02:14:32 +0100
-From: "Bart Oldeman" <bartoldeman at users.sourceforge.net>
-To: mingo at elte.hu
-Subject: [patch] exec-shield: move vdso back to the ascii-armor.
-
-Hi Ingo,
-
-testing exec-shield I observed that unlike in earlier versions, the
-vdso page was now placed at the normal maps around 0xbf000000. With
-the cs-selector protection that makes the heap executable.
-
-I wonder if this was done on purpose? In any case, the attached patch
-rectifies this.
-
-Also, two of the four bits in the sysctl are not used anymore, and I
-observed that random_int() when called withing very short time ranges,
-returns the same value, and the same random address, so the address is
-reset to 0x110000.
-
-As the vdso page is no longer placed just below any other region, SHLIB_BASE
-could be decreased by 0x1000.
-
-Bart
-
---- linux-2.6.18.noarch/kernel/sysctl.c~ 2006-09-29 16:59:02.000000000 -0400
-+++ linux-2.6.18.noarch/kernel/sysctl.c 2006-09-29 17:00:06.000000000 -0400
-@@ -82,16 +82,15 @@ extern int proc_unknown_nmi_panic(ctl_ta
-
- extern unsigned int vdso_enabled, vdso_populate;
-
--int exec_shield = (1<<3) | (1<<0);
-+int exec_shield = (1<<0);
- /* exec_shield is a bitmask:
- 0: off; vdso at STACK_TOP, 1 page below TASK_SIZE
- (1<<0) 1: on [also on if !=0]
-- (1<<1) 2: noexecstack by default
-+ (1<<1) 2: force noexecstack regardless of PT_GNU_STACK
-+ The old settings
- (1<<2) 4: vdso just below .text of main (unless too low)
- (1<<3) 8: vdso just below .text of PT_INTERP (unless too low)
--Yes, vdso placement is overloaded here; but exec_shield off
--is a strong incentive to place vdso at STACK_TOP, so the bit
--for vdso just below .text comes along for the ride.
-+ are ignored because the vdso is placed completely randomly
- */
-
- static int __init setup_exec_shield(char *str)
---- 1/mm/mmap.c.orig 2006-09-28 22:16:49.000000000 +0100
-+++ 2/mm/mmap.c 2006-09-28 23:58:14.000000000 +0100
-@@ -1407,7 +1407,7 @@
-
- EXPORT_SYMBOL(get_unmapped_area_prot);
-
--#define SHLIB_BASE 0x00111000
-+#define SHLIB_BASE 0x00110000
-
- unsigned long arch_get_unmapped_exec_area(struct file *filp, unsigned long addr0,
- unsigned long len0, unsigned long pgoff, unsigned long flags)
---- 1/arch/i386/kernel/sysenter.c.orig 2006-09-28 22:09:57.000000000 +0100
-+++ 2/arch/i386/kernel/sysenter.c 2006-09-28 23:02:38.000000000 +0100
-@@ -127,7 +127,7 @@
- int ret;
-
- down_write(&mm->mmap_sem);
-- addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0);
-+ addr = get_unmapped_area_prot(NULL, 0, PAGE_SIZE, 0, 0, 1);
- if (IS_ERR_VALUE(addr)) {
- ret = addr;
- goto up_fail;
-
-
---- linux-2.6.17-rc3-mm1-davej/arch/i386/mm/pageattr.c.org 2006-05-04 09:23:56.000000000 +0200
-+++ linux-2.6.17-rc3-mm1-davej/arch/i386/mm/pageattr.c 2006-05-04 09:27:21.000000000 +0200
-@@ -9,6 +9,8 @@
- #include <linux/highmem.h>
- #include <linux/module.h>
- #include <linux/slab.h>
-+#include <linux/kernel.h>
-+#include <asm/sections.h>
- #include <asm/uaccess.h>
- #include <asm/processor.h>
- #include <asm/tlbflush.h>
-@@ -130,6 +132,12 @@
- BUG_ON(PageHighMem(page));
- address = (unsigned long)page_address(page);
-
-+ if (address >= (unsigned long)__start_rodata && address <= (unsigned long)__end_rodata &&
-+ (pgprot_val(prot) & _PAGE_RW)) {
-+ pgprot_val(prot) &= ~(_PAGE_RW);
-+ add_taint(TAINT_MACHINE_CHECK);
-+ }
-+
- kpte = lookup_address(address);
- if (!kpte)
- return -EINVAL;
-
linux-2.6-proc-self-maps-fix.patch:
fs/proc/base.c | 20 ++++++++++++++++++++
fs/proc/internal.h | 2 ++
fs/proc/task_mmu.c | 3 +--
include/linux/ptrace.h | 1 +
kernel/ptrace.c | 4 ++--
5 files changed, 26 insertions(+), 4 deletions(-)
Index: linux-2.6-proc-self-maps-fix.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-proc-self-maps-fix.patch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- linux-2.6-proc-self-maps-fix.patch 3 Oct 2006 18:00:26 -0000 1.7
+++ linux-2.6-proc-self-maps-fix.patch 23 Nov 2006 22:00:35 -0000 1.8
@@ -1,13 +1,13 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=165351
-diff --git a/fs/proc/base.c b/fs/proc/base.c
-index a3a3eec..3f262cd 100644
---- a/fs/proc/base.c
-+++ b/fs/proc/base.c
-@@ -408,6 +408,26 @@ static int proc_task_root_link(struct in
- (task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
- security_ptrace(current,task) == 0))
+Index: linux-2.6/fs/proc/base.c
+===================================================================
+--- linux-2.6.orig/fs/proc/base.c
++++ linux-2.6/fs/proc/base.c
+@@ -190,6 +190,26 @@ static int proc_root_link(struct inode *
+ return result;
+ }
+struct mm_struct *mm_for_maps(struct task_struct *task)
+{
@@ -18,7 +18,7 @@
+ task_lock(task);
+ if (task->mm != mm)
+ goto out;
-+ if (task->mm != current->mm && tracehook_allow_access_process_vm(task))
++ if (task->mm != current->mm && __ptrace_may_attach(task) < 0)
+ goto out;
+ task_unlock(task);
+ return mm;
@@ -32,10 +32,10 @@
static int proc_pid_environ(struct task_struct *task, char * buffer)
{
int res = 0;
-diff --git a/fs/proc/internal.h b/fs/proc/internal.h
-index 0502f17..cd172ce 100644
---- a/fs/proc/internal.h
-+++ b/fs/proc/internal.h
+Index: linux-2.6/fs/proc/internal.h
+===================================================================
+--- linux-2.6.orig/fs/proc/internal.h
++++ linux-2.6/fs/proc/internal.h
@@ -16,6 +16,8 @@ struct vmalloc_info {
unsigned long largest_chunk;
};
@@ -45,9 +45,11 @@
#ifdef CONFIG_MMU
#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
extern void get_vmalloc_info(struct vmalloc_info *vmi);
---- linux-2.6.17.noarch/fs/proc/task_mmu.c~ 2006-06-26 19:16:06.064089000 -0400
-+++ linux-2.6.17.noarch/fs/proc/task_mmu.c 2006-06-26 19:19:02.178798000 -0400
-@@ -344,12 +344,11 @@ static void *m_start(struct seq_file *m,
+Index: linux-2.6/fs/proc/task_mmu.c
+===================================================================
+--- linux-2.6.orig/fs/proc/task_mmu.c
++++ linux-2.6/fs/proc/task_mmu.c
+@@ -348,12 +348,11 @@ static void *m_start(struct seq_file *m,
if (!priv->task)
return NULL;
@@ -61,25 +63,11 @@
/* Start with last addr hint */
if (last_addr && (vma = find_vma(mm, last_addr))) {
-
-
-
-diff -urN linux-2.6.18.x86_64/fs/proc/base.c foo/fs/proc/base.c
---- linux-2.6.18.x86_64/fs/proc/base.c 2006-09-29 07:30:57.000000000 -0400
-+++ foo/fs/proc/base.c 2006-09-29 08:06:52.000000000 -0400
-@@ -415,7 +415,7 @@
- task_lock(task);
- if (task->mm != mm)
- goto out;
-- if (task->mm != current->mm && tracehook_allow_access_process_vm(task))
-+ if (task->mm != current->mm && __ptrace_may_attach(task) < 0)
- goto out;
- task_unlock(task);
- return mm;
-diff -urN linux-2.6.18.x86_64/include/linux/ptrace.h foo/include/linux/ptrace.h
---- linux-2.6.18.x86_64/include/linux/ptrace.h 2006-09-29 07:30:56.000000000 -0400
-+++ foo/include/linux/ptrace.h 2006-09-29 08:05:09.000000000 -0400
-@@ -57,6 +57,7 @@
+Index: linux-2.6/include/linux/ptrace.h
+===================================================================
+--- linux-2.6.orig/include/linux/ptrace.h
++++ linux-2.6/include/linux/ptrace.h
+@@ -57,6 +57,7 @@ struct rusage;
extern int ptrace_may_attach(struct task_struct *task);
@@ -87,10 +75,11 @@
#ifdef CONFIG_PTRACE
-diff -urN linux-2.6.18.x86_64/kernel/ptrace.c foo/kernel/ptrace.c
---- linux-2.6.18.x86_64/kernel/ptrace.c 2006-09-29 07:30:56.000000000 -0400
-+++ foo/kernel/ptrace.c 2006-09-29 08:04:23.000000000 -0400
-@@ -32,7 +32,7 @@
+Index: linux-2.6/kernel/ptrace.c
+===================================================================
+--- linux-2.6.orig/kernel/ptrace.c
++++ linux-2.6/kernel/ptrace.c
+@@ -32,7 +32,7 @@ int getrusage(struct task_struct *, int,
//#define PTRACE_DEBUG
@@ -99,7 +88,7 @@
{
/* May we inspect the given task?
* This check is used both for attaching with ptrace
-@@ -66,7 +66,7 @@
+@@ -66,7 +66,7 @@ int ptrace_may_attach(struct task_struct
{
int err;
task_lock(task);
@@ -108,4 +97,3 @@
task_unlock(task);
return !err;
}
-
linux-2.6-squashfs.patch:
fs/Kconfig | 65 ++
fs/Makefile | 1
fs/squashfs/Makefile | 7
fs/squashfs/inode.c | 2
fs/squashfs/squashfs.h | 2
fs/squashfs/squashfs2_0.c | 1
include/linux/squashfs_fs.h | 911 +++++++++++++++++++++++++++++++++++++++++
include/linux/squashfs_fs_i.h | 45 ++
include/linux/squashfs_fs_sb.h | 1
9 files changed, 1031 insertions(+), 4 deletions(-)
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.12 -r 1.13 linux-2.6-squashfs.patch
Index: linux-2.6-squashfs.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6-squashfs.patch,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- linux-2.6-squashfs.patch 17 Nov 2006 21:07:49 -0000 1.12
+++ linux-2.6-squashfs.patch 23 Nov 2006 22:00:35 -0000 1.13
@@ -1,20 +1,21 @@
-diff --new-file -urp linux-2.6.15/fs/Kconfig linux-2.6.15-squashfs3.0/fs/Kconfig
---- linux-2.6.15/fs/Kconfig 2006-03-01 22:37:27.000000000 +0000
-+++ linux-2.6.15-squashfs3.0/fs/Kconfig 2006-03-07 21:12:37.000000000 +0000
-@@ -1151,6 +1151,71 @@
+Index: linux-2.6/fs/Kconfig
+===================================================================
+--- linux-2.6.orig/fs/Kconfig
++++ linux-2.6/fs/Kconfig
+@@ -1407,6 +1407,71 @@ config CRAMFS
If unsure, say N.
+config SQUASHFS
-+ tristate "SquashFS 3.0 - Squashed file system support"
++ tristate "SquashFS 3.1 - Squashed file system support"
+ select ZLIB_INFLATE
+ help
-+ Saying Y here includes support for SquashFS 3.0 (a Compressed Read-Only File
++ Saying Y here includes support for SquashFS 3.1 (a Compressed Read-Only File
+ System). Squashfs is a highly compressed read-only filesystem for Linux.
+ It uses zlib compression to compress both files, inodes and directories.
+ Inodes in the system are very small and all blocks are packed to minimise
+ data overhead. Block sizes greater than 4K are supported up to a maximum of 64K.
-+ SquashFS 3.0 supports 64 bit filesystems and files (larger than 4GB), full
++ SquashFS 3.1 supports 64 bit filesystems and files (larger than 4GB), full
+ uid/gid information, hard links and timestamps.
+
+ Squashfs is intended for general read-only filesystem use, for archival
@@ -72,2150 +73,43 @@
+
config VXFS_FS
tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)"
- help
---- linux-2.6.15/fs/Makefile 2006-03-01 22:37:27.000000000 +0000
-+++ linux-2.6.15-squashfs3.0/fs/Makefile 2006-03-07 21:12:37.000000000 +0000
-@@ -55,6 +55,7 @@
- obj-$(CONFIG_JBD) += jbd/
+ depends on BLOCK
+Index: linux-2.6/fs/Makefile
+===================================================================
+--- linux-2.6.orig/fs/Makefile
++++ linux-2.6/fs/Makefile
+@@ -67,6 +67,7 @@ obj-$(CONFIG_JBD) += jbd/
+ obj-$(CONFIG_JBD2) += jbd2/
obj-$(CONFIG_EXT2_FS) += ext2/
obj-$(CONFIG_CRAMFS) += cramfs/
+obj-$(CONFIG_SQUASHFS) += squashfs/
obj-$(CONFIG_RAMFS) += ramfs/
obj-$(CONFIG_HUGETLBFS) += hugetlbfs/
obj-$(CONFIG_CODA_FS) += coda/
---- linux-2.6.15/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.15-squashfs3.0/fs/squashfs/inode.c 2006-03-07 21:12:37.000000000 +0000
-@@ -0,0 +1,2127 @@
-+/*
-+ * Squashfs - a compressed read only filesystem for Linux
-+ *
-+ * Copyright (c) 2002, 2003, 2004, 2005, 2006
-+ * Phillip Lougher <phillip at lougher.org.uk>
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2,
-+ * or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ *
-+ * inode.c
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/squashfs_fs.h>
-+#include <linux/module.h>
-+#include <linux/errno.h>
-+#include <linux/slab.h>
-+#include <linux/fs.h>
-+#include <linux/smp_lock.h>
-+#include <linux/slab.h>
-+#include <linux/squashfs_fs_sb.h>
-+#include <linux/squashfs_fs_i.h>
-+#include <linux/buffer_head.h>
-+#include <linux/vfs.h>
-+#include <linux/init.h>
-+#include <linux/dcache.h>
-+#include <linux/wait.h>
-+#include <linux/zlib.h>
-+#include <linux/blkdev.h>
-+#include <linux/vmalloc.h>
-+#include <asm/uaccess.h>
-+#include <asm/semaphore.h>
-+
-+#include "squashfs.h"
-+
-+static void squashfs_put_super(struct super_block *);
-+static int squashfs_statfs(struct dentry *, struct kstatfs *);
-+static int squashfs_symlink_readpage(struct file *file, struct page *page);
-+static int squashfs_readpage(struct file *file, struct page *page);
-+static int squashfs_readpage4K(struct file *file, struct page *page);
-+static int squashfs_readdir(struct file *, void *, filldir_t);
-+static struct inode *squashfs_alloc_inode(struct super_block *sb);
-+static void squashfs_destroy_inode(struct inode *inode);
-+static int init_inodecache(void);
-+static void destroy_inodecache(void);
-+static struct dentry *squashfs_lookup(struct inode *, struct dentry *,
-+ struct nameidata *);
-+static struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode);
-+static long long read_blocklist(struct inode *inode, int index,
-+ int readahead_blks, char *block_list,
-+ unsigned short **block_p, unsigned int *bsize);
-+static struct super_block *squashfs_get_sb(struct file_system_type *, int,
-+ const char *, void *, struct vfsmount *);
-+
-+
-+static z_stream stream;
-+
-+static struct file_system_type squashfs_fs_type = {
-+ .owner = THIS_MODULE,
-+ .name = "squashfs",
-+ .get_sb = squashfs_get_sb,
-+ .kill_sb = kill_block_super,
-+ .fs_flags = FS_REQUIRES_DEV
-+};
-+
-+static unsigned char squashfs_filetype_table[] = {
-+ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK
-+};
-+
-+static struct super_operations squashfs_ops = {
-+ .alloc_inode = squashfs_alloc_inode,
-+ .destroy_inode = squashfs_destroy_inode,
-+ .statfs = squashfs_statfs,
-+ .put_super = squashfs_put_super,
-+};
-+
-+SQSH_EXTERN struct address_space_operations squashfs_symlink_aops = {
-+ .readpage = squashfs_symlink_readpage
-+};
-+
-+SQSH_EXTERN struct address_space_operations squashfs_aops = {
-+ .readpage = squashfs_readpage
-+};
-+
-+SQSH_EXTERN struct address_space_operations squashfs_aops_4K = {
-+ .readpage = squashfs_readpage4K
-+};
-+
-+static struct file_operations squashfs_dir_ops = {
-+ .read = generic_read_dir,
-+ .readdir = squashfs_readdir
-+};
-+
-+SQSH_EXTERN struct inode_operations squashfs_dir_inode_ops = {
-+ .lookup = squashfs_lookup
-+};
-+
-+
-+static struct buffer_head *get_block_length(struct super_block *s,
-+ int *cur_index, int *offset, int *c_byte)
-+{
-+ struct squashfs_sb_info *msblk = s->s_fs_info;
-+ unsigned short temp;
-+ struct buffer_head *bh;
-+
-+ if (!(bh = sb_bread(s, *cur_index)))
-+ goto out;
-+
-+ if (msblk->devblksize - *offset == 1) {
-+ if (msblk->swap)
-+ ((unsigned char *) &temp)[1] = *((unsigned char *)
-+ (bh->b_data + *offset));
-+ else
-+ ((unsigned char *) &temp)[0] = *((unsigned char *)
-+ (bh->b_data + *offset));
-+ brelse(bh);
-+ if (!(bh = sb_bread(s, ++(*cur_index))))
-+ goto out;
-+ if (msblk->swap)
-+ ((unsigned char *) &temp)[0] = *((unsigned char *)
-+ bh->b_data);
-+ else
-+ ((unsigned char *) &temp)[1] = *((unsigned char *)
-+ bh->b_data);
-+ *c_byte = temp;
-+ *offset = 1;
-+ } else {
[...3527 lines suppressed...]
-- (sblk->fragments) |
-- SQUASHFS_COMPRESSED_BIT_BLOCK, NULL)) {
-+ if (!squashfs_read_data(s, (char *) msblk->fragment_index,
-+ sblk->fragment_table_start, length |
-+ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length)) {
- ERROR("unable to read fragment index table\n");
- return 0;
- }
-@@ -982,9 +1004,11 @@ static int squashfs_fill_super(struct su
- init_waitqueue_head(&msblk->waitq);
- init_waitqueue_head(&msblk->fragment_wait_queue);
-
-+ sblk->bytes_used = sizeof(struct squashfs_super_block);
- if (!squashfs_read_data(s, (char *) sblk, SQUASHFS_START,
- sizeof(struct squashfs_super_block) |
-- SQUASHFS_COMPRESSED_BIT_BLOCK, NULL)) {
-+ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL,
-+ sizeof(struct squashfs_super_block))) {
- SERROR("unable to read superblock\n");
- goto failed_mount;
- }
-@@ -1012,6 +1036,15 @@ static int squashfs_fill_super(struct su
- if(!supported_squashfs_filesystem(msblk, silent))
- goto failed_mount;
-
-+ /* Check the filesystem does not extend beyond the end of the
-+ block device */
-+ if(sblk->bytes_used < 0 || sblk->bytes_used > i_size_read(s->s_bdev->bd_inode))
-+ goto failed_mount;
-+
-+ /* Check the root inode for sanity */
-+ if (SQUASHFS_INODE_OFFSET(sblk->root_inode) > SQUASHFS_METADATA_SIZE)
-+ goto failed_mount;
-+
- TRACE("Found valid superblock on %s\n", bdevname(s->s_bdev, b));
- TRACE("Inodes are %scompressed\n",
- SQUASHFS_UNCOMPRESSED_INODES
-@@ -1081,7 +1114,9 @@ static int squashfs_fill_super(struct su
- if (!squashfs_read_data(s, (char *) &suid, sblk->uid_start,
- ((sblk->no_uids + sblk->no_guids) *
- sizeof(unsigned int)) |
-- SQUASHFS_COMPRESSED_BIT_BLOCK, NULL)) {
-+ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL,
-+ (sblk->no_uids + sblk->no_guids) *
-+ sizeof(unsigned int))) {
- ERROR("unable to read uid/gid table\n");
- goto failed_mount;
- }
-@@ -1092,7 +1127,9 @@ static int squashfs_fill_super(struct su
- if (!squashfs_read_data(s, (char *) msblk->uid, sblk->uid_start,
- ((sblk->no_uids + sblk->no_guids) *
- sizeof(unsigned int)) |
-- SQUASHFS_COMPRESSED_BIT_BLOCK, NULL)) {
-+ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL,
-+ (sblk->no_uids + sblk->no_guids) *
-+ sizeof(unsigned int))) {
- ERROR("unable to read uid/gid table\n");
- goto failed_mount;
- }
-@@ -1518,7 +1555,8 @@ static int squashfs_readpage(struct file
- down(&msblk->read_page_mutex);
-
- if (!(bytes = squashfs_read_data(inode->i_sb, msblk->read_page,
-- block, bsize, NULL))) {
-+ block, bsize, NULL,
-+ msblk->read_size))) {
- ERROR("Unable to read page, block %llx, size %x\n", block,
- bsize);
- up(&msblk->read_page_mutex);
-@@ -1618,15 +1656,12 @@ static int squashfs_readpage4K(struct fi
-
- if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >>
- PAGE_CACHE_SHIFT)) {
-- pageaddr = kmap_atomic(page, KM_USER0);
- block_list = NULL;
- goto skip_read;
- }
-
- if (!(block_list = kmalloc(SIZE, GFP_KERNEL))) {
- ERROR("Failed to allocate block_list\n");
-- pageaddr = kmap_atomic(page, KM_USER0);
-- block_list = NULL;
- goto skip_read;
- }
-
-@@ -1638,11 +1673,12 @@ static int squashfs_readpage4K(struct fi
-
- down(&msblk->read_page_mutex);
- bytes = squashfs_read_data(inode->i_sb, msblk->read_page, block,
-- bsize, NULL);
-- pageaddr = kmap_atomic(page, KM_USER0);
-- if (bytes)
-+ bsize, NULL, msblk->read_size);
-+ if (bytes) {
-+ pageaddr = kmap_atomic(page, KM_USER0);
- memcpy(pageaddr, msblk->read_page, bytes);
-- else
-+ kunmap_atomic(pageaddr, KM_USER0);
-+ } else
- ERROR("Unable to read page, block %llx, size %x\n",
- block, bsize);
- up(&msblk->read_page_mutex);
-@@ -1652,11 +1688,12 @@ static int squashfs_readpage4K(struct fi
- SQUASHFS_I(inode)->
- u.s1.fragment_start_block,
- SQUASHFS_I(inode)-> u.s1.fragment_size);
-- pageaddr = kmap_atomic(page, KM_USER0);
- if (fragment) {
- bytes = i_size_read(inode) & (sblk->block_size - 1);
-+ pageaddr = kmap_atomic(page, KM_USER0);
- memcpy(pageaddr, fragment->data + SQUASHFS_I(inode)->
- u.s1.fragment_offset, bytes);
-+ kunmap_atomic(pageaddr, KM_USER0);
- release_cached_fragment(msblk, fragment);
- } else
- ERROR("Unable to read page, block %llx, size %x\n",
-@@ -1666,6 +1703,7 @@ static int squashfs_readpage4K(struct fi
- }
-
- skip_read:
-+ pageaddr = kmap_atomic(page, KM_USER0);
- memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes);
- kunmap_atomic(pageaddr, KM_USER0);
- flush_dcache_page(page);
-diff -Nurp linux/fs/squashfs/squashfs2_0.c linux-mokb/fs/squashfs/squashfs2_0.c
---- linux/fs/squashfs/squashfs2_0.c 2006-11-14 23:36:59.000000000 +0000
-+++ linux-mokb/fs/squashfs/squashfs2_0.c 2006-11-15 02:18:15.000000000 +0000
-@@ -73,12 +73,13 @@ static int read_fragment_index_table_2(s
- }
-
- if (SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments) &&
-- !squashfs_read_data(s, (char *)
-- msblk->fragment_index_2,
-- sblk->fragment_table_start,
-- SQUASHFS_FRAGMENT_INDEX_BYTES_2
-- (sblk->fragments) |
-- SQUASHFS_COMPRESSED_BIT_BLOCK, NULL)) {
-+ !squashfs_read_data(s, (char *)
-+ msblk->fragment_index_2,
-+ sblk->fragment_table_start,
-+ SQUASHFS_FRAGMENT_INDEX_BYTES_2
-+ (sblk->fragments) |
-+ SQUASHFS_COMPRESSED_BIT_BLOCK, NULL,
-+ SQUASHFS_FRAGMENT_INDEX_BYTES_2(sblk->fragments))) {
- ERROR("unable to read fragment index table\n");
- return 0;
- }
-diff -Nurp linux/fs/squashfs/squashfs.h linux-mokb/fs/squashfs/squashfs.h
---- linux/fs/squashfs/squashfs.h 2006-11-14 23:36:59.000000000 +0000
-+++ linux-mokb/fs/squashfs/squashfs.h 2006-11-15 01:59:01.000000000 +0000
-@@ -49,7 +49,7 @@ static inline struct squashfs_inode_info
- #define SQSH_EXTERN
- extern unsigned int squashfs_read_data(struct super_block *s, char *buffer,
- long long index, unsigned int length,
-- long long *next_index);
-+ long long *next_index, int srclength);
- extern int squashfs_get_cached_block(struct super_block *s, char *buffer,
- long long block, unsigned int offset,
- int length, long long *next_block,
---- linux-2.6.18.noarch/fs/squashfs/inode.c~ 2006-11-17 15:29:09.000000000 -0500
-+++ linux-2.6.18.noarch/fs/squashfs/inode.c 2006-11-17 15:29:51.000000000 -0500
-@@ -2148,9 +2148,7 @@ static int __init init_inodecache(void)
-
- static void destroy_inodecache(void)
- {
-- if (kmem_cache_destroy(squashfs_inode_cachep))
-- printk(KERN_INFO "squashfs_inode_cache: not all structures "
-- "were freed\n");
-+ kmem_cache_destroy(squashfs_inode_cachep);
- }
-
-
---- linux-2.6.17.noarch/fs/squashfs/inode.c~ 2006-07-12 13:54:31.000000000 -0400
-+++ linux-2.6.17.noarch/fs/squashfs/inode.c 2006-07-12 13:54:53.000000000 -0400
-@@ -607,7 +607,6 @@ static struct inode *squashfs_iget(struc
- i->i_fop = &generic_ro_fops;
- i->i_mode |= S_IFREG;
- i->i_blocks = ((i->i_size - 1) >> 9) + 1;
-- i->i_blksize = PAGE_CACHE_SIZE;
- SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
- SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
- SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
-@@ -660,7 +659,6 @@ static struct inode *squashfs_iget(struc
- i->i_fop = &generic_ro_fops;
- i->i_mode |= S_IFREG;
- i->i_blocks = ((i->i_size - 1) >> 9) + 1;
-- i->i_blksize = PAGE_CACHE_SIZE;
- SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
- SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
- SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
---- linux-2.6.17.noarch/fs/squashfs/squashfs2_0.c~ 2006-07-12 13:55:43.000000000 -0400
-+++ linux-2.6.17.noarch/fs/squashfs/squashfs2_0.c 2006-07-12 13:55:46.000000000 -0400
-@@ -228,7 +228,6 @@ static struct inode *squashfs_iget_2(str
- i->i_atime.tv_sec = inodep->mtime;
- i->i_ctime.tv_sec = inodep->mtime;
- i->i_blocks = ((i->i_size - 1) >> 9) + 1;
-- i->i_blksize = PAGE_CACHE_SIZE;
- SQUASHFS_I(i)->u.s1.fragment_start_block = frag_blk;
- SQUASHFS_I(i)->u.s1.fragment_size = frag_size;
- SQUASHFS_I(i)->u.s1.fragment_offset = inodep->offset;
More information about the fedora-cvs-commits
mailing list