diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-28 06:14:35 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-29 13:39:43 +0000 |
commit | a77919993912c8642b47986f0bff1dbe83c52210 (patch) | |
tree | 898c983f32e50192b84c1814e13df285de8bfe76 | |
parent | ca1226d6291aecaa1cf8c03948be5aa372ef1515 (diff) | |
download | alpine_aports-a77919993912c8642b47986f0bff1dbe83c52210.tar.bz2 alpine_aports-a77919993912c8642b47986f0bff1dbe83c52210.tar.xz alpine_aports-a77919993912c8642b47986f0bff1dbe83c52210.zip |
main/linux-grsec: upgrade to grsecurity-2.2.0-2.6.32.23-201009272133
(cherry picked from commit 9743ede01facb6eb5bbebae1c40bbed39a49aa12)
-rw-r--r-- | main/linux-grsec/APKBUILD | 6 | ||||
-rw-r--r-- | main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009272133.patch (renamed from main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009262116.patch) | 262 |
2 files changed, 116 insertions, 152 deletions
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD index 457ff6c64f..7395160ae6 100644 --- a/main/linux-grsec/APKBUILD +++ b/main/linux-grsec/APKBUILD | |||
@@ -4,7 +4,7 @@ _flavor=grsec | |||
4 | pkgname=linux-${_flavor} | 4 | pkgname=linux-${_flavor} |
5 | pkgver=2.6.32.23 | 5 | pkgver=2.6.32.23 |
6 | _kernver=2.6.32 | 6 | _kernver=2.6.32 |
7 | pkgrel=0 | 7 | pkgrel=1 |
8 | pkgdesc="Linux kernel with grsecurity" | 8 | pkgdesc="Linux kernel with grsecurity" |
9 | url=http://grsecurity.net | 9 | url=http://grsecurity.net |
10 | depends="mkinitfs linux-firmware" | 10 | depends="mkinitfs linux-firmware" |
@@ -14,7 +14,7 @@ _config=${config:-kernelconfig.${CARCH:-x86}} | |||
14 | install= | 14 | install= |
15 | source="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2 | 15 | source="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2 |
16 | ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2 | 16 | ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-$pkgver.bz2 |
17 | grsecurity-2.2.0-2.6.32.23-201009262116.patch | 17 | grsecurity-2.2.0-2.6.32.23-201009272133.patch |
18 | 0001-grsec-revert-conflicting-flow-cache-changes.patch | 18 | 0001-grsec-revert-conflicting-flow-cache-changes.patch |
19 | 0002-gre-fix-hard-header-destination-address-checking.patch | 19 | 0002-gre-fix-hard-header-destination-address-checking.patch |
20 | 0003-ip_gre-include-route-header_len-in-max_headroom-calc.patch | 20 | 0003-ip_gre-include-route-header_len-in-max_headroom-calc.patch |
@@ -150,7 +150,7 @@ firmware() { | |||
150 | 150 | ||
151 | md5sums="260551284ac224c3a43c4adac7df4879 linux-2.6.32.tar.bz2 | 151 | md5sums="260551284ac224c3a43c4adac7df4879 linux-2.6.32.tar.bz2 |
152 | 6eac9aebbf9e74546b7c44c0fb9348a7 patch-2.6.32.23.bz2 | 152 | 6eac9aebbf9e74546b7c44c0fb9348a7 patch-2.6.32.23.bz2 |
153 | f70ef30c2d2c60ffe11560201fe61d50 grsecurity-2.2.0-2.6.32.23-201009262116.patch | 153 | 1c9943454ee525a584543090486bd63f grsecurity-2.2.0-2.6.32.23-201009272133.patch |
154 | 1d247140abec49b96250aec9aa59b324 0001-grsec-revert-conflicting-flow-cache-changes.patch | 154 | 1d247140abec49b96250aec9aa59b324 0001-grsec-revert-conflicting-flow-cache-changes.patch |
155 | 437317f88ec13ace8d39c31983a41696 0002-gre-fix-hard-header-destination-address-checking.patch | 155 | 437317f88ec13ace8d39c31983a41696 0002-gre-fix-hard-header-destination-address-checking.patch |
156 | 151b29a161178ed39d62a08f21f3484d 0003-ip_gre-include-route-header_len-in-max_headroom-calc.patch | 156 | 151b29a161178ed39d62a08f21f3484d 0003-ip_gre-include-route-header_len-in-max_headroom-calc.patch |
diff --git a/main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009262116.patch b/main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009272133.patch index 4bebe8c85a..b87c317d86 100644 --- a/main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009262116.patch +++ b/main/linux-grsec/grsecurity-2.2.0-2.6.32.23-201009272133.patch | |||
@@ -5940,7 +5940,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/apm.h linux-2.6.32.23/arch/x86/i | |||
5940 | "popl %%edi\n\t" | 5940 | "popl %%edi\n\t" |
5941 | diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch/x86/include/asm/atomic_32.h | 5941 | diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch/x86/include/asm/atomic_32.h |
5942 | --- linux-2.6.32.23/arch/x86/include/asm/atomic_32.h 2010-08-13 16:24:37.000000000 -0400 | 5942 | --- linux-2.6.32.23/arch/x86/include/asm/atomic_32.h 2010-08-13 16:24:37.000000000 -0400 |
5943 | +++ linux-2.6.32.23/arch/x86/include/asm/atomic_32.h 2010-09-15 02:35:26.000000000 -0400 | 5943 | +++ linux-2.6.32.23/arch/x86/include/asm/atomic_32.h 2010-09-26 22:16:58.000000000 -0400 |
5944 | @@ -25,6 +25,17 @@ static inline int atomic_read(const atom | 5944 | @@ -25,6 +25,17 @@ static inline int atomic_read(const atom |
5945 | } | 5945 | } |
5946 | 5946 | ||
@@ -6229,7 +6229,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch | |||
6229 | asm volatile(LOCK_PREFIX "xaddl %0, %1" | 6229 | asm volatile(LOCK_PREFIX "xaddl %0, %1" |
6230 | : "+r" (i), "+m" (v->counter) | 6230 | : "+r" (i), "+m" (v->counter) |
6231 | : : "memory"); | 6231 | : : "memory"); |
6232 | @@ -227,22 +422,37 @@ static inline int atomic_xchg(atomic_t * | 6232 | @@ -227,22 +422,39 @@ static inline int atomic_xchg(atomic_t * |
6233 | */ | 6233 | */ |
6234 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | 6234 | static inline int atomic_add_unless(atomic_t *v, int a, int u) |
6235 | { | 6235 | { |
@@ -6245,6 +6245,8 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch | |||
6245 | + asm volatile("addl %2,%0\n" | 6245 | + asm volatile("addl %2,%0\n" |
6246 | + | 6246 | + |
6247 | +#ifdef CONFIG_PAX_REFCOUNT | 6247 | +#ifdef CONFIG_PAX_REFCOUNT |
6248 | + "jno 0f\n" | ||
6249 | + "subl %2,%0\n" | ||
6248 | + "into\n0:\n" | 6250 | + "into\n0:\n" |
6249 | + _ASM_EXTABLE(0b, 0b) | 6251 | + _ASM_EXTABLE(0b, 0b) |
6250 | +#endif | 6252 | +#endif |
@@ -6271,7 +6273,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch | |||
6271 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) | 6273 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) |
6272 | 6274 | ||
6273 | /* These are x86-specific, used by some header files */ | 6275 | /* These are x86-specific, used by some header files */ |
6274 | @@ -266,6 +476,14 @@ typedef struct { | 6276 | @@ -266,6 +478,14 @@ typedef struct { |
6275 | u64 __aligned(8) counter; | 6277 | u64 __aligned(8) counter; |
6276 | } atomic64_t; | 6278 | } atomic64_t; |
6277 | 6279 | ||
@@ -6288,7 +6290,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_32.h linux-2.6.32.23/arch | |||
6288 | extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val); | 6290 | extern u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val); |
6289 | diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch/x86/include/asm/atomic_64.h | 6291 | diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch/x86/include/asm/atomic_64.h |
6290 | --- linux-2.6.32.23/arch/x86/include/asm/atomic_64.h 2010-08-13 16:24:37.000000000 -0400 | 6292 | --- linux-2.6.32.23/arch/x86/include/asm/atomic_64.h 2010-08-13 16:24:37.000000000 -0400 |
6291 | +++ linux-2.6.32.23/arch/x86/include/asm/atomic_64.h 2010-09-21 20:46:18.000000000 -0400 | 6293 | +++ linux-2.6.32.23/arch/x86/include/asm/atomic_64.h 2010-09-26 22:30:45.000000000 -0400 |
6292 | @@ -24,6 +24,17 @@ static inline int atomic_read(const atom | 6294 | @@ -24,6 +24,17 @@ static inline int atomic_read(const atom |
6293 | } | 6295 | } |
6294 | 6296 | ||
@@ -6406,7 +6408,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6406 | : "=m" (v->counter), "=qm" (c) | 6408 | : "=m" (v->counter), "=qm" (c) |
6407 | : "ir" (i), "m" (v->counter) : "memory"); | 6409 | : "ir" (i), "m" (v->counter) : "memory"); |
6408 | return c; | 6410 | return c; |
6409 | @@ -90,7 +166,32 @@ static inline int atomic_sub_and_test(in | 6411 | @@ -90,7 +166,28 @@ static inline int atomic_sub_and_test(in |
6410 | */ | 6412 | */ |
6411 | static inline void atomic_inc(atomic_t *v) | 6413 | static inline void atomic_inc(atomic_t *v) |
6412 | { | 6414 | { |
@@ -6415,13 +6417,9 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6415 | + | 6417 | + |
6416 | +#ifdef CONFIG_PAX_REFCOUNT | 6418 | +#ifdef CONFIG_PAX_REFCOUNT |
6417 | + "jno 0f\n" | 6419 | + "jno 0f\n" |
6418 | + "int $4\n0:\n" | ||
6419 | + ".pushsection .fixup,\"ax\"\n" | ||
6420 | + "1:\n" | ||
6421 | + LOCK_PREFIX "decl %0\n" | 6420 | + LOCK_PREFIX "decl %0\n" |
6422 | + "jmp 0b\n" | 6421 | + "int $4\n0:\n" |
6423 | + ".popsection\n" | 6422 | + _ASM_EXTABLE(0b, 0b) |
6424 | + _ASM_EXTABLE(0b, 1b) | ||
6425 | +#endif | 6423 | +#endif |
6426 | + | 6424 | + |
6427 | + : "=m" (v->counter) | 6425 | + : "=m" (v->counter) |
@@ -6440,7 +6438,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6440 | : "=m" (v->counter) | 6438 | : "=m" (v->counter) |
6441 | : "m" (v->counter)); | 6439 | : "m" (v->counter)); |
6442 | } | 6440 | } |
6443 | @@ -103,7 +204,32 @@ static inline void atomic_inc(atomic_t * | 6441 | @@ -103,7 +200,28 @@ static inline void atomic_inc(atomic_t * |
6444 | */ | 6442 | */ |
6445 | static inline void atomic_dec(atomic_t *v) | 6443 | static inline void atomic_dec(atomic_t *v) |
6446 | { | 6444 | { |
@@ -6449,13 +6447,9 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6449 | + | 6447 | + |
6450 | +#ifdef CONFIG_PAX_REFCOUNT | 6448 | +#ifdef CONFIG_PAX_REFCOUNT |
6451 | + "jno 0f\n" | 6449 | + "jno 0f\n" |
6452 | + "int $4\n0:\n" | ||
6453 | + ".pushsection .fixup,\"ax\"\n" | ||
6454 | + "1: \n" | ||
6455 | + LOCK_PREFIX "incl %0\n" | 6450 | + LOCK_PREFIX "incl %0\n" |
6456 | + "jmp 0b\n" | 6451 | + "int $4\n0:\n" |
6457 | + ".popsection\n" | 6452 | + _ASM_EXTABLE(0b, 0b) |
6458 | + _ASM_EXTABLE(0b, 1b) | ||
6459 | +#endif | 6453 | +#endif |
6460 | + | 6454 | + |
6461 | + : "=m" (v->counter) | 6455 | + : "=m" (v->counter) |
@@ -6474,7 +6468,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6474 | : "=m" (v->counter) | 6468 | : "=m" (v->counter) |
6475 | : "m" (v->counter)); | 6469 | : "m" (v->counter)); |
6476 | } | 6470 | } |
6477 | @@ -120,7 +246,20 @@ static inline int atomic_dec_and_test(at | 6471 | @@ -120,7 +238,16 @@ static inline int atomic_dec_and_test(at |
6478 | { | 6472 | { |
6479 | unsigned char c; | 6473 | unsigned char c; |
6480 | 6474 | ||
@@ -6483,20 +6477,16 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6483 | + | 6477 | + |
6484 | +#ifdef CONFIG_PAX_REFCOUNT | 6478 | +#ifdef CONFIG_PAX_REFCOUNT |
6485 | + "jno 0f\n" | 6479 | + "jno 0f\n" |
6486 | + "int $4\n0:\n" | ||
6487 | + ".pushsection .fixup,\"ax\"\n" | ||
6488 | + "1: \n" | ||
6489 | + LOCK_PREFIX "incl %0\n" | 6480 | + LOCK_PREFIX "incl %0\n" |
6490 | + "jmp 0b\n" | 6481 | + "int $4\n0:\n" |
6491 | + ".popsection\n" | 6482 | + _ASM_EXTABLE(0b, 0b) |
6492 | + _ASM_EXTABLE(0b, 1b) | ||
6493 | +#endif | 6483 | +#endif |
6494 | + | 6484 | + |
6495 | + "sete %1\n" | 6485 | + "sete %1\n" |
6496 | : "=m" (v->counter), "=qm" (c) | 6486 | : "=m" (v->counter), "=qm" (c) |
6497 | : "m" (v->counter) : "memory"); | 6487 | : "m" (v->counter) : "memory"); |
6498 | return c != 0; | 6488 | return c != 0; |
6499 | @@ -138,7 +277,20 @@ static inline int atomic_inc_and_test(at | 6489 | @@ -138,7 +265,16 @@ static inline int atomic_inc_and_test(at |
6500 | { | 6490 | { |
6501 | unsigned char c; | 6491 | unsigned char c; |
6502 | 6492 | ||
@@ -6505,20 +6495,16 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6505 | + | 6495 | + |
6506 | +#ifdef CONFIG_PAX_REFCOUNT | 6496 | +#ifdef CONFIG_PAX_REFCOUNT |
6507 | + "jno 0f\n" | 6497 | + "jno 0f\n" |
6508 | + "int $4\n0:\n" | ||
6509 | + ".pushsection .fixup,\"ax\"\n" | ||
6510 | + "1: \n" | ||
6511 | + LOCK_PREFIX "decl %0\n" | 6498 | + LOCK_PREFIX "decl %0\n" |
6512 | + "jmp 0b\n" | 6499 | + "int $4\n0:\n" |
6513 | + ".popsection\n" | 6500 | + _ASM_EXTABLE(0b, 0b) |
6514 | + _ASM_EXTABLE(0b, 1b) | ||
6515 | +#endif | 6501 | +#endif |
6516 | + | 6502 | + |
6517 | + "sete %1\n" | 6503 | + "sete %1\n" |
6518 | : "=m" (v->counter), "=qm" (c) | 6504 | : "=m" (v->counter), "=qm" (c) |
6519 | : "m" (v->counter) : "memory"); | 6505 | : "m" (v->counter) : "memory"); |
6520 | return c != 0; | 6506 | return c != 0; |
6521 | @@ -157,7 +309,16 @@ static inline int atomic_add_negative(in | 6507 | @@ -157,7 +293,16 @@ static inline int atomic_add_negative(in |
6522 | { | 6508 | { |
6523 | unsigned char c; | 6509 | unsigned char c; |
6524 | 6510 | ||
@@ -6536,7 +6522,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6536 | : "=m" (v->counter), "=qm" (c) | 6522 | : "=m" (v->counter), "=qm" (c) |
6537 | : "ir" (i), "m" (v->counter) : "memory"); | 6523 | : "ir" (i), "m" (v->counter) : "memory"); |
6538 | return c; | 6524 | return c; |
6539 | @@ -173,7 +334,31 @@ static inline int atomic_add_negative(in | 6525 | @@ -173,7 +318,31 @@ static inline int atomic_add_negative(in |
6540 | static inline int atomic_add_return(int i, atomic_t *v) | 6526 | static inline int atomic_add_return(int i, atomic_t *v) |
6541 | { | 6527 | { |
6542 | int __i = i; | 6528 | int __i = i; |
@@ -6569,7 +6555,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6569 | : "+r" (i), "+m" (v->counter) | 6555 | : "+r" (i), "+m" (v->counter) |
6570 | : : "memory"); | 6556 | : : "memory"); |
6571 | return i + __i; | 6557 | return i + __i; |
6572 | @@ -185,6 +370,10 @@ static inline int atomic_sub_return(int | 6558 | @@ -185,6 +354,10 @@ static inline int atomic_sub_return(int |
6573 | } | 6559 | } |
6574 | 6560 | ||
6575 | #define atomic_inc_return(v) (atomic_add_return(1, v)) | 6561 | #define atomic_inc_return(v) (atomic_add_return(1, v)) |
@@ -6580,7 +6566,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6580 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) | 6566 | #define atomic_dec_return(v) (atomic_sub_return(1, v)) |
6581 | 6567 | ||
6582 | /* The 64-bit atomic type */ | 6568 | /* The 64-bit atomic type */ |
6583 | @@ -204,6 +393,18 @@ static inline long atomic64_read(const a | 6569 | @@ -204,6 +377,18 @@ static inline long atomic64_read(const a |
6584 | } | 6570 | } |
6585 | 6571 | ||
6586 | /** | 6572 | /** |
@@ -6599,7 +6585,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6599 | * atomic64_set - set atomic64 variable | 6585 | * atomic64_set - set atomic64 variable |
6600 | * @v: pointer to type atomic64_t | 6586 | * @v: pointer to type atomic64_t |
6601 | * @i: required value | 6587 | * @i: required value |
6602 | @@ -216,6 +417,18 @@ static inline void atomic64_set(atomic64 | 6588 | @@ -216,6 +401,18 @@ static inline void atomic64_set(atomic64 |
6603 | } | 6589 | } |
6604 | 6590 | ||
6605 | /** | 6591 | /** |
@@ -6618,7 +6604,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6618 | * atomic64_add - add integer to atomic64 variable | 6604 | * atomic64_add - add integer to atomic64 variable |
6619 | * @i: integer value to add | 6605 | * @i: integer value to add |
6620 | * @v: pointer to type atomic64_t | 6606 | * @v: pointer to type atomic64_t |
6621 | @@ -224,6 +437,28 @@ static inline void atomic64_set(atomic64 | 6607 | @@ -224,6 +421,28 @@ static inline void atomic64_set(atomic64 |
6622 | */ | 6608 | */ |
6623 | static inline void atomic64_add(long i, atomic64_t *v) | 6609 | static inline void atomic64_add(long i, atomic64_t *v) |
6624 | { | 6610 | { |
@@ -6647,7 +6633,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6647 | asm volatile(LOCK_PREFIX "addq %1,%0" | 6633 | asm volatile(LOCK_PREFIX "addq %1,%0" |
6648 | : "=m" (v->counter) | 6634 | : "=m" (v->counter) |
6649 | : "er" (i), "m" (v->counter)); | 6635 | : "er" (i), "m" (v->counter)); |
6650 | @@ -238,7 +473,15 @@ static inline void atomic64_add(long i, | 6636 | @@ -238,7 +457,15 @@ static inline void atomic64_add(long i, |
6651 | */ | 6637 | */ |
6652 | static inline void atomic64_sub(long i, atomic64_t *v) | 6638 | static inline void atomic64_sub(long i, atomic64_t *v) |
6653 | { | 6639 | { |
@@ -6664,7 +6650,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6664 | : "=m" (v->counter) | 6650 | : "=m" (v->counter) |
6665 | : "er" (i), "m" (v->counter)); | 6651 | : "er" (i), "m" (v->counter)); |
6666 | } | 6652 | } |
6667 | @@ -256,7 +499,16 @@ static inline int atomic64_sub_and_test( | 6653 | @@ -256,7 +483,16 @@ static inline int atomic64_sub_and_test( |
6668 | { | 6654 | { |
6669 | unsigned char c; | 6655 | unsigned char c; |
6670 | 6656 | ||
@@ -6682,7 +6668,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6682 | : "=m" (v->counter), "=qm" (c) | 6668 | : "=m" (v->counter), "=qm" (c) |
6683 | : "er" (i), "m" (v->counter) : "memory"); | 6669 | : "er" (i), "m" (v->counter) : "memory"); |
6684 | return c; | 6670 | return c; |
6685 | @@ -270,6 +522,31 @@ static inline int atomic64_sub_and_test( | 6671 | @@ -270,6 +506,27 @@ static inline int atomic64_sub_and_test( |
6686 | */ | 6672 | */ |
6687 | static inline void atomic64_inc(atomic64_t *v) | 6673 | static inline void atomic64_inc(atomic64_t *v) |
6688 | { | 6674 | { |
@@ -6690,13 +6676,9 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6690 | + | 6676 | + |
6691 | +#ifdef CONFIG_PAX_REFCOUNT | 6677 | +#ifdef CONFIG_PAX_REFCOUNT |
6692 | + "jno 0f\n" | 6678 | + "jno 0f\n" |
6693 | + "int $4\n0:\n" | ||
6694 | + ".pushsection .fixup,\"ax\"\n" | ||
6695 | + "1:\n" | ||
6696 | + LOCK_PREFIX "decq %0\n" | 6679 | + LOCK_PREFIX "decq %0\n" |
6697 | + "jmp 0b\n" | 6680 | + "int $4\n0:\n" |
6698 | + ".popsection\n" | 6681 | + _ASM_EXTABLE(0b, 0b) |
6699 | + _ASM_EXTABLE(0b, 1b) | ||
6700 | +#endif | 6682 | +#endif |
6701 | + | 6683 | + |
6702 | + : "=m" (v->counter) | 6684 | + : "=m" (v->counter) |
@@ -6714,7 +6696,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6714 | asm volatile(LOCK_PREFIX "incq %0" | 6696 | asm volatile(LOCK_PREFIX "incq %0" |
6715 | : "=m" (v->counter) | 6697 | : "=m" (v->counter) |
6716 | : "m" (v->counter)); | 6698 | : "m" (v->counter)); |
6717 | @@ -283,7 +560,32 @@ static inline void atomic64_inc(atomic64 | 6699 | @@ -283,7 +540,28 @@ static inline void atomic64_inc(atomic64 |
6718 | */ | 6700 | */ |
6719 | static inline void atomic64_dec(atomic64_t *v) | 6701 | static inline void atomic64_dec(atomic64_t *v) |
6720 | { | 6702 | { |
@@ -6723,13 +6705,9 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6723 | + | 6705 | + |
6724 | +#ifdef CONFIG_PAX_REFCOUNT | 6706 | +#ifdef CONFIG_PAX_REFCOUNT |
6725 | + "jno 0f\n" | 6707 | + "jno 0f\n" |
6726 | + "int $4\n0:\n" | ||
6727 | + ".pushsection .fixup,\"ax\"\n" | ||
6728 | + "1: \n" | ||
6729 | + LOCK_PREFIX "incq %0\n" | 6708 | + LOCK_PREFIX "incq %0\n" |
6730 | + "jmp 0b\n" | 6709 | + "int $4\n0:\n" |
6731 | + ".popsection\n" | 6710 | + _ASM_EXTABLE(0b, 0b) |
6732 | + _ASM_EXTABLE(0b, 1b) | ||
6733 | +#endif | 6711 | +#endif |
6734 | + | 6712 | + |
6735 | + : "=m" (v->counter) | 6713 | + : "=m" (v->counter) |
@@ -6748,7 +6726,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6748 | : "=m" (v->counter) | 6726 | : "=m" (v->counter) |
6749 | : "m" (v->counter)); | 6727 | : "m" (v->counter)); |
6750 | } | 6728 | } |
6751 | @@ -300,7 +602,20 @@ static inline int atomic64_dec_and_test( | 6729 | @@ -300,7 +578,16 @@ static inline int atomic64_dec_and_test( |
6752 | { | 6730 | { |
6753 | unsigned char c; | 6731 | unsigned char c; |
6754 | 6732 | ||
@@ -6757,20 +6735,16 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6757 | + | 6735 | + |
6758 | +#ifdef CONFIG_PAX_REFCOUNT | 6736 | +#ifdef CONFIG_PAX_REFCOUNT |
6759 | + "jno 0f\n" | 6737 | + "jno 0f\n" |
6760 | + "int $4\n0:\n" | ||
6761 | + ".pushsection .fixup,\"ax\"\n" | ||
6762 | + "1: \n" | ||
6763 | + LOCK_PREFIX "incq %0\n" | 6738 | + LOCK_PREFIX "incq %0\n" |
6764 | + "jmp 0b\n" | 6739 | + "int $4\n0:\n" |
6765 | + ".popsection\n" | 6740 | + _ASM_EXTABLE(0b, 0b) |
6766 | + _ASM_EXTABLE(0b, 1b) | ||
6767 | +#endif | 6741 | +#endif |
6768 | + | 6742 | + |
6769 | + "sete %1\n" | 6743 | + "sete %1\n" |
6770 | : "=m" (v->counter), "=qm" (c) | 6744 | : "=m" (v->counter), "=qm" (c) |
6771 | : "m" (v->counter) : "memory"); | 6745 | : "m" (v->counter) : "memory"); |
6772 | return c != 0; | 6746 | return c != 0; |
6773 | @@ -318,7 +633,20 @@ static inline int atomic64_inc_and_test( | 6747 | @@ -318,7 +605,16 @@ static inline int atomic64_inc_and_test( |
6774 | { | 6748 | { |
6775 | unsigned char c; | 6749 | unsigned char c; |
6776 | 6750 | ||
@@ -6779,20 +6753,16 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6779 | + | 6753 | + |
6780 | +#ifdef CONFIG_PAX_REFCOUNT | 6754 | +#ifdef CONFIG_PAX_REFCOUNT |
6781 | + "jno 0f\n" | 6755 | + "jno 0f\n" |
6782 | + "int $4\n0:\n" | ||
6783 | + ".pushsection .fixup,\"ax\"\n" | ||
6784 | + "1: \n" | ||
6785 | + LOCK_PREFIX "decq %0\n" | 6756 | + LOCK_PREFIX "decq %0\n" |
6786 | + "jmp 0b\n" | 6757 | + "int $4\n0:\n" |
6787 | + ".popsection\n" | 6758 | + _ASM_EXTABLE(0b, 0b) |
6788 | + _ASM_EXTABLE(0b, 1b) | ||
6789 | +#endif | 6759 | +#endif |
6790 | + | 6760 | + |
6791 | + "sete %1\n" | 6761 | + "sete %1\n" |
6792 | : "=m" (v->counter), "=qm" (c) | 6762 | : "=m" (v->counter), "=qm" (c) |
6793 | : "m" (v->counter) : "memory"); | 6763 | : "m" (v->counter) : "memory"); |
6794 | return c != 0; | 6764 | return c != 0; |
6795 | @@ -337,7 +665,16 @@ static inline int atomic64_add_negative( | 6765 | @@ -337,7 +633,16 @@ static inline int atomic64_add_negative( |
6796 | { | 6766 | { |
6797 | unsigned char c; | 6767 | unsigned char c; |
6798 | 6768 | ||
@@ -6810,7 +6780,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6810 | : "=m" (v->counter), "=qm" (c) | 6780 | : "=m" (v->counter), "=qm" (c) |
6811 | : "er" (i), "m" (v->counter) : "memory"); | 6781 | : "er" (i), "m" (v->counter) : "memory"); |
6812 | return c; | 6782 | return c; |
6813 | @@ -353,7 +690,31 @@ static inline int atomic64_add_negative( | 6783 | @@ -353,7 +658,31 @@ static inline int atomic64_add_negative( |
6814 | static inline long atomic64_add_return(long i, atomic64_t *v) | 6784 | static inline long atomic64_add_return(long i, atomic64_t *v) |
6815 | { | 6785 | { |
6816 | long __i = i; | 6786 | long __i = i; |
@@ -6843,7 +6813,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6843 | : "+r" (i), "+m" (v->counter) | 6813 | : "+r" (i), "+m" (v->counter) |
6844 | : : "memory"); | 6814 | : : "memory"); |
6845 | return i + __i; | 6815 | return i + __i; |
6846 | @@ -365,6 +726,10 @@ static inline long atomic64_sub_return(l | 6816 | @@ -365,6 +694,10 @@ static inline long atomic64_sub_return(l |
6847 | } | 6817 | } |
6848 | 6818 | ||
6849 | #define atomic64_inc_return(v) (atomic64_add_return(1, (v))) | 6819 | #define atomic64_inc_return(v) (atomic64_add_return(1, (v))) |
@@ -6854,7 +6824,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6854 | #define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) | 6824 | #define atomic64_dec_return(v) (atomic64_sub_return(1, (v))) |
6855 | 6825 | ||
6856 | static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) | 6826 | static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new) |
6857 | @@ -398,17 +763,29 @@ static inline long atomic_xchg(atomic_t | 6827 | @@ -398,17 +731,30 @@ static inline long atomic_xchg(atomic_t |
6858 | */ | 6828 | */ |
6859 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | 6829 | static inline int atomic_add_unless(atomic_t *v, int a, int u) |
6860 | { | 6830 | { |
@@ -6871,6 +6841,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6871 | + | 6841 | + |
6872 | +#ifdef CONFIG_PAX_REFCOUNT | 6842 | +#ifdef CONFIG_PAX_REFCOUNT |
6873 | + "jno 0f\n" | 6843 | + "jno 0f\n" |
6844 | + "subl %2,%0\n" | ||
6874 | + "int $4\n0:\n" | 6845 | + "int $4\n0:\n" |
6875 | + _ASM_EXTABLE(0b, 0b) | 6846 | + _ASM_EXTABLE(0b, 0b) |
6876 | +#endif | 6847 | +#endif |
@@ -6888,7 +6859,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6888 | } | 6859 | } |
6889 | 6860 | ||
6890 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 6861 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
6891 | @@ -424,17 +801,29 @@ static inline int atomic_add_unless(atom | 6862 | @@ -424,17 +770,30 @@ static inline int atomic_add_unless(atom |
6892 | */ | 6863 | */ |
6893 | static inline int atomic64_add_unless(atomic64_t *v, long a, long u) | 6864 | static inline int atomic64_add_unless(atomic64_t *v, long a, long u) |
6894 | { | 6865 | { |
@@ -6905,6 +6876,7 @@ diff -urNp linux-2.6.32.23/arch/x86/include/asm/atomic_64.h linux-2.6.32.23/arch | |||
6905 | + | 6876 | + |
6906 | +#ifdef CONFIG_PAX_REFCOUNT | 6877 | +#ifdef CONFIG_PAX_REFCOUNT |
6907 | + "jno 0f\n" | 6878 | + "jno 0f\n" |
6879 | + "subq %2,%0\n" | ||
6908 | + "int $4\n0:\n" | 6880 | + "int $4\n0:\n" |
6909 | + _ASM_EXTABLE(0b, 0b) | 6881 | + _ASM_EXTABLE(0b, 0b) |
6910 | +#endif | 6882 | +#endif |
@@ -13932,7 +13904,7 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/syscall_table_32.S linux-2.6.32.23/ar | |||
13932 | .long sys_exit | 13904 | .long sys_exit |
13933 | diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c | 13905 | diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c |
13934 | --- linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c 2010-08-13 16:24:37.000000000 -0400 | 13906 | --- linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c 2010-08-13 16:24:37.000000000 -0400 |
13935 | +++ linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c 2010-09-17 18:34:04.000000000 -0400 | 13907 | +++ linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c 2010-09-26 22:08:46.000000000 -0400 |
13936 | @@ -24,6 +24,21 @@ | 13908 | @@ -24,6 +24,21 @@ |
13937 | 13909 | ||
13938 | #include <asm/syscalls.h> | 13910 | #include <asm/syscalls.h> |
@@ -13955,7 +13927,7 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x8 | |||
13955 | /* | 13927 | /* |
13956 | * Perform the select(nd, in, out, ex, tv) and mmap() system | 13928 | * Perform the select(nd, in, out, ex, tv) and mmap() system |
13957 | * calls. Linux/i386 didn't use to be able to handle more than | 13929 | * calls. Linux/i386 didn't use to be able to handle more than |
13958 | @@ -58,6 +73,208 @@ out: | 13930 | @@ -58,6 +73,212 @@ out: |
13959 | return err; | 13931 | return err; |
13960 | } | 13932 | } |
13961 | 13933 | ||
@@ -13972,6 +13944,8 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x8 | |||
13972 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 13944 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
13973 | +#endif | 13945 | +#endif |
13974 | + | 13946 | + |
13947 | + pax_task_size -= PAGE_SIZE; | ||
13948 | + | ||
13975 | + if (len > pax_task_size) | 13949 | + if (len > pax_task_size) |
13976 | + return -ENOMEM; | 13950 | + return -ENOMEM; |
13977 | + | 13951 | + |
@@ -14061,6 +14035,8 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x8 | |||
14061 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 14035 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
14062 | +#endif | 14036 | +#endif |
14063 | + | 14037 | + |
14038 | + pax_task_size -= PAGE_SIZE; | ||
14039 | + | ||
14064 | + /* requested length too big for entire address space */ | 14040 | + /* requested length too big for entire address space */ |
14065 | + if (len > pax_task_size) | 14041 | + if (len > pax_task_size) |
14066 | + return -ENOMEM; | 14042 | + return -ENOMEM; |
@@ -14164,7 +14140,7 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x8 | |||
14164 | 14140 | ||
14165 | struct sel_arg_struct { | 14141 | struct sel_arg_struct { |
14166 | unsigned long n; | 14142 | unsigned long n; |
14167 | @@ -93,7 +310,7 @@ asmlinkage int sys_ipc(uint call, int fi | 14143 | @@ -93,7 +314,7 @@ asmlinkage int sys_ipc(uint call, int fi |
14168 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL); | 14144 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL); |
14169 | case SEMTIMEDOP: | 14145 | case SEMTIMEDOP: |
14170 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, | 14146 | return sys_semtimedop(first, (struct sembuf __user *)ptr, second, |
@@ -14173,7 +14149,7 @@ diff -urNp linux-2.6.32.23/arch/x86/kernel/sys_i386_32.c linux-2.6.32.23/arch/x8 | |||
14173 | 14149 | ||
14174 | case SEMGET: | 14150 | case SEMGET: |
14175 | return sys_semget(first, second, third); | 14151 | return sys_semget(first, second, third); |
14176 | @@ -140,7 +357,7 @@ asmlinkage int sys_ipc(uint call, int fi | 14152 | @@ -140,7 +361,7 @@ asmlinkage int sys_ipc(uint call, int fi |
14177 | ret = do_shmat(first, (char __user *) ptr, second, &raddr); | 14153 | ret = do_shmat(first, (char __user *) ptr, second, &raddr); |
14178 | if (ret) | 14154 | if (ret) |
14179 | return ret; | 14155 | return ret; |
@@ -18270,8 +18246,8 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/highmem_32.c linux-2.6.32.23/arch/x86/mm/ | |||
18270 | } | 18246 | } |
18271 | diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm/hugetlbpage.c | 18247 | diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm/hugetlbpage.c |
18272 | --- linux-2.6.32.23/arch/x86/mm/hugetlbpage.c 2010-08-13 16:24:37.000000000 -0400 | 18248 | --- linux-2.6.32.23/arch/x86/mm/hugetlbpage.c 2010-08-13 16:24:37.000000000 -0400 |
18273 | +++ linux-2.6.32.23/arch/x86/mm/hugetlbpage.c 2010-09-17 18:34:04.000000000 -0400 | 18249 | +++ linux-2.6.32.23/arch/x86/mm/hugetlbpage.c 2010-09-26 22:08:46.000000000 -0400 |
18274 | @@ -267,13 +267,18 @@ static unsigned long hugetlb_get_unmappe | 18250 | @@ -267,13 +267,20 @@ static unsigned long hugetlb_get_unmappe |
18275 | struct hstate *h = hstate_file(file); | 18251 | struct hstate *h = hstate_file(file); |
18276 | struct mm_struct *mm = current->mm; | 18252 | struct mm_struct *mm = current->mm; |
18277 | struct vm_area_struct *vma; | 18253 | struct vm_area_struct *vma; |
@@ -18282,6 +18258,8 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18282 | + if (mm->pax_flags & MF_PAX_SEGMEXEC) | 18258 | + if (mm->pax_flags & MF_PAX_SEGMEXEC) |
18283 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 18259 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
18284 | +#endif | 18260 | +#endif |
18261 | + | ||
18262 | + pax_task_size -= PAGE_SIZE; | ||
18285 | 18263 | ||
18286 | if (len > mm->cached_hole_size) { | 18264 | if (len > mm->cached_hole_size) { |
18287 | - start_addr = mm->free_area_cache; | 18265 | - start_addr = mm->free_area_cache; |
@@ -18294,7 +18272,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18294 | } | 18272 | } |
18295 | 18273 | ||
18296 | full_search: | 18274 | full_search: |
18297 | @@ -281,26 +286,27 @@ full_search: | 18275 | @@ -281,26 +288,27 @@ full_search: |
18298 | 18276 | ||
18299 | for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { | 18277 | for (vma = find_vma(mm, addr); ; vma = vma->vm_next) { |
18300 | /* At this point: (!vma || addr < vma->vm_end). */ | 18278 | /* At this point: (!vma || addr < vma->vm_end). */ |
@@ -18329,7 +18307,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18329 | } | 18307 | } |
18330 | 18308 | ||
18331 | static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, | 18309 | static unsigned long hugetlb_get_unmapped_area_topdown(struct file *file, |
18332 | @@ -309,10 +315,9 @@ static unsigned long hugetlb_get_unmappe | 18310 | @@ -309,10 +317,9 @@ static unsigned long hugetlb_get_unmappe |
18333 | { | 18311 | { |
18334 | struct hstate *h = hstate_file(file); | 18312 | struct hstate *h = hstate_file(file); |
18335 | struct mm_struct *mm = current->mm; | 18313 | struct mm_struct *mm = current->mm; |
@@ -18342,7 +18320,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18342 | 18320 | ||
18343 | /* don't allow allocations above current base */ | 18321 | /* don't allow allocations above current base */ |
18344 | if (mm->free_area_cache > base) | 18322 | if (mm->free_area_cache > base) |
18345 | @@ -322,7 +327,7 @@ static unsigned long hugetlb_get_unmappe | 18323 | @@ -322,7 +329,7 @@ static unsigned long hugetlb_get_unmappe |
18346 | largest_hole = 0; | 18324 | largest_hole = 0; |
18347 | mm->free_area_cache = base; | 18325 | mm->free_area_cache = base; |
18348 | } | 18326 | } |
@@ -18351,7 +18329,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18351 | /* make sure it can fit in the remaining address space */ | 18329 | /* make sure it can fit in the remaining address space */ |
18352 | if (mm->free_area_cache < len) | 18330 | if (mm->free_area_cache < len) |
18353 | goto fail; | 18331 | goto fail; |
18354 | @@ -330,33 +335,27 @@ try_again: | 18332 | @@ -330,33 +337,27 @@ try_again: |
18355 | /* either no address requested or cant fit in requested address hole */ | 18333 | /* either no address requested or cant fit in requested address hole */ |
18356 | addr = (mm->free_area_cache - len) & huge_page_mask(h); | 18334 | addr = (mm->free_area_cache - len) & huge_page_mask(h); |
18357 | do { | 18335 | do { |
@@ -18395,7 +18373,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18395 | 18373 | ||
18396 | /* try just below the current vma->vm_start */ | 18374 | /* try just below the current vma->vm_start */ |
18397 | addr = (vma->vm_start - len) & huge_page_mask(h); | 18375 | addr = (vma->vm_start - len) & huge_page_mask(h); |
18398 | @@ -364,22 +363,26 @@ try_again: | 18376 | @@ -364,22 +365,26 @@ try_again: |
18399 | 18377 | ||
18400 | fail: | 18378 | fail: |
18401 | /* | 18379 | /* |
@@ -18433,7 +18411,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18433 | mm->cached_hole_size = ~0UL; | 18411 | mm->cached_hole_size = ~0UL; |
18434 | addr = hugetlb_get_unmapped_area_bottomup(file, addr0, | 18412 | addr = hugetlb_get_unmapped_area_bottomup(file, addr0, |
18435 | len, pgoff, flags); | 18413 | len, pgoff, flags); |
18436 | @@ -387,6 +390,7 @@ fail: | 18414 | @@ -387,6 +392,7 @@ fail: |
18437 | /* | 18415 | /* |
18438 | * Restore the topdown base: | 18416 | * Restore the topdown base: |
18439 | */ | 18417 | */ |
@@ -18441,7 +18419,7 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18441 | mm->free_area_cache = base; | 18419 | mm->free_area_cache = base; |
18442 | mm->cached_hole_size = ~0UL; | 18420 | mm->cached_hole_size = ~0UL; |
18443 | 18421 | ||
18444 | @@ -400,10 +404,17 @@ hugetlb_get_unmapped_area(struct file *f | 18422 | @@ -400,10 +406,19 @@ hugetlb_get_unmapped_area(struct file *f |
18445 | struct hstate *h = hstate_file(file); | 18423 | struct hstate *h = hstate_file(file); |
18446 | struct mm_struct *mm = current->mm; | 18424 | struct mm_struct *mm = current->mm; |
18447 | struct vm_area_struct *vma; | 18425 | struct vm_area_struct *vma; |
@@ -18456,11 +18434,13 @@ diff -urNp linux-2.6.32.23/arch/x86/mm/hugetlbpage.c linux-2.6.32.23/arch/x86/mm | |||
18456 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 18434 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
18457 | +#endif | 18435 | +#endif |
18458 | + | 18436 | + |
18437 | + pax_task_size -= PAGE_SIZE; | ||
18438 | + | ||
18459 | + if (len > pax_task_size) | 18439 | + if (len > pax_task_size) |
18460 | return -ENOMEM; | 18440 | return -ENOMEM; |
18461 | 18441 | ||
18462 | if (flags & MAP_FIXED) { | 18442 | if (flags & MAP_FIXED) { |
18463 | @@ -415,8 +426,7 @@ hugetlb_get_unmapped_area(struct file *f | 18443 | @@ -415,8 +430,7 @@ hugetlb_get_unmapped_area(struct file *f |
18464 | if (addr) { | 18444 | if (addr) { |
18465 | addr = ALIGN(addr, huge_page_size(h)); | 18445 | addr = ALIGN(addr, huge_page_size(h)); |
18466 | vma = find_vma(mm, addr); | 18446 | vma = find_vma(mm, addr); |
@@ -23722,7 +23702,7 @@ diff -urNp linux-2.6.32.23/drivers/base/sys.c linux-2.6.32.23/drivers/base/sys.c | |||
23722 | }; | 23702 | }; |
23723 | diff -urNp linux-2.6.32.23/drivers/block/pktcdvd.c linux-2.6.32.23/drivers/block/pktcdvd.c | 23703 | diff -urNp linux-2.6.32.23/drivers/block/pktcdvd.c linux-2.6.32.23/drivers/block/pktcdvd.c |
23724 | --- linux-2.6.32.23/drivers/block/pktcdvd.c 2010-08-13 16:24:37.000000000 -0400 | 23704 | --- linux-2.6.32.23/drivers/block/pktcdvd.c 2010-08-13 16:24:37.000000000 -0400 |
23725 | +++ linux-2.6.32.23/drivers/block/pktcdvd.c 2010-09-04 15:54:52.000000000 -0400 | 23705 | +++ linux-2.6.32.23/drivers/block/pktcdvd.c 2010-09-27 18:49:22.000000000 -0400 |
23726 | @@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kob | 23706 | @@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kob |
23727 | return len; | 23707 | return len; |
23728 | } | 23708 | } |
@@ -23732,6 +23712,15 @@ diff -urNp linux-2.6.32.23/drivers/block/pktcdvd.c linux-2.6.32.23/drivers/block | |||
23732 | .show = kobj_pkt_show, | 23712 | .show = kobj_pkt_show, |
23733 | .store = kobj_pkt_store | 23713 | .store = kobj_pkt_store |
23734 | }; | 23714 | }; |
23715 | @@ -2408,7 +2408,7 @@ static void pkt_release_dev(struct pktcd | ||
23716 | pkt_shrink_pktlist(pd); | ||
23717 | } | ||
23718 | |||
23719 | -static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor) | ||
23720 | +static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor) | ||
23721 | { | ||
23722 | if (dev_minor >= MAX_WRITERS) | ||
23723 | return NULL; | ||
23735 | diff -urNp linux-2.6.32.23/drivers/char/agp/frontend.c linux-2.6.32.23/drivers/char/agp/frontend.c | 23724 | diff -urNp linux-2.6.32.23/drivers/char/agp/frontend.c linux-2.6.32.23/drivers/char/agp/frontend.c |
23736 | --- linux-2.6.32.23/drivers/char/agp/frontend.c 2010-08-13 16:24:37.000000000 -0400 | 23725 | --- linux-2.6.32.23/drivers/char/agp/frontend.c 2010-08-13 16:24:37.000000000 -0400 |
23737 | +++ linux-2.6.32.23/drivers/char/agp/frontend.c 2010-09-04 15:54:52.000000000 -0400 | 23726 | +++ linux-2.6.32.23/drivers/char/agp/frontend.c 2010-09-04 15:54:52.000000000 -0400 |
@@ -30133,63 +30122,16 @@ diff -urNp linux-2.6.32.23/drivers/video/vesafb.c linux-2.6.32.23/drivers/video/ | |||
30133 | framebuffer_release(info); | 30122 | framebuffer_release(info); |
30134 | diff -urNp linux-2.6.32.23/drivers/xen/events.c linux-2.6.32.23/drivers/xen/events.c | 30123 | diff -urNp linux-2.6.32.23/drivers/xen/events.c linux-2.6.32.23/drivers/xen/events.c |
30135 | --- linux-2.6.32.23/drivers/xen/events.c 2010-09-20 17:26:42.000000000 -0400 | 30124 | --- linux-2.6.32.23/drivers/xen/events.c 2010-09-20 17:26:42.000000000 -0400 |
30136 | +++ linux-2.6.32.23/drivers/xen/events.c 2010-09-21 21:18:38.000000000 -0400 | 30125 | +++ linux-2.6.32.23/drivers/xen/events.c 2010-09-26 21:25:12.000000000 -0400 |
30137 | @@ -106,7 +106,6 @@ static inline unsigned long *cpu_evtchn_ | 30126 | @@ -930,7 +930,7 @@ static struct irq_chip xen_dynamic_chip |
30138 | #define VALID_EVTCHN(chn) ((chn) != 0) | ||
30139 | |||
30140 | static struct irq_chip xen_dynamic_chip; | ||
30141 | -static struct irq_chip xen_percpu_chip; | ||
30142 | |||
30143 | /* Constructor for packed IRQ information. */ | ||
30144 | static struct irq_info mk_unbound_info(void) | ||
30145 | @@ -363,7 +362,7 @@ int bind_evtchn_to_irq(unsigned int evtc | ||
30146 | irq = find_unbound_irq(); | ||
30147 | |||
30148 | set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | ||
30149 | - handle_edge_irq, "event"); | ||
30150 | + handle_level_irq, "event"); | ||
30151 | |||
30152 | evtchn_to_irq[evtchn] = irq; | ||
30153 | irq_info[irq] = mk_evtchn_info(evtchn); | ||
30154 | @@ -389,8 +388,8 @@ static int bind_ipi_to_irq(unsigned int | ||
30155 | if (irq < 0) | ||
30156 | goto out; | ||
30157 | |||
30158 | - set_irq_chip_and_handler_name(irq, &xen_percpu_chip, | ||
30159 | - handle_percpu_irq, "ipi"); | ||
30160 | + set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | ||
30161 | + handle_level_irq, "ipi"); | ||
30162 | |||
30163 | bind_ipi.vcpu = cpu; | ||
30164 | if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, | ||
30165 | @@ -430,8 +429,8 @@ static int bind_virq_to_irq(unsigned int | ||
30166 | |||
30167 | irq = find_unbound_irq(); | ||
30168 | |||
30169 | - set_irq_chip_and_handler_name(irq, &xen_percpu_chip, | ||
30170 | - handle_percpu_irq, "virq"); | ||
30171 | + set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | ||
30172 | + handle_level_irq, "virq"); | ||
30173 | |||
30174 | evtchn_to_irq[evtchn] = irq; | ||
30175 | irq_info[irq] = mk_virq_info(evtchn, virq); | ||
30176 | @@ -930,16 +929,6 @@ static struct irq_chip xen_dynamic_chip | ||
30177 | .retrigger = retrigger_dynirq, | 30127 | .retrigger = retrigger_dynirq, |
30178 | }; | 30128 | }; |
30179 | 30129 | ||
30180 | -static struct irq_chip en_percpu_chip __read_mostly = { | 30130 | -static struct irq_chip en_percpu_chip __read_mostly = { |
30181 | - .name = "xen-percpu", | 30131 | +static struct irq_chip xen_percpu_chip __read_mostly = { |
30182 | - | 30132 | .name = "xen-percpu", |
30183 | - .disable = disable_dynirq, | 30133 | |
30184 | - .mask = disable_dynirq, | 30134 | .disable = disable_dynirq, |
30185 | - .unmask = enable_dynirq, | ||
30186 | - | ||
30187 | - .ack = ack_dynirq, | ||
30188 | -}; | ||
30189 | - | ||
30190 | void __init xen_init_IRQ(void) | ||
30191 | { | ||
30192 | int i; | ||
30193 | diff -urNp linux-2.6.32.23/drivers/xen/sys-hypervisor.c linux-2.6.32.23/drivers/xen/sys-hypervisor.c | 30135 | diff -urNp linux-2.6.32.23/drivers/xen/sys-hypervisor.c linux-2.6.32.23/drivers/xen/sys-hypervisor.c |
30194 | --- linux-2.6.32.23/drivers/xen/sys-hypervisor.c 2010-08-13 16:24:37.000000000 -0400 | 30136 | --- linux-2.6.32.23/drivers/xen/sys-hypervisor.c 2010-08-13 16:24:37.000000000 -0400 |
30195 | +++ linux-2.6.32.23/drivers/xen/sys-hypervisor.c 2010-09-04 15:54:52.000000000 -0400 | 30137 | +++ linux-2.6.32.23/drivers/xen/sys-hypervisor.c 2010-09-04 15:54:52.000000000 -0400 |
@@ -48623,7 +48565,7 @@ diff -urNp linux-2.6.32.23/include/linux/vmalloc.h linux-2.6.32.23/include/linux | |||
48623 | #endif /* _LINUX_VMALLOC_H */ | 48565 | #endif /* _LINUX_VMALLOC_H */ |
48624 | diff -urNp linux-2.6.32.23/include/linux/vmstat.h linux-2.6.32.23/include/linux/vmstat.h | 48566 | diff -urNp linux-2.6.32.23/include/linux/vmstat.h linux-2.6.32.23/include/linux/vmstat.h |
48625 | --- linux-2.6.32.23/include/linux/vmstat.h 2010-09-26 17:26:05.000000000 -0400 | 48567 | --- linux-2.6.32.23/include/linux/vmstat.h 2010-09-26 17:26:05.000000000 -0400 |
48626 | +++ linux-2.6.32.23/include/linux/vmstat.h 2010-09-26 17:26:57.000000000 -0400 | 48568 | +++ linux-2.6.32.23/include/linux/vmstat.h 2010-09-26 22:01:38.000000000 -0400 |
48627 | @@ -136,18 +136,18 @@ static inline void vm_events_fold_cpu(in | 48569 | @@ -136,18 +136,18 @@ static inline void vm_events_fold_cpu(in |
48628 | /* | 48570 | /* |
48629 | * Zone based page accounting with per cpu differentials. | 48571 | * Zone based page accounting with per cpu differentials. |
@@ -48656,6 +48598,15 @@ diff -urNp linux-2.6.32.23/include/linux/vmstat.h linux-2.6.32.23/include/linux/ | |||
48656 | #ifdef CONFIG_SMP | 48598 | #ifdef CONFIG_SMP |
48657 | if (x < 0) | 48599 | if (x < 0) |
48658 | x = 0; | 48600 | x = 0; |
48601 | @@ -175,7 +175,7 @@ static inline unsigned long zone_page_st | ||
48602 | static inline unsigned long zone_page_state_snapshot(struct zone *zone, | ||
48603 | enum zone_stat_item item) | ||
48604 | { | ||
48605 | - long x = atomic_long_read(&zone->vm_stat[item]); | ||
48606 | + long x = atomic_long_read_unchecked(&zone->vm_stat[item]); | ||
48607 | |||
48608 | #ifdef CONFIG_SMP | ||
48609 | int cpu; | ||
48659 | @@ -264,8 +264,8 @@ static inline void __mod_zone_page_state | 48610 | @@ -264,8 +264,8 @@ static inline void __mod_zone_page_state |
48660 | 48611 | ||
48661 | static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) | 48612 | static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) |
@@ -54380,7 +54331,7 @@ diff -urNp linux-2.6.32.23/mm/mprotect.c linux-2.6.32.23/mm/mprotect.c | |||
54380 | if (nstart < prev->vm_end) | 54331 | if (nstart < prev->vm_end) |
54381 | diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | 54332 | diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c |
54382 | --- linux-2.6.32.23/mm/mremap.c 2010-08-13 16:24:37.000000000 -0400 | 54333 | --- linux-2.6.32.23/mm/mremap.c 2010-08-13 16:24:37.000000000 -0400 |
54383 | +++ linux-2.6.32.23/mm/mremap.c 2010-09-04 15:54:52.000000000 -0400 | 54334 | +++ linux-2.6.32.23/mm/mremap.c 2010-09-26 22:08:46.000000000 -0400 |
54384 | @@ -114,6 +114,12 @@ static void move_ptes(struct vm_area_str | 54335 | @@ -114,6 +114,12 @@ static void move_ptes(struct vm_area_str |
54385 | continue; | 54336 | continue; |
54386 | pte = ptep_clear_flush(vma, old_addr, old_pte); | 54337 | pte = ptep_clear_flush(vma, old_addr, old_pte); |
@@ -54406,7 +54357,7 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54406 | /* We can't remap across vm area boundaries */ | 54357 | /* We can't remap across vm area boundaries */ |
54407 | if (old_len > vma->vm_end - addr) | 54358 | if (old_len > vma->vm_end - addr) |
54408 | goto Efault; | 54359 | goto Efault; |
54409 | @@ -322,20 +333,23 @@ static unsigned long mremap_to(unsigned | 54360 | @@ -322,20 +333,25 @@ static unsigned long mremap_to(unsigned |
54410 | unsigned long ret = -EINVAL; | 54361 | unsigned long ret = -EINVAL; |
54411 | unsigned long charged = 0; | 54362 | unsigned long charged = 0; |
54412 | unsigned long map_flags; | 54363 | unsigned long map_flags; |
@@ -54421,6 +54372,8 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54421 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 54372 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
54422 | +#endif | 54373 | +#endif |
54423 | + | 54374 | + |
54375 | + pax_task_size -= PAGE_SIZE; | ||
54376 | + | ||
54424 | + if (new_len > TASK_SIZE || new_addr > pax_task_size - new_len) | 54377 | + if (new_len > TASK_SIZE || new_addr > pax_task_size - new_len) |
54425 | goto out; | 54378 | goto out; |
54426 | 54379 | ||
@@ -54435,7 +54388,7 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54435 | goto out; | 54388 | goto out; |
54436 | 54389 | ||
54437 | ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); | 54390 | ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); |
54438 | @@ -407,6 +421,7 @@ unsigned long do_mremap(unsigned long ad | 54391 | @@ -407,6 +423,7 @@ unsigned long do_mremap(unsigned long ad |
54439 | struct vm_area_struct *vma; | 54392 | struct vm_area_struct *vma; |
54440 | unsigned long ret = -EINVAL; | 54393 | unsigned long ret = -EINVAL; |
54441 | unsigned long charged = 0; | 54394 | unsigned long charged = 0; |
@@ -54443,7 +54396,7 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54443 | 54396 | ||
54444 | if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE)) | 54397 | if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE)) |
54445 | goto out; | 54398 | goto out; |
54446 | @@ -425,6 +440,15 @@ unsigned long do_mremap(unsigned long ad | 54399 | @@ -425,6 +442,17 @@ unsigned long do_mremap(unsigned long ad |
54447 | if (!new_len) | 54400 | if (!new_len) |
54448 | goto out; | 54401 | goto out; |
54449 | 54402 | ||
@@ -54452,6 +54405,8 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54452 | + pax_task_size = SEGMEXEC_TASK_SIZE; | 54405 | + pax_task_size = SEGMEXEC_TASK_SIZE; |
54453 | +#endif | 54406 | +#endif |
54454 | + | 54407 | + |
54408 | + pax_task_size -= PAGE_SIZE; | ||
54409 | + | ||
54455 | + if (new_len > pax_task_size || addr > pax_task_size-new_len || | 54410 | + if (new_len > pax_task_size || addr > pax_task_size-new_len || |
54456 | + old_len > pax_task_size || addr > pax_task_size-old_len) | 54411 | + old_len > pax_task_size || addr > pax_task_size-old_len) |
54457 | + goto out; | 54412 | + goto out; |
@@ -54459,7 +54414,7 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54459 | if (flags & MREMAP_FIXED) { | 54414 | if (flags & MREMAP_FIXED) { |
54460 | if (flags & MREMAP_MAYMOVE) | 54415 | if (flags & MREMAP_MAYMOVE) |
54461 | ret = mremap_to(addr, old_len, new_addr, new_len); | 54416 | ret = mremap_to(addr, old_len, new_addr, new_len); |
54462 | @@ -471,6 +495,7 @@ unsigned long do_mremap(unsigned long ad | 54417 | @@ -471,6 +499,7 @@ unsigned long do_mremap(unsigned long ad |
54463 | addr + new_len); | 54418 | addr + new_len); |
54464 | } | 54419 | } |
54465 | ret = addr; | 54420 | ret = addr; |
@@ -54467,7 +54422,7 @@ diff -urNp linux-2.6.32.23/mm/mremap.c linux-2.6.32.23/mm/mremap.c | |||
54467 | goto out; | 54422 | goto out; |
54468 | } | 54423 | } |
54469 | } | 54424 | } |
54470 | @@ -497,7 +522,13 @@ unsigned long do_mremap(unsigned long ad | 54425 | @@ -497,7 +526,13 @@ unsigned long do_mremap(unsigned long ad |
54471 | ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); | 54426 | ret = security_file_mmap(NULL, 0, 0, 0, new_addr, 1); |
54472 | if (ret) | 54427 | if (ret) |
54473 | goto out; | 54428 | goto out; |
@@ -58356,7 +58311,7 @@ diff -urNp linux-2.6.32.23/usr/gen_init_cpio.c linux-2.6.32.23/usr/gen_init_cpio | |||
58356 | } | 58311 | } |
58357 | diff -urNp linux-2.6.32.23/virt/kvm/kvm_main.c linux-2.6.32.23/virt/kvm/kvm_main.c | 58312 | diff -urNp linux-2.6.32.23/virt/kvm/kvm_main.c linux-2.6.32.23/virt/kvm/kvm_main.c |
58358 | --- linux-2.6.32.23/virt/kvm/kvm_main.c 2010-08-13 16:24:37.000000000 -0400 | 58313 | --- linux-2.6.32.23/virt/kvm/kvm_main.c 2010-08-13 16:24:37.000000000 -0400 |
58359 | +++ linux-2.6.32.23/virt/kvm/kvm_main.c 2010-09-04 15:54:52.000000000 -0400 | 58314 | +++ linux-2.6.32.23/virt/kvm/kvm_main.c 2010-09-26 22:08:46.000000000 -0400 |
58360 | @@ -1748,6 +1748,7 @@ static int kvm_vcpu_release(struct inode | 58315 | @@ -1748,6 +1748,7 @@ static int kvm_vcpu_release(struct inode |
58361 | return 0; | 58316 | return 0; |
58362 | } | 58317 | } |
@@ -58391,6 +58346,15 @@ diff -urNp linux-2.6.32.23/virt/kvm/kvm_main.c linux-2.6.32.23/virt/kvm/kvm_main | |||
58391 | }; | 58346 | }; |
58392 | 58347 | ||
58393 | static void hardware_enable(void *junk) | 58348 | static void hardware_enable(void *junk) |
58349 | @@ -2494,7 +2500,7 @@ asmlinkage void kvm_handle_fault_on_rebo | ||
58350 | if (kvm_rebooting) | ||
58351 | /* spin while reset goes on */ | ||
58352 | while (true) | ||
58353 | - ; | ||
58354 | + cpu_relax(); | ||
58355 | /* Fault while not rebooting. We want the trace. */ | ||
58356 | BUG(); | ||
58357 | } | ||
58394 | @@ -2714,7 +2720,7 @@ static void kvm_sched_out(struct preempt | 58358 | @@ -2714,7 +2720,7 @@ static void kvm_sched_out(struct preempt |
58395 | kvm_arch_vcpu_put(vcpu); | 58359 | kvm_arch_vcpu_put(vcpu); |
58396 | } | 58360 | } |