diff options
author | 2011-08-09 10:32:28 -0400 | |
---|---|---|
committer | 2011-08-09 10:32:28 -0400 | |
commit | 8383e42188da954f0e017085040d38fb3e3f6dfb (patch) | |
tree | b809f8eead71a446a149ddc20ef2a6822ecf291b | |
parent | Update Grsec/PaX (diff) | |
download | hardened-patchset-8383e42188da954f0e017085040d38fb3e3f6dfb.tar.gz hardened-patchset-8383e42188da954f0e017085040d38fb3e3f6dfb.tar.bz2 hardened-patchset-8383e42188da954f0e017085040d38fb3e3f6dfb.zip |
Grsec/PaX 2.2.2-2.6.32.43-201108071948 + 2.2.2-2.6.39.4-20110807143820110807
-rw-r--r-- | 2.6.32/0000_README | 2 | ||||
-rw-r--r-- | 2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108071948.patch (renamed from 2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108060941.patch) | 1016 | ||||
-rw-r--r-- | 2.6.39/0000_README | 2 | ||||
-rw-r--r-- | 2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108071438.patch (renamed from 2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108060941.patch) | 6 |
4 files changed, 980 insertions, 46 deletions
diff --git a/2.6.32/0000_README b/2.6.32/0000_README index 73494c9..8ba09fe 100644 --- a/2.6.32/0000_README +++ b/2.6.32/0000_README @@ -3,7 +3,7 @@ README Individual Patch Descriptions: ----------------------------------------------------------------------------- -Patch: 4420_grsecurity-2.2.2-2.6.32.43-201108060941.patch +Patch: 4420_grsecurity-2.2.2-2.6.32.43-201108071948.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity diff --git a/2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108060941.patch b/2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108071948.patch index 55e855b..04d1ce4 100644 --- a/2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108060941.patch +++ b/2.6.32/4420_grsecurity-2.2.2-2.6.32.43-201108071948.patch @@ -6228,12 +6228,14 @@ diff -urNp linux-2.6.32.43/arch/x86/boot/compressed/head_64.S linux-2.6.32.43/ar /* Target address to relocate to for decompression */ diff -urNp linux-2.6.32.43/arch/x86/boot/compressed/Makefile linux-2.6.32.43/arch/x86/boot/compressed/Makefile --- linux-2.6.32.43/arch/x86/boot/compressed/Makefile 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/arch/x86/boot/compressed/Makefile 2011-08-05 20:33:55.000000000 -0400 -@@ -13,6 +13,7 @@ cflags-$(CONFIG_X86_64) := -mcmodel=smal ++++ linux-2.6.32.43/arch/x86/boot/compressed/Makefile 2011-08-07 14:38:34.000000000 -0400 +@@ -13,6 +13,9 @@ cflags-$(CONFIG_X86_64) := -mcmodel=smal KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += $(call cc-option,-ffreestanding) KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) ++ifdef CONSTIFY_PLUGIN +KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++endif KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n @@ -6585,12 +6587,14 @@ diff -urNp linux-2.6.32.43/arch/x86/boot/header.S linux-2.6.32.43/arch/x86/boot/ #define VO_INIT_SIZE (VO__end - VO__text) diff -urNp linux-2.6.32.43/arch/x86/boot/Makefile linux-2.6.32.43/arch/x86/boot/Makefile --- linux-2.6.32.43/arch/x86/boot/Makefile 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/arch/x86/boot/Makefile 2011-08-05 20:33:55.000000000 -0400 -@@ -69,6 +69,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os ++++ linux-2.6.32.43/arch/x86/boot/Makefile 2011-08-07 14:38:13.000000000 -0400 +@@ -69,6 +69,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os $(call cc-option, -fno-stack-protector) \ $(call cc-option, -mpreferred-stack-boundary=2) KBUILD_CFLAGS += $(call cc-option, -m32) ++ifdef CONSTIFY_PLUGIN +KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++endif KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n @@ -11602,12 +11606,14 @@ diff -urNp linux-2.6.32.43/arch/x86/Kconfig.debug linux-2.6.32.43/arch/x86/Kconf in order to catch accidental (and incorrect) writes to such const diff -urNp linux-2.6.32.43/arch/x86/kernel/acpi/realmode/Makefile linux-2.6.32.43/arch/x86/kernel/acpi/realmode/Makefile --- linux-2.6.32.43/arch/x86/kernel/acpi/realmode/Makefile 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/arch/x86/kernel/acpi/realmode/Makefile 2011-08-05 20:33:55.000000000 -0400 -@@ -41,6 +41,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os ++++ linux-2.6.32.43/arch/x86/kernel/acpi/realmode/Makefile 2011-08-07 14:38:58.000000000 -0400 +@@ -41,6 +41,9 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os $(call cc-option, -fno-stack-protector) \ $(call cc-option, -mpreferred-stack-boundary=2) KBUILD_CFLAGS += $(call cc-option, -m32) ++ifdef CONSTIFY_PLUGIN +KBUILD_CFLAGS += $(CONSTIFY_PLUGIN) -fplugin-arg-constify_plugin-no-constify ++endif KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n @@ -24024,6 +24030,121 @@ diff -urNp linux-2.6.32.43/crypto/gf128mul.c linux-2.6.32.43/crypto/gf128mul.c for (i = 0;;) { u8 ch = ((u8 *)b)[i]; +diff -urNp linux-2.6.32.43/crypto/md5.c linux-2.6.32.43/crypto/md5.c +--- linux-2.6.32.43/crypto/md5.c 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/crypto/md5.c 2011-08-07 19:48:09.000000000 -0400 +@@ -20,6 +20,7 @@ + #include <linux/module.h> + #include <linux/string.h> + #include <linux/types.h> ++#include <linux/cryptohash.h> + #include <asm/byteorder.h> + + #define MD5_DIGEST_SIZE 16 +@@ -27,103 +28,12 @@ + #define MD5_BLOCK_WORDS 16 + #define MD5_HASH_WORDS 4 + +-#define F1(x, y, z) (z ^ (x & (y ^ z))) +-#define F2(x, y, z) F1(z, x, y) +-#define F3(x, y, z) (x ^ y ^ z) +-#define F4(x, y, z) (y ^ (x | ~z)) +- +-#define MD5STEP(f, w, x, y, z, in, s) \ +- (w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x) +- + struct md5_ctx { + u32 hash[MD5_HASH_WORDS]; + u32 block[MD5_BLOCK_WORDS]; + u64 byte_count; + }; + +-static void md5_transform(u32 *hash, u32 const *in) +-{ +- u32 a, b, c, d; +- +- a = hash[0]; +- b = hash[1]; +- c = hash[2]; +- d = hash[3]; +- +- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); +- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); +- MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); +- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); +- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); +- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); +- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); +- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); +- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); +- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); +- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); +- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); +- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); +- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); +- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); +- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); +- +- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); +- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); +- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); +- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); +- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); +- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); +- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); +- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); +- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); +- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); +- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); +- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); +- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); +- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); +- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); +- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); +- +- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); +- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); +- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); +- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); +- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); +- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); +- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); +- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); +- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); +- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); +- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); +- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); +- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); +- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); +- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); +- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); +- +- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); +- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); +- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); +- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); +- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); +- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); +- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); +- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); +- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); +- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); +- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); +- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); +- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); +- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); +- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); +- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); +- +- hash[0] += a; +- hash[1] += b; +- hash[2] += c; +- hash[3] += d; +-} +- + /* XXX: this stuff can be optimized */ + static inline void le32_to_cpu_array(u32 *buf, unsigned int words) + { diff -urNp linux-2.6.32.43/crypto/serpent.c linux-2.6.32.43/crypto/serpent.c --- linux-2.6.32.43/crypto/serpent.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/crypto/serpent.c 2011-05-16 21:46:57.000000000 -0400 @@ -28127,7 +28248,7 @@ diff -urNp linux-2.6.32.43/drivers/char/pty.c linux-2.6.32.43/drivers/char/pty.c if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || diff -urNp linux-2.6.32.43/drivers/char/random.c linux-2.6.32.43/drivers/char/random.c --- linux-2.6.32.43/drivers/char/random.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/drivers/char/random.c 2011-04-17 15:56:46.000000000 -0400 ++++ linux-2.6.32.43/drivers/char/random.c 2011-08-07 19:48:09.000000000 -0400 @@ -254,8 +254,13 @@ /* * Configuration information @@ -28169,6 +28290,363 @@ diff -urNp linux-2.6.32.43/drivers/char/random.c linux-2.6.32.43/drivers/char/ra static int max_write_thresh = INPUT_POOL_WORDS * 32; static char sysctl_bootid[16]; +@@ -1339,330 +1351,14 @@ ctl_table random_table[] = { + }; + #endif /* CONFIG_SYSCTL */ + +-/******************************************************************** +- * +- * Random funtions for networking +- * +- ********************************************************************/ +- +-/* +- * TCP initial sequence number picking. This uses the random number +- * generator to pick an initial secret value. This value is hashed +- * along with the TCP endpoint information to provide a unique +- * starting point for each pair of TCP endpoints. This defeats +- * attacks which rely on guessing the initial TCP sequence number. +- * This algorithm was suggested by Steve Bellovin. +- * +- * Using a very strong hash was taking an appreciable amount of the total +- * TCP connection establishment time, so this is a weaker hash, +- * compensated for by changing the secret periodically. +- */ +- +-/* F, G and H are basic MD4 functions: selection, majority, parity */ +-#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) +-#define G(x, y, z) (((x) & (y)) + (((x) ^ (y)) & (z))) +-#define H(x, y, z) ((x) ^ (y) ^ (z)) +- +-/* +- * The generic round function. The application is so specific that +- * we don't bother protecting all the arguments with parens, as is generally +- * good macro practice, in favor of extra legibility. +- * Rotation is separate from addition to prevent recomputation +- */ +-#define ROUND(f, a, b, c, d, x, s) \ +- (a += f(b, c, d) + x, a = (a << s) | (a >> (32 - s))) +-#define K1 0 +-#define K2 013240474631UL +-#define K3 015666365641UL +- +-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +- +-static __u32 twothirdsMD4Transform(__u32 const buf[4], __u32 const in[12]) +-{ +- __u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; +- +- /* Round 1 */ +- ROUND(F, a, b, c, d, in[ 0] + K1, 3); +- ROUND(F, d, a, b, c, in[ 1] + K1, 7); +- ROUND(F, c, d, a, b, in[ 2] + K1, 11); +- ROUND(F, b, c, d, a, in[ 3] + K1, 19); +- ROUND(F, a, b, c, d, in[ 4] + K1, 3); +- ROUND(F, d, a, b, c, in[ 5] + K1, 7); +- ROUND(F, c, d, a, b, in[ 6] + K1, 11); +- ROUND(F, b, c, d, a, in[ 7] + K1, 19); +- ROUND(F, a, b, c, d, in[ 8] + K1, 3); +- ROUND(F, d, a, b, c, in[ 9] + K1, 7); +- ROUND(F, c, d, a, b, in[10] + K1, 11); +- ROUND(F, b, c, d, a, in[11] + K1, 19); +- +- /* Round 2 */ +- ROUND(G, a, b, c, d, in[ 1] + K2, 3); +- ROUND(G, d, a, b, c, in[ 3] + K2, 5); +- ROUND(G, c, d, a, b, in[ 5] + K2, 9); +- ROUND(G, b, c, d, a, in[ 7] + K2, 13); +- ROUND(G, a, b, c, d, in[ 9] + K2, 3); +- ROUND(G, d, a, b, c, in[11] + K2, 5); +- ROUND(G, c, d, a, b, in[ 0] + K2, 9); +- ROUND(G, b, c, d, a, in[ 2] + K2, 13); +- ROUND(G, a, b, c, d, in[ 4] + K2, 3); +- ROUND(G, d, a, b, c, in[ 6] + K2, 5); +- ROUND(G, c, d, a, b, in[ 8] + K2, 9); +- ROUND(G, b, c, d, a, in[10] + K2, 13); +- +- /* Round 3 */ +- ROUND(H, a, b, c, d, in[ 3] + K3, 3); +- ROUND(H, d, a, b, c, in[ 7] + K3, 9); +- ROUND(H, c, d, a, b, in[11] + K3, 11); +- ROUND(H, b, c, d, a, in[ 2] + K3, 15); +- ROUND(H, a, b, c, d, in[ 6] + K3, 3); +- ROUND(H, d, a, b, c, in[10] + K3, 9); +- ROUND(H, c, d, a, b, in[ 1] + K3, 11); +- ROUND(H, b, c, d, a, in[ 5] + K3, 15); +- ROUND(H, a, b, c, d, in[ 9] + K3, 3); +- ROUND(H, d, a, b, c, in[ 0] + K3, 9); +- ROUND(H, c, d, a, b, in[ 4] + K3, 11); +- ROUND(H, b, c, d, a, in[ 8] + K3, 15); +- +- return buf[1] + b; /* "most hashed" word */ +- /* Alternative: return sum of all words? */ +-} +-#endif +- +-#undef ROUND +-#undef F +-#undef G +-#undef H +-#undef K1 +-#undef K2 +-#undef K3 +- +-/* This should not be decreased so low that ISNs wrap too fast. */ +-#define REKEY_INTERVAL (300 * HZ) +-/* +- * Bit layout of the tcp sequence numbers (before adding current time): +- * bit 24-31: increased after every key exchange +- * bit 0-23: hash(source,dest) +- * +- * The implementation is similar to the algorithm described +- * in the Appendix of RFC 1185, except that +- * - it uses a 1 MHz clock instead of a 250 kHz clock +- * - it performs a rekey every 5 minutes, which is equivalent +- * to a (source,dest) tulple dependent forward jump of the +- * clock by 0..2^(HASH_BITS+1) +- * +- * Thus the average ISN wraparound time is 68 minutes instead of +- * 4.55 hours. +- * +- * SMP cleanup and lock avoidance with poor man's RCU. +- * Manfred Spraul <manfred@colorfullife.com> +- * +- */ +-#define COUNT_BITS 8 +-#define COUNT_MASK ((1 << COUNT_BITS) - 1) +-#define HASH_BITS 24 +-#define HASH_MASK ((1 << HASH_BITS) - 1) +- +-static struct keydata { +- __u32 count; /* already shifted to the final position */ +- __u32 secret[12]; +-} ____cacheline_aligned ip_keydata[2]; +- +-static unsigned int ip_cnt; +- +-static void rekey_seq_generator(struct work_struct *work); +- +-static DECLARE_DELAYED_WORK(rekey_work, rekey_seq_generator); +- +-/* +- * Lock avoidance: +- * The ISN generation runs lockless - it's just a hash over random data. +- * State changes happen every 5 minutes when the random key is replaced. +- * Synchronization is performed by having two copies of the hash function +- * state and rekey_seq_generator always updates the inactive copy. +- * The copy is then activated by updating ip_cnt. +- * The implementation breaks down if someone blocks the thread +- * that processes SYN requests for more than 5 minutes. Should never +- * happen, and even if that happens only a not perfectly compliant +- * ISN is generated, nothing fatal. +- */ +-static void rekey_seq_generator(struct work_struct *work) +-{ +- struct keydata *keyptr = &ip_keydata[1 ^ (ip_cnt & 1)]; +- +- get_random_bytes(keyptr->secret, sizeof(keyptr->secret)); +- keyptr->count = (ip_cnt & COUNT_MASK) << HASH_BITS; +- smp_wmb(); +- ip_cnt++; +- schedule_delayed_work(&rekey_work, +- round_jiffies_relative(REKEY_INTERVAL)); +-} +- +-static inline struct keydata *get_keyptr(void) +-{ +- struct keydata *keyptr = &ip_keydata[ip_cnt & 1]; +- +- smp_rmb(); +- +- return keyptr; +-} +- +-static __init int seqgen_init(void) ++static u32 random_int_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; ++static int __init random_int_secret_init(void) + { +- rekey_seq_generator(NULL); ++ get_random_bytes(random_int_secret, sizeof(random_int_secret)); + return 0; + } +-late_initcall(seqgen_init); +- +-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +-__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, +- __be16 sport, __be16 dport) +-{ +- __u32 seq; +- __u32 hash[12]; +- struct keydata *keyptr = get_keyptr(); +- +- /* The procedure is the same as for IPv4, but addresses are longer. +- * Thus we must use twothirdsMD4Transform. +- */ +- +- memcpy(hash, saddr, 16); +- hash[4] = ((__force u16)sport << 16) + (__force u16)dport; +- memcpy(&hash[5], keyptr->secret, sizeof(__u32) * 7); +- +- seq = twothirdsMD4Transform((const __u32 *)daddr, hash) & HASH_MASK; +- seq += keyptr->count; +- +- seq += ktime_to_ns(ktime_get_real()); +- +- return seq; +-} +-EXPORT_SYMBOL(secure_tcpv6_sequence_number); +-#endif +- +-/* The code below is shamelessly stolen from secure_tcp_sequence_number(). +- * All blames to Andrey V. Savochkin <saw@msu.ru>. +- */ +-__u32 secure_ip_id(__be32 daddr) +-{ +- struct keydata *keyptr; +- __u32 hash[4]; +- +- keyptr = get_keyptr(); +- +- /* +- * Pick a unique starting offset for each IP destination. +- * The dest ip address is placed in the starting vector, +- * which is then hashed with random data. +- */ +- hash[0] = (__force __u32)daddr; +- hash[1] = keyptr->secret[9]; +- hash[2] = keyptr->secret[10]; +- hash[3] = keyptr->secret[11]; +- +- return half_md4_transform(hash, keyptr->secret); +-} +- +-#ifdef CONFIG_INET +- +-__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, +- __be16 sport, __be16 dport) +-{ +- __u32 seq; +- __u32 hash[4]; +- struct keydata *keyptr = get_keyptr(); +- +- /* +- * Pick a unique starting offset for each TCP connection endpoints +- * (saddr, daddr, sport, dport). +- * Note that the words are placed into the starting vector, which is +- * then mixed with a partial MD4 over random data. +- */ +- hash[0] = (__force u32)saddr; +- hash[1] = (__force u32)daddr; +- hash[2] = ((__force u16)sport << 16) + (__force u16)dport; +- hash[3] = keyptr->secret[11]; +- +- seq = half_md4_transform(hash, keyptr->secret) & HASH_MASK; +- seq += keyptr->count; +- /* +- * As close as possible to RFC 793, which +- * suggests using a 250 kHz clock. +- * Further reading shows this assumes 2 Mb/s networks. +- * For 10 Mb/s Ethernet, a 1 MHz clock is appropriate. +- * For 10 Gb/s Ethernet, a 1 GHz clock should be ok, but +- * we also need to limit the resolution so that the u32 seq +- * overlaps less than one time per MSL (2 minutes). +- * Choosing a clock of 64 ns period is OK. (period of 274 s) +- */ +- seq += ktime_to_ns(ktime_get_real()) >> 6; +- +- return seq; +-} +- +-/* Generate secure starting point for ephemeral IPV4 transport port search */ +-u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) +-{ +- struct keydata *keyptr = get_keyptr(); +- u32 hash[4]; +- +- /* +- * Pick a unique starting offset for each ephemeral port search +- * (saddr, daddr, dport) and 48bits of random data. +- */ +- hash[0] = (__force u32)saddr; +- hash[1] = (__force u32)daddr; +- hash[2] = (__force u32)dport ^ keyptr->secret[10]; +- hash[3] = keyptr->secret[11]; +- +- return half_md4_transform(hash, keyptr->secret); +-} +-EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral); +- +-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +-u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, +- __be16 dport) +-{ +- struct keydata *keyptr = get_keyptr(); +- u32 hash[12]; +- +- memcpy(hash, saddr, 16); +- hash[4] = (__force u32)dport; +- memcpy(&hash[5], keyptr->secret, sizeof(__u32) * 7); +- +- return twothirdsMD4Transform((const __u32 *)daddr, hash); +-} +-#endif +- +-#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) +-/* Similar to secure_tcp_sequence_number but generate a 48 bit value +- * bit's 32-47 increase every key exchange +- * 0-31 hash(source, dest) +- */ +-u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, +- __be16 sport, __be16 dport) +-{ +- u64 seq; +- __u32 hash[4]; +- struct keydata *keyptr = get_keyptr(); +- +- hash[0] = (__force u32)saddr; +- hash[1] = (__force u32)daddr; +- hash[2] = ((__force u16)sport << 16) + (__force u16)dport; +- hash[3] = keyptr->secret[11]; +- +- seq = half_md4_transform(hash, keyptr->secret); +- seq |= ((u64)keyptr->count) << (32 - HASH_BITS); +- +- seq += ktime_to_ns(ktime_get_real()); +- seq &= (1ull << 48) - 1; +- +- return seq; +-} +-EXPORT_SYMBOL(secure_dccp_sequence_number); +-#endif +- +-#endif /* CONFIG_INET */ + ++late_initcall(random_int_secret_init); + + /* + * Get a random word for internal kernel use only. Similar to urandom but +@@ -1670,17 +1366,16 @@ EXPORT_SYMBOL(secure_dccp_sequence_numbe + * value is not cryptographically secure but for several uses the cost of + * depleting entropy is too high + */ +-DEFINE_PER_CPU(__u32 [4], get_random_int_hash); ++DEFINE_PER_CPU(__u32 [MD5_DIGEST_WORDS], get_random_int_hash); + unsigned int get_random_int(void) + { +- struct keydata *keyptr; + __u32 *hash = get_cpu_var(get_random_int_hash); +- int ret; ++ unsigned int ret; + +- keyptr = get_keyptr(); + hash[0] += current->pid + jiffies + get_cycles(); + +- ret = half_md4_transform(hash, keyptr->secret); ++ md5_transform(hash, random_int_secret); ++ ret = hash[0]; + put_cpu_var(get_random_int_hash); + + return ret; diff -urNp linux-2.6.32.43/drivers/char/rocket.c linux-2.6.32.43/drivers/char/rocket.c --- linux-2.6.32.43/drivers/char/rocket.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/drivers/char/rocket.c 2011-05-16 21:46:57.000000000 -0400 @@ -57692,6 +58170,21 @@ diff -urNp linux-2.6.32.43/include/linux/crypto.h linux-2.6.32.43/include/linux/ #define crt_ablkcipher crt_u.ablkcipher #define crt_aead crt_u.aead +diff -urNp linux-2.6.32.43/include/linux/cryptohash.h linux-2.6.32.43/include/linux/cryptohash.h +--- linux-2.6.32.43/include/linux/cryptohash.h 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/include/linux/cryptohash.h 2011-08-07 19:48:09.000000000 -0400 +@@ -7,6 +7,11 @@ + void sha_init(__u32 *buf); + void sha_transform(__u32 *digest, const char *data, __u32 *W); + ++#define MD5_DIGEST_WORDS 4 ++#define MD5_MESSAGE_BYTES 64 ++ ++void md5_transform(__u32 *hash, __u32 const *in); ++ + __u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); + + #endif diff -urNp linux-2.6.32.43/include/linux/dcache.h linux-2.6.32.43/include/linux/dcache.h --- linux-2.6.32.43/include/linux/dcache.h 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/include/linux/dcache.h 2011-04-23 13:34:46.000000000 -0400 @@ -60069,8 +60562,26 @@ diff -urNp linux-2.6.32.43/include/linux/ptrace.h linux-2.6.32.43/include/linux/ { diff -urNp linux-2.6.32.43/include/linux/random.h linux-2.6.32.43/include/linux/random.h --- linux-2.6.32.43/include/linux/random.h 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/include/linux/random.h 2011-04-17 15:56:46.000000000 -0400 -@@ -74,6 +74,11 @@ unsigned long randomize_range(unsigned l ++++ linux-2.6.32.43/include/linux/random.h 2011-08-07 19:48:09.000000000 -0400 +@@ -53,17 +53,6 @@ extern void add_interrupt_randomness(int + extern void get_random_bytes(void *buf, int nbytes); + void generate_random_uuid(unsigned char uuid_out[16]); + +-extern __u32 secure_ip_id(__be32 daddr); +-extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); +-extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, +- __be16 dport); +-extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, +- __be16 sport, __be16 dport); +-extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, +- __be16 sport, __be16 dport); +-extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, +- __be16 sport, __be16 dport); +- + #ifndef MODULE + extern const struct file_operations random_fops, urandom_fops; + #endif +@@ -74,6 +63,11 @@ unsigned long randomize_range(unsigned l u32 random32(void); void srandom32(u32 seed); @@ -61364,6 +61875,30 @@ diff -urNp linux-2.6.32.43/include/net/sctp/sctp.h linux-2.6.32.43/include/net/s #define SCTP_ENABLE_DEBUG #define SCTP_DISABLE_DEBUG #define SCTP_ASSERT(expr, str, func) +diff -urNp linux-2.6.32.43/include/net/secure_seq.h linux-2.6.32.43/include/net/secure_seq.h +--- linux-2.6.32.43/include/net/secure_seq.h 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.32.43/include/net/secure_seq.h 2011-08-07 19:48:09.000000000 -0400 +@@ -0,0 +1,20 @@ ++#ifndef _NET_SECURE_SEQ ++#define _NET_SECURE_SEQ ++ ++#include <linux/types.h> ++ ++extern __u32 secure_ip_id(__be32 daddr); ++extern __u32 secure_ipv6_id(const __be32 daddr[4]); ++extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); ++extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, ++ __be16 dport); ++extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, ++ __be16 sport, __be16 dport); ++extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, ++ __be16 sport, __be16 dport); ++extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, ++ __be16 sport, __be16 dport); ++extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, ++ __be16 sport, __be16 dport); ++ ++#endif /* _NET_SECURE_SEQ */ diff -urNp linux-2.6.32.43/include/net/sock.h linux-2.6.32.43/include/net/sock.h --- linux-2.6.32.43/include/net/sock.h 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/include/net/sock.h 2011-05-04 17:56:28.000000000 -0400 @@ -66718,6 +67253,117 @@ diff -urNp linux-2.6.32.43/lib/kref.c linux-2.6.32.43/lib/kref.c WARN_ON(release == (void (*)(struct kref *))kfree); if (atomic_dec_and_test(&kref->refcount)) { +diff -urNp linux-2.6.32.43/lib/Makefile linux-2.6.32.43/lib/Makefile +--- linux-2.6.32.43/lib/Makefile 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/lib/Makefile 2011-08-07 19:48:09.000000000 -0400 +@@ -10,7 +10,7 @@ endif + lib-y := ctype.o string.o vsprintf.o cmdline.o \ + rbtree.o radix-tree.o dump_stack.o \ + idr.o int_sqrt.o extable.o prio_tree.o \ +- sha1.o irq_regs.o reciprocal_div.o argv_split.o \ ++ sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \ + proportions.o prio_heap.o ratelimit.o show_mem.o \ + is_single_threaded.o plist.o decompress.o flex_array.o + +diff -urNp linux-2.6.32.43/lib/md5.c linux-2.6.32.43/lib/md5.c +--- linux-2.6.32.43/lib/md5.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.32.43/lib/md5.c 2011-08-07 19:48:09.000000000 -0400 +@@ -0,0 +1,95 @@ ++#include <linux/kernel.h> ++#include <linux/module.h> ++#include <linux/cryptohash.h> ++ ++#define F1(x, y, z) (z ^ (x & (y ^ z))) ++#define F2(x, y, z) F1(z, x, y) ++#define F3(x, y, z) (x ^ y ^ z) ++#define F4(x, y, z) (y ^ (x | ~z)) ++ ++#define MD5STEP(f, w, x, y, z, in, s) \ ++ (w += f(x, y, z) + in, w = (w<<s | w>>(32-s)) + x) ++ ++void md5_transform(__u32 *hash, __u32 const *in) ++{ ++ u32 a, b, c, d; ++ ++ a = hash[0]; ++ b = hash[1]; ++ c = hash[2]; ++ d = hash[3]; ++ ++ MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); ++ MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); ++ MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); ++ MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); ++ MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); ++ MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); ++ MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); ++ MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); ++ MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); ++ MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); ++ MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); ++ MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); ++ MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); ++ MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); ++ MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); ++ MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); ++ ++ MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); ++ MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); ++ MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); ++ MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); ++ MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); ++ MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); ++ MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); ++ MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); ++ MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); ++ MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); ++ MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); ++ MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); ++ MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); ++ MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); ++ MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); ++ MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); ++ ++ MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); ++ MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); ++ MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); ++ MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); ++ MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); ++ MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); ++ MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); ++ MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); ++ MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); ++ MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); ++ MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); ++ MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); ++ MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); ++ MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); ++ MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); ++ MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); ++ ++ MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); ++ MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); ++ MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); ++ MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); ++ MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); ++ MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); ++ MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); ++ MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); ++ MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); ++ MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); ++ MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); ++ MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); ++ MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); ++ MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); ++ MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); ++ MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); ++ ++ hash[0] += a; ++ hash[1] += b; ++ hash[2] += c; ++ hash[3] += d; ++} ++EXPORT_SYMBOL(md5_transform); diff -urNp linux-2.6.32.43/lib/parser.c linux-2.6.32.43/lib/parser.c --- linux-2.6.32.43/lib/parser.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/lib/parser.c 2011-04-17 15:56:46.000000000 -0400 @@ -66864,7 +67510,7 @@ diff -urNp linux-2.6.32.43/localversion-grsec linux-2.6.32.43/localversion-grsec +-grsec diff -urNp linux-2.6.32.43/Makefile linux-2.6.32.43/Makefile --- linux-2.6.32.43/Makefile 2011-07-13 17:23:04.000000000 -0400 -+++ linux-2.6.32.43/Makefile 2011-08-05 20:33:55.000000000 -0400 ++++ linux-2.6.32.43/Makefile 2011-08-07 14:32:43.000000000 -0400 @@ -221,8 +221,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" HOSTCC = gcc @@ -66926,11 +67572,11 @@ diff -urNp linux-2.6.32.43/Makefile linux-2.6.32.43/Makefile +else +gcc-plugins: +ifeq ($(call cc-ifversion, -ge, 0405, y), y) -+ $(Q)echo "warning, your gcc installation does not support plugins, perhaps the necessary headers are missing?" ++ $(error Your gcc installation does not support plugins. If the necessary headers for plugin support are missing, they should be installed. On Debian, apt-get install gcc-<ver>-plugin-dev.)) +else + $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least" +endif -+ $(Q)echo "PAX_MEMORY_STACKLEAK and other will be less secure" ++ $(Q)echo "PAX_MEMORY_STACKLEAK and constification will be less secure" +endif + include $(srctree)/arch/$(SRCARCH)/Makefile @@ -71231,6 +71877,18 @@ diff -urNp linux-2.6.32.43/net/core/flow.c linux-2.6.32.43/net/core/flow.c if (!fle->object || fle->genid == genid) continue; +diff -urNp linux-2.6.32.43/net/core/Makefile linux-2.6.32.43/net/core/Makefile +--- linux-2.6.32.43/net/core/Makefile 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/net/core/Makefile 2011-08-07 19:48:09.000000000 -0400 +@@ -3,7 +3,7 @@ + # + + obj-y := sock.o request_sock.o skbuff.o iovec.o datagram.o stream.o scm.o \ +- gen_stats.o gen_estimator.o net_namespace.o ++ gen_stats.o gen_estimator.o net_namespace.o secure_seq.o + + obj-$(CONFIG_SYSCTL) += sysctl_net_core.o + obj-$(CONFIG_HAS_DMA) += skb_dma_map.o diff -urNp linux-2.6.32.43/net/core/rtnetlink.c linux-2.6.32.43/net/core/rtnetlink.c --- linux-2.6.32.43/net/core/rtnetlink.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/net/core/rtnetlink.c 2011-08-05 20:33:55.000000000 -0400 @@ -71243,6 +71901,193 @@ diff -urNp linux-2.6.32.43/net/core/rtnetlink.c linux-2.6.32.43/net/core/rtnetli static DEFINE_MUTEX(rtnl_mutex); +diff -urNp linux-2.6.32.43/net/core/secure_seq.c linux-2.6.32.43/net/core/secure_seq.c +--- linux-2.6.32.43/net/core/secure_seq.c 1969-12-31 19:00:00.000000000 -0500 ++++ linux-2.6.32.43/net/core/secure_seq.c 2011-08-07 19:48:09.000000000 -0400 +@@ -0,0 +1,183 @@ ++#include <linux/kernel.h> ++#include <linux/init.h> ++#include <linux/cryptohash.h> ++#include <linux/module.h> ++#include <linux/cache.h> ++#include <linux/random.h> ++#include <linux/hrtimer.h> ++#include <linux/ktime.h> ++#include <linux/string.h> ++ ++#include <net/secure_seq.h> ++ ++static u32 net_secret[MD5_MESSAGE_BYTES / 4] ____cacheline_aligned; ++ ++static int __init net_secret_init(void) ++{ ++ get_random_bytes(net_secret, sizeof(net_secret)); ++ return 0; ++} ++late_initcall(net_secret_init); ++ ++static u32 seq_scale(u32 seq) ++{ ++ /* ++ * As close as possible to RFC 793, which ++ * suggests using a 250 kHz clock. ++ * Further reading shows this assumes 2 Mb/s networks. ++ * For 10 Mb/s Ethernet, a 1 MHz clock is appropriate. ++ * For 10 Gb/s Ethernet, a 1 GHz clock should be ok, but ++ * we also need to limit the resolution so that the u32 seq ++ * overlaps less than one time per MSL (2 minutes). ++ * Choosing a clock of 64 ns period is OK. (period of 274 s) ++ */ ++ return seq + (ktime_to_ns(ktime_get_real()) >> 6); ++} ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++__u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, ++ __be16 sport, __be16 dport) ++{ ++ u32 secret[MD5_MESSAGE_BYTES / 4]; ++ u32 hash[MD5_DIGEST_WORDS]; ++ u32 i; ++ ++ memcpy(hash, saddr, 16); ++ for (i = 0; i < 4; i++) ++ secret[i] = net_secret[i] + daddr[i]; ++ secret[4] = net_secret[4] + ++ (((__force u16)sport << 16) + (__force u16)dport); ++ for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) ++ secret[i] = net_secret[i]; ++ ++ md5_transform(hash, secret); ++ ++ return seq_scale(hash[0]); ++} ++EXPORT_SYMBOL(secure_tcpv6_sequence_number); ++ ++u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, ++ __be16 dport) ++{ ++ u32 secret[MD5_MESSAGE_BYTES / 4]; ++ u32 hash[MD5_DIGEST_WORDS]; ++ u32 i; ++ ++ memcpy(hash, saddr, 16); ++ for (i = 0; i < 4; i++) ++ secret[i] = net_secret[i] + (__force u32) daddr[i]; ++ secret[4] = net_secret[4] + (__force u32)dport; ++ for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) ++ secret[i] = net_secret[i]; ++ ++ md5_transform(hash, secret); ++ return hash[0]; ++} ++#endif ++ ++#ifdef CONFIG_INET ++__u32 secure_ip_id(__be32 daddr) ++{ ++ u32 hash[MD5_DIGEST_WORDS]; ++ ++ hash[0] = (__force __u32) daddr; ++ hash[1] = net_secret[13]; ++ hash[2] = net_secret[14]; ++ hash[3] = net_secret[15]; ++ ++ md5_transform(hash, net_secret); ++ ++ return hash[0]; ++} ++ ++__u32 secure_ipv6_id(const __be32 daddr[4]) ++{ ++ __u32 hash[4]; ++ ++ memcpy(hash, daddr, 16); ++ md5_transform(hash, net_secret); ++ ++ return hash[0]; ++} ++ ++__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, ++ __be16 sport, __be16 dport) ++{ ++ u32 hash[MD5_DIGEST_WORDS]; ++ ++ hash[0] = (__force u32)saddr; ++ hash[1] = (__force u32)daddr; ++ hash[2] = ((__force u16)sport << 16) + (__force u16)dport; ++ hash[3] = net_secret[15]; ++ ++ md5_transform(hash, net_secret); ++ ++ return seq_scale(hash[0]); ++} ++ ++u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) ++{ ++ u32 hash[MD5_DIGEST_WORDS]; ++ ++ hash[0] = (__force u32)saddr; ++ hash[1] = (__force u32)daddr; ++ hash[2] = (__force u32)dport ^ net_secret[14]; ++ hash[3] = net_secret[15]; ++ ++ md5_transform(hash, net_secret); ++ ++ return hash[0]; ++} ++EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral); ++#endif ++ ++#if defined(CONFIG_IP_DCCP) || defined(CONFIG_IP_DCCP_MODULE) ++u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, ++ __be16 sport, __be16 dport) ++{ ++ u32 hash[MD5_DIGEST_WORDS]; ++ u64 seq; ++ ++ hash[0] = (__force u32)saddr; ++ hash[1] = (__force u32)daddr; ++ hash[2] = ((__force u16)sport << 16) + (__force u16)dport; ++ hash[3] = net_secret[15]; ++ ++ md5_transform(hash, net_secret); ++ ++ seq = hash[0] | (((u64)hash[1]) << 32); ++ seq += ktime_to_ns(ktime_get_real()); ++ seq &= (1ull << 48) - 1; ++ ++ return seq; ++} ++EXPORT_SYMBOL(secure_dccp_sequence_number); ++ ++#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) ++u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, ++ __be16 sport, __be16 dport) ++{ ++ u32 secret[MD5_MESSAGE_BYTES / 4]; ++ u32 hash[MD5_DIGEST_WORDS]; ++ u64 seq; ++ u32 i; ++ ++ memcpy(hash, saddr, 16); ++ for (i = 0; i < 4; i++) ++ secret[i] = net_secret[i] + daddr[i]; ++ secret[4] = net_secret[4] + ++ (((__force u16)sport << 16) + (__force u16)dport); ++ for (i = 5; i < MD5_MESSAGE_BYTES / 4; i++) ++ secret[i] = net_secret[i]; ++ ++ md5_transform(hash, secret); ++ ++ seq = hash[0] | (((u64)hash[1]) << 32); ++ seq += ktime_to_ns(ktime_get_real()); ++ seq &= (1ull << 48) - 1; ++ ++ return seq; ++} ++EXPORT_SYMBOL(secure_dccpv6_sequence_number); ++#endif ++#endif diff -urNp linux-2.6.32.43/net/core/skbuff.c linux-2.6.32.43/net/core/skbuff.c --- linux-2.6.32.43/net/core/skbuff.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/net/core/skbuff.c 2011-05-16 21:46:57.000000000 -0400 @@ -71284,6 +72129,43 @@ diff -urNp linux-2.6.32.43/net/core/sock.c linux-2.6.32.43/net/core/sock.c } EXPORT_SYMBOL(sock_init_data); +diff -urNp linux-2.6.32.43/net/dccp/ipv4.c linux-2.6.32.43/net/dccp/ipv4.c +--- linux-2.6.32.43/net/dccp/ipv4.c 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/net/dccp/ipv4.c 2011-08-07 19:48:09.000000000 -0400 +@@ -25,6 +25,7 @@ + #include <net/timewait_sock.h> + #include <net/tcp_states.h> + #include <net/xfrm.h> ++#include <net/secure_seq.h> + + #include "ackvec.h" + #include "ccid.h" +diff -urNp linux-2.6.32.43/net/dccp/ipv6.c linux-2.6.32.43/net/dccp/ipv6.c +--- linux-2.6.32.43/net/dccp/ipv6.c 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/net/dccp/ipv6.c 2011-08-07 19:48:09.000000000 -0400 +@@ -28,6 +28,7 @@ + #include <net/transp_v6.h> + #include <net/ip6_checksum.h> + #include <net/xfrm.h> ++#include <net/secure_seq.h> + + #include "dccp.h" + #include "ipv6.h" +@@ -69,13 +70,7 @@ static inline void dccp_v6_send_check(st + dh->dccph_checksum = dccp_v6_csum_finish(skb, &np->saddr, &np->daddr); + } + +-static inline __u32 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr, +- __be16 sport, __be16 dport ) +-{ +- return secure_tcpv6_sequence_number(saddr, daddr, sport, dport); +-} +- +-static inline __u32 dccp_v6_init_sequence(struct sk_buff *skb) ++static inline __u64 dccp_v6_init_sequence(struct sk_buff *skb) + { + return secure_dccpv6_sequence_number(ipv6_hdr(skb)->daddr.s6_addr32, + ipv6_hdr(skb)->saddr.s6_addr32, diff -urNp linux-2.6.32.43/net/decnet/sysctl_net_decnet.c linux-2.6.32.43/net/decnet/sysctl_net_decnet.c --- linux-2.6.32.43/net/decnet/sysctl_net_decnet.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/net/decnet/sysctl_net_decnet.c 2011-04-17 15:56:46.000000000 -0400 @@ -71406,8 +72288,8 @@ diff -urNp linux-2.6.32.43/net/ipv4/inet_diag.c linux-2.6.32.43/net/ipv4/inet_di if (tmo < 0) diff -urNp linux-2.6.32.43/net/ipv4/inet_hashtables.c linux-2.6.32.43/net/ipv4/inet_hashtables.c --- linux-2.6.32.43/net/ipv4/inet_hashtables.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv4/inet_hashtables.c 2011-04-17 15:56:46.000000000 -0400 -@@ -18,11 +18,14 @@ ++++ linux-2.6.32.43/net/ipv4/inet_hashtables.c 2011-08-07 19:48:09.000000000 -0400 +@@ -18,11 +18,15 @@ #include <linux/sched.h> #include <linux/slab.h> #include <linux/wait.h> @@ -71415,6 +72297,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/inet_hashtables.c linux-2.6.32.43/net/ipv4/i #include <net/inet_connection_sock.h> #include <net/inet_hashtables.h> ++#include <net/secure_seq.h> #include <net/ip.h> +extern void gr_update_task_in_ip_table(struct task_struct *task, const struct inet_sock *inet); @@ -71422,7 +72305,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/inet_hashtables.c linux-2.6.32.43/net/ipv4/i /* * Allocate and initialize a new local port bind bucket. * The bindhash mutex for snum's hash chain must be held here. -@@ -490,6 +493,8 @@ ok: +@@ -490,6 +494,8 @@ ok: } spin_unlock(&head->lock); @@ -71433,8 +72316,16 @@ diff -urNp linux-2.6.32.43/net/ipv4/inet_hashtables.c linux-2.6.32.43/net/ipv4/i inet_twsk_put(tw); diff -urNp linux-2.6.32.43/net/ipv4/inetpeer.c linux-2.6.32.43/net/ipv4/inetpeer.c --- linux-2.6.32.43/net/ipv4/inetpeer.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv4/inetpeer.c 2011-05-16 21:46:57.000000000 -0400 -@@ -366,6 +366,8 @@ struct inet_peer *inet_getpeer(__be32 da ++++ linux-2.6.32.43/net/ipv4/inetpeer.c 2011-08-07 19:48:09.000000000 -0400 +@@ -19,6 +19,7 @@ + #include <linux/net.h> + #include <net/ip.h> + #include <net/inetpeer.h> ++#include <net/secure_seq.h> + + /* + * Theory of operations. +@@ -366,6 +367,8 @@ struct inet_peer *inet_getpeer(__be32 da struct inet_peer *p, *n; struct inet_peer **stack[PEER_MAXDEPTH], ***stackptr; @@ -71443,7 +72334,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/inetpeer.c linux-2.6.32.43/net/ipv4/inetpeer /* Look up for the address quickly. */ read_lock_bh(&peer_pool_lock); p = lookup(daddr, NULL); -@@ -389,7 +391,7 @@ struct inet_peer *inet_getpeer(__be32 da +@@ -389,7 +392,7 @@ struct inet_peer *inet_getpeer(__be32 da return NULL; n->v4daddr = daddr; atomic_set(&n->refcnt, 1); @@ -71498,6 +72389,17 @@ diff -urNp linux-2.6.32.43/net/ipv4/netfilter/ip_tables.c linux-2.6.32.43/net/ip info.valid_hooks = t->valid_hooks; memcpy(info.hook_entry, private->hook_entry, sizeof(info.hook_entry)); +diff -urNp linux-2.6.32.43/net/ipv4/netfilter/nf_nat_proto_common.c linux-2.6.32.43/net/ipv4/netfilter/nf_nat_proto_common.c +--- linux-2.6.32.43/net/ipv4/netfilter/nf_nat_proto_common.c 2011-03-27 14:31:47.000000000 -0400 ++++ linux-2.6.32.43/net/ipv4/netfilter/nf_nat_proto_common.c 2011-08-07 19:48:09.000000000 -0400 +@@ -12,6 +12,7 @@ + #include <linux/ip.h> + + #include <linux/netfilter.h> ++#include <net/secure_seq.h> + #include <net/netfilter/nf_nat.h> + #include <net/netfilter/nf_nat_core.h> + #include <net/netfilter/nf_nat_rule.h> diff -urNp linux-2.6.32.43/net/ipv4/netfilter/nf_nat_snmp_basic.c linux-2.6.32.43/net/ipv4/netfilter/nf_nat_snmp_basic.c --- linux-2.6.32.43/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-03-27 14:31:47.000000000 -0400 +++ linux-2.6.32.43/net/ipv4/netfilter/nf_nat_snmp_basic.c 2011-04-17 15:56:46.000000000 -0400 @@ -71583,8 +72485,16 @@ diff -urNp linux-2.6.32.43/net/ipv4/raw.c linux-2.6.32.43/net/ipv4/raw.c static int raw_seq_show(struct seq_file *seq, void *v) diff -urNp linux-2.6.32.43/net/ipv4/route.c linux-2.6.32.43/net/ipv4/route.c --- linux-2.6.32.43/net/ipv4/route.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv4/route.c 2011-05-04 17:56:28.000000000 -0400 -@@ -268,7 +268,7 @@ static inline unsigned int rt_hash(__be3 ++++ linux-2.6.32.43/net/ipv4/route.c 2011-08-07 19:48:09.000000000 -0400 +@@ -107,6 +107,7 @@ + #ifdef CONFIG_SYSCTL + #include <linux/sysctl.h> + #endif ++#include <net/secure_seq.h> + + #define RT_FL_TOS(oldflp) \ + ((u32)(oldflp->fl4_tos & (IPTOS_RT_MASK | RTO_ONLINK))) +@@ -268,7 +269,7 @@ static inline unsigned int rt_hash(__be3 static inline int rt_genid(struct net *net) { @@ -71593,7 +72503,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/route.c linux-2.6.32.43/net/ipv4/route.c } #ifdef CONFIG_PROC_FS -@@ -888,7 +888,7 @@ static void rt_cache_invalidate(struct n +@@ -888,7 +889,7 @@ static void rt_cache_invalidate(struct n unsigned char shuffle; get_random_bytes(&shuffle, sizeof(shuffle)); @@ -71602,7 +72512,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/route.c linux-2.6.32.43/net/ipv4/route.c } /* -@@ -3356,7 +3356,7 @@ static __net_initdata struct pernet_oper +@@ -3356,7 +3357,7 @@ static __net_initdata struct pernet_oper static __net_init int rt_secret_timer_init(struct net *net) { @@ -71634,8 +72544,16 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp.c linux-2.6.32.43/net/ipv4/tcp.c diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4.c --- linux-2.6.32.43/net/ipv4/tcp_ipv4.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv4/tcp_ipv4.c 2011-08-05 20:33:55.000000000 -0400 -@@ -84,6 +84,9 @@ ++++ linux-2.6.32.43/net/ipv4/tcp_ipv4.c 2011-08-07 19:48:09.000000000 -0400 +@@ -71,6 +71,7 @@ + #include <net/timewait_sock.h> + #include <net/xfrm.h> + #include <net/netdma.h> ++#include <net/secure_seq.h> + + #include <linux/inet.h> + #include <linux/ipv6.h> +@@ -84,6 +85,9 @@ int sysctl_tcp_tw_reuse __read_mostly; int sysctl_tcp_low_latency __read_mostly; @@ -71645,7 +72563,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 #ifdef CONFIG_TCP_MD5SIG static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk, -@@ -1542,6 +1545,9 @@ int tcp_v4_do_rcv(struct sock *sk, struc +@@ -1542,6 +1546,9 @@ int tcp_v4_do_rcv(struct sock *sk, struc return 0; reset: @@ -71655,7 +72573,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 tcp_v4_send_reset(rsk, skb); discard: kfree_skb(skb); -@@ -1603,12 +1609,20 @@ int tcp_v4_rcv(struct sk_buff *skb) +@@ -1603,12 +1610,20 @@ int tcp_v4_rcv(struct sk_buff *skb) TCP_SKB_CB(skb)->sacked = 0; sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); @@ -71678,7 +72596,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) goto discard_and_relse; -@@ -1650,6 +1664,10 @@ no_tcp_socket: +@@ -1650,6 +1665,10 @@ no_tcp_socket: bad_packet: TCP_INC_STATS_BH(net, TCP_MIB_INERRS); } else { @@ -71689,7 +72607,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 tcp_v4_send_reset(NULL, skb); } -@@ -2194,14 +2212,14 @@ int tcp_proc_register(struct net *net, s +@@ -2194,14 +2213,14 @@ int tcp_proc_register(struct net *net, s int rc = 0; struct proc_dir_entry *p; @@ -71712,7 +72630,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net, &afinfo->seq_fops, afinfo); -@@ -2237,7 +2255,11 @@ static void get_openreq4(struct sock *sk +@@ -2237,7 +2256,11 @@ static void get_openreq4(struct sock *sk 0, /* non standard timer */ 0, /* open_requests have no inode */ atomic_read(&sk->sk_refcnt), @@ -71724,7 +72642,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 len); } -@@ -2279,7 +2301,12 @@ static void get_tcp4_sock(struct sock *s +@@ -2279,7 +2302,12 @@ static void get_tcp4_sock(struct sock *s sock_i_uid(sk), icsk->icsk_probes_out, sock_i_ino(sk), @@ -71738,7 +72656,7 @@ diff -urNp linux-2.6.32.43/net/ipv4/tcp_ipv4.c linux-2.6.32.43/net/ipv4/tcp_ipv4 jiffies_to_clock_t(icsk->icsk_rto), jiffies_to_clock_t(icsk->icsk_ack.ato), (icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong, -@@ -2307,7 +2334,13 @@ static void get_timewait4_sock(struct in +@@ -2307,7 +2335,13 @@ static void get_timewait4_sock(struct in " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p%n", i, src, srcp, dest, destp, tw->tw_substate, 0, 0, 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, @@ -71973,8 +72891,16 @@ diff -urNp linux-2.6.32.43/net/ipv6/inet6_connection_sock.c linux-2.6.32.43/net/ dst = NULL; diff -urNp linux-2.6.32.43/net/ipv6/inet6_hashtables.c linux-2.6.32.43/net/ipv6/inet6_hashtables.c --- linux-2.6.32.43/net/ipv6/inet6_hashtables.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv6/inet6_hashtables.c 2011-05-04 17:56:28.000000000 -0400 -@@ -118,7 +118,7 @@ out: ++++ linux-2.6.32.43/net/ipv6/inet6_hashtables.c 2011-08-07 19:48:09.000000000 -0400 +@@ -20,6 +20,7 @@ + #include <net/inet_connection_sock.h> + #include <net/inet_hashtables.h> + #include <net/inet6_hashtables.h> ++#include <net/secure_seq.h> + #include <net/ip.h> + + void __inet6_hash(struct sock *sk) +@@ -118,7 +119,7 @@ out: } EXPORT_SYMBOL(__inet6_lookup_established); @@ -72134,8 +73060,16 @@ diff -urNp linux-2.6.32.43/net/ipv6/raw.c linux-2.6.32.43/net/ipv6/raw.c static int raw6_seq_show(struct seq_file *seq, void *v) diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6.c --- linux-2.6.32.43/net/ipv6/tcp_ipv6.c 2011-03-27 14:31:47.000000000 -0400 -+++ linux-2.6.32.43/net/ipv6/tcp_ipv6.c 2011-04-17 15:56:46.000000000 -0400 -@@ -88,6 +88,10 @@ static struct tcp_md5sig_key *tcp_v6_md5 ++++ linux-2.6.32.43/net/ipv6/tcp_ipv6.c 2011-08-07 19:48:09.000000000 -0400 +@@ -60,6 +60,7 @@ + #include <net/timewait_sock.h> + #include <net/netdma.h> + #include <net/inet_common.h> ++#include <net/secure_seq.h> + + #include <asm/uaccess.h> + +@@ -88,6 +89,10 @@ static struct tcp_md5sig_key *tcp_v6_md5 } #endif @@ -72146,7 +73080,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 static void tcp_v6_hash(struct sock *sk) { if (sk->sk_state != TCP_CLOSE) { -@@ -1578,6 +1582,9 @@ static int tcp_v6_do_rcv(struct sock *sk +@@ -1578,6 +1583,9 @@ static int tcp_v6_do_rcv(struct sock *sk return 0; reset: @@ -72156,7 +73090,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 tcp_v6_send_reset(sk, skb); discard: if (opt_skb) -@@ -1655,12 +1662,20 @@ static int tcp_v6_rcv(struct sk_buff *sk +@@ -1655,12 +1663,20 @@ static int tcp_v6_rcv(struct sk_buff *sk TCP_SKB_CB(skb)->sacked = 0; sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); @@ -72179,7 +73113,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) goto discard_and_relse; -@@ -1700,6 +1715,10 @@ no_tcp_socket: +@@ -1700,6 +1716,10 @@ no_tcp_socket: bad_packet: TCP_INC_STATS_BH(net, TCP_MIB_INERRS); } else { @@ -72190,7 +73124,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 tcp_v6_send_reset(NULL, skb); } -@@ -1915,7 +1934,13 @@ static void get_openreq6(struct seq_file +@@ -1915,7 +1935,13 @@ static void get_openreq6(struct seq_file uid, 0, /* non standard timer */ 0, /* open_requests have no inode */ @@ -72205,7 +73139,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 } static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i) -@@ -1965,7 +1990,12 @@ static void get_tcp6_sock(struct seq_fil +@@ -1965,7 +1991,12 @@ static void get_tcp6_sock(struct seq_fil sock_i_uid(sp), icsk->icsk_probes_out, sock_i_ino(sp), @@ -72219,7 +73153,7 @@ diff -urNp linux-2.6.32.43/net/ipv6/tcp_ipv6.c linux-2.6.32.43/net/ipv6/tcp_ipv6 jiffies_to_clock_t(icsk->icsk_rto), jiffies_to_clock_t(icsk->icsk_ack.ato), (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong, -@@ -2000,7 +2030,13 @@ static void get_timewait6_sock(struct se +@@ -2000,7 +2031,13 @@ static void get_timewait6_sock(struct se dest->s6_addr32[2], dest->s6_addr32[3], destp, tw->tw_substate, 0, 0, 3, jiffies_to_clock_t(ttd), 0, 0, 0, 0, diff --git a/2.6.39/0000_README b/2.6.39/0000_README index bcdc911..d29da40 100644 --- a/2.6.39/0000_README +++ b/2.6.39/0000_README @@ -3,7 +3,7 @@ README Individual Patch Descriptions: ----------------------------------------------------------------------------- -Patch: 4420_grsecurity-2.2.2-2.6.39.4-201108060941.patch +Patch: 4420_grsecurity-2.2.2-2.6.39.4-201108071438.patch From: http://www.grsecurity.net Desc: hardened-sources base patch from upstream grsecurity diff --git a/2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108060941.patch b/2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108071438.patch index 827cb17..5900fc9 100644 --- a/2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108060941.patch +++ b/2.6.39/4420_grsecurity-2.2.2-2.6.39.4-201108071438.patch @@ -60582,7 +60582,7 @@ diff -urNp linux-2.6.39.4/localversion-grsec linux-2.6.39.4/localversion-grsec +-grsec diff -urNp linux-2.6.39.4/Makefile linux-2.6.39.4/Makefile --- linux-2.6.39.4/Makefile 2011-08-05 21:11:51.000000000 -0400 -+++ linux-2.6.39.4/Makefile 2011-08-05 21:12:17.000000000 -0400 ++++ linux-2.6.39.4/Makefile 2011-08-07 14:17:20.000000000 -0400 @@ -237,8 +237,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" HOSTCC = gcc @@ -60635,11 +60635,11 @@ diff -urNp linux-2.6.39.4/Makefile linux-2.6.39.4/Makefile +else +gcc-plugins: +ifeq ($(call cc-ifversion, -ge, 0405, y), y) -+ $(Q)echo "warning, your gcc installation does not support plugins, perhaps the necessary headers are missing?" ++ $(error Your gcc installation does not support plugins. If the necessary headers for plugin support are missing, they should be installed. On Debian, apt-get install gcc-<ver>-plugin-dev.)) +else + $(Q)echo "warning, your gcc version does not support plugins, you should upgrade it to gcc 4.5 at least" +endif -+ $(Q)echo "PAX_MEMORY_STACKLEAK and other will be less secure" ++ $(Q)echo "PAX_MEMORY_STACKLEAK and constification will be less secure" +endif + include $(srctree)/arch/$(SRCARCH)/Makefile |