aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-07-02 07:24:16 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-02 12:17:55 +0000
commit9e62ee1ad785c9784d6f58765b56352dae3a8b80 (patch)
treeada05a03de43b2dae1a069b96d72f7605d6abefa
parent78be1870e0d06800585803e45edd3890b783b649 (diff)
downloadalpine_aports-9e62ee1ad785c9784d6f58765b56352dae3a8b80.tar.bz2
alpine_aports-9e62ee1ad785c9784d6f58765b56352dae3a8b80.tar.xz
alpine_aports-9e62ee1ad785c9784d6f58765b56352dae3a8b80.zip
main/linux-grsec: upgrade to grsecurity-2.9.1-3.9.8-201306302052
(cherry picked from commit 99142aeaac41d3fa49f8af96ffd547719a515352)
-rw-r--r--main/linux-grsec/APKBUILD10
-rw-r--r--main/linux-grsec/grsecurity-2.9.1-3.9.8-201306302052.patch (renamed from main/linux-grsec/grsecurity-2.9.1-3.9.8-201306272057.patch)115
2 files changed, 108 insertions, 17 deletions
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD
index ebbddba2a3..7e148c4015 100644
--- a/main/linux-grsec/APKBUILD
+++ b/main/linux-grsec/APKBUILD
@@ -7,7 +7,7 @@ case $pkgver in
7*.*.*) _kernver=${pkgver%.*};; 7*.*.*) _kernver=${pkgver%.*};;
8*.*) _kernver=${pkgver};; 8*.*) _kernver=${pkgver};;
9esac 9esac
10pkgrel=0 10pkgrel=1
11pkgdesc="Linux kernel with grsecurity" 11pkgdesc="Linux kernel with grsecurity"
12url=http://grsecurity.net 12url=http://grsecurity.net
13depends="mkinitfs linux-firmware" 13depends="mkinitfs linux-firmware"
@@ -17,7 +17,7 @@ _config=${config:-kernelconfig.${CARCH}}
17install= 17install=
18source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz 18source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz
19 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz 19 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz
20 grsecurity-2.9.1-3.9.8-201306272057.patch 20 grsecurity-2.9.1-3.9.8-201306302052.patch
21 21
22 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 22 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
23 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 23 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
@@ -150,7 +150,7 @@ dev() {
150 150
151md5sums="4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz 151md5sums="4348c9b6b2eb3144d601e87c19d5d909 linux-3.9.tar.xz
152c5f2166686a913abf550bfed8b77df27 patch-3.9.8.xz 152c5f2166686a913abf550bfed8b77df27 patch-3.9.8.xz
15353d60133a86b812060b048275f928041 grsecurity-2.9.1-3.9.8-201306272057.patch 153647f77555169969b4245c62c0fd0f1ab grsecurity-2.9.1-3.9.8-201306302052.patch
154a16f11b12381efb3bec79b9bfb329836 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 154a16f11b12381efb3bec79b9bfb329836 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
155656ae7b10dd2f18dbfa1011041d08d60 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 155656ae7b10dd2f18dbfa1011041d08d60 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
156aa454ffb96428586447775c21449e284 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 156aa454ffb96428586447775c21449e284 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
@@ -161,7 +161,7 @@ d89089b3c7eb94dd9f65cf8a357fc36d kernelconfig.x86
161eb147f09fef5996a488c247790205cd6 kernelconfig.x86_64" 161eb147f09fef5996a488c247790205cd6 kernelconfig.x86_64"
162sha256sums="60bc3e64ee5dc778de2cd7cd7640abf518a4c9d4f31b8ed624e16fad53f54541 linux-3.9.tar.xz 162sha256sums="60bc3e64ee5dc778de2cd7cd7640abf518a4c9d4f31b8ed624e16fad53f54541 linux-3.9.tar.xz
1632eda9068e81269467e3c247f3343a146731fc45284b12b4bc546bc44dbb263e7 patch-3.9.8.xz 1632eda9068e81269467e3c247f3343a146731fc45284b12b4bc546bc44dbb263e7 patch-3.9.8.xz
164587022b1fc72157e43011551404c7d664dcc3b6c95b72a853ef2ce721e474057 grsecurity-2.9.1-3.9.8-201306272057.patch 164b111346072b7907d3a284f12a08c490cbfe35592537bc59442014c95080c3a33 grsecurity-2.9.1-3.9.8-201306302052.patch
1656af3757ac36a6cd3cda7b0a71b08143726383b19261294a569ad7f4042c72df3 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 1656af3757ac36a6cd3cda7b0a71b08143726383b19261294a569ad7f4042c72df3 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
166dc8e82108615657f1fb9d641efd42255a5761c06edde1b00a41ae0d314d548f0 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 166dc8e82108615657f1fb9d641efd42255a5761c06edde1b00a41ae0d314d548f0 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
1670985caa0f3ee8ed0959aeaa4214f5f8057ae8e61d50dcae39194912d31e14892 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 1670985caa0f3ee8ed0959aeaa4214f5f8057ae8e61d50dcae39194912d31e14892 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
@@ -172,7 +172,7 @@ de3c17420664ae4e52826c6e602aade0deeae94f72253f85b3e48771491ed5d6 kernelconfig.x
172e1cce320f207cc2ba72b9d154c7060c8cbed52c664319dfd21f24e8956d0bf3e kernelconfig.x86_64" 172e1cce320f207cc2ba72b9d154c7060c8cbed52c664319dfd21f24e8956d0bf3e kernelconfig.x86_64"
173sha512sums="77fa521f42380409f8ab400c26f7b00e225cb075ef40834bb263325cfdcc3e65aef8511ec2fc2b50bbf4f50e226fb5ab07d7a479aaf09162adbbf318325d0790 linux-3.9.tar.xz 173sha512sums="77fa521f42380409f8ab400c26f7b00e225cb075ef40834bb263325cfdcc3e65aef8511ec2fc2b50bbf4f50e226fb5ab07d7a479aaf09162adbbf318325d0790 linux-3.9.tar.xz
17460b7d694d39faf937e7b732eb3117b8442059c5c8857c9d439eec8a87d5bc185505e64062f5ae02c3512acf5af778caf615c35d3499cb8089a4569c05da65b9c patch-3.9.8.xz 17460b7d694d39faf937e7b732eb3117b8442059c5c8857c9d439eec8a87d5bc185505e64062f5ae02c3512acf5af778caf615c35d3499cb8089a4569c05da65b9c patch-3.9.8.xz
1754ca36180a1fc325a558acf73ec9fe3808542498a8f808f73b87a9f6b05ff290d5a5ab20ce39c547a18ce37d093a9857f5c77c495796e62fef986dfa301a9e566 grsecurity-2.9.1-3.9.8-201306272057.patch 17581912f5c19b8bc891a1ad8ed57bfe91d79c6c301410eb4ef9e58f57caefba2661d9732b306d695e712fd8e7c9b5bbb67659759fade26f4ec853d9cb96d347df9 grsecurity-2.9.1-3.9.8-201306302052.patch
17681e78593288e8b0fd2c03ea9fc1450323887707f087e911f172450a122bc9b591ee83394836789730d951aeec13d0b75a64e1c05f04364abf8f80d883ddc4a02 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch 17681e78593288e8b0fd2c03ea9fc1450323887707f087e911f172450a122bc9b591ee83394836789730d951aeec13d0b75a64e1c05f04364abf8f80d883ddc4a02 0001-net-inform-NETDEV_CHANGE-callbacks-which-flags-were-.patch
17751ecb15b669f6a82940a13a38939116e003bf5dfd24496771c8279e907b72adcc63d607f0340a2940d757e12ddadb7d45c7af78ae311d284935a6296dbcac00c 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch 17751ecb15b669f6a82940a13a38939116e003bf5dfd24496771c8279e907b72adcc63d607f0340a2940d757e12ddadb7d45c7af78ae311d284935a6296dbcac00c 0002-arp-flush-arp-cache-on-IFF_NOARP-change.patch
17857d0a8bd35d19cf657ded58efe24517d2252aec6984040713ba173a34edb5887ececaa2985076bc6a149eaa57639fd98a042c1c2d226ed4ad8dd5ed0e230717e 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch 17857d0a8bd35d19cf657ded58efe24517d2252aec6984040713ba173a34edb5887ececaa2985076bc6a149eaa57639fd98a042c1c2d226ed4ad8dd5ed0e230717e 0003-ipv4-properly-refresh-rtable-entries-on-pmtu-redirec.patch
diff --git a/main/linux-grsec/grsecurity-2.9.1-3.9.8-201306272057.patch b/main/linux-grsec/grsecurity-2.9.1-3.9.8-201306302052.patch
index 3efd0e4c4b..9c80933310 100644
--- a/main/linux-grsec/grsecurity-2.9.1-3.9.8-201306272057.patch
+++ b/main/linux-grsec/grsecurity-2.9.1-3.9.8-201306302052.patch
@@ -2312,7 +2312,7 @@ index 60d3b73..d27ee09 100644
2312 EXPORT_SYMBOL(__get_user_1); 2312 EXPORT_SYMBOL(__get_user_1);
2313 EXPORT_SYMBOL(__get_user_2); 2313 EXPORT_SYMBOL(__get_user_2);
2314diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S 2314diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
2315index 0f82098..3dbd3ee 100644 2315index 0f82098..fb3d3d5 100644
2316--- a/arch/arm/kernel/entry-armv.S 2316--- a/arch/arm/kernel/entry-armv.S
2317+++ b/arch/arm/kernel/entry-armv.S 2317+++ b/arch/arm/kernel/entry-armv.S
2318@@ -47,6 +47,87 @@ 2318@@ -47,6 +47,87 @@
@@ -2484,7 +2484,7 @@ index 0f82098..3dbd3ee 100644
2484 THUMB( str sp, [ip], #4 ) 2484 THUMB( str sp, [ip], #4 )
2485 THUMB( str lr, [ip], #4 ) 2485 THUMB( str lr, [ip], #4 )
2486-#ifdef CONFIG_CPU_USE_DOMAINS 2486-#ifdef CONFIG_CPU_USE_DOMAINS
2487+#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) 2487+#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF)
2488 ldr r6, [r2, #TI_CPU_DOMAIN] 2488 ldr r6, [r2, #TI_CPU_DOMAIN]
2489 #endif 2489 #endif
2490 set_tls r3, r4, r5 2490 set_tls r3, r4, r5
@@ -2493,7 +2493,7 @@ index 0f82098..3dbd3ee 100644
2493 ldr r7, [r7, #TSK_STACK_CANARY] 2493 ldr r7, [r7, #TSK_STACK_CANARY]
2494 #endif 2494 #endif
2495-#ifdef CONFIG_CPU_USE_DOMAINS 2495-#ifdef CONFIG_CPU_USE_DOMAINS
2496+#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) 2496+#if defined(CONFIG_CPU_USE_DOMAINS) || defined(CONFIG_PAX_KERNEXEC) || defined(CONFIG_PAX_MEMORY_UDEREF)
2497 mcr p15, 0, r6, c3, c0, 0 @ Set domain register 2497 mcr p15, 0, r6, c3, c0, 0 @ Set domain register
2498 #endif 2498 #endif
2499 mov r5, r0 2499 mov r5, r0
@@ -50560,7 +50560,7 @@ index 6a16053..2155147 100644
50560 return rc; 50560 return rc;
50561 } 50561 }
50562diff --git a/fs/exec.c b/fs/exec.c 50562diff --git a/fs/exec.c b/fs/exec.c
50563index 6d56ff2..3bc6638 100644 50563index 6d56ff2..f65b4ca 100644
50564--- a/fs/exec.c 50564--- a/fs/exec.c
50565+++ b/fs/exec.c 50565+++ b/fs/exec.c
50566@@ -55,8 +55,20 @@ 50566@@ -55,8 +55,20 @@
@@ -50862,7 +50862,37 @@ index 6d56ff2..3bc6638 100644
50862 set_fs(old_fs); 50862 set_fs(old_fs);
50863 return result; 50863 return result;
50864 } 50864 }
50865@@ -1250,7 +1325,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm) 50865@@ -1136,13 +1211,6 @@ void setup_new_exec(struct linux_binprm * bprm)
50866 set_dumpable(current->mm, suid_dumpable);
50867 }
50868
50869- /*
50870- * Flush performance counters when crossing a
50871- * security domain:
50872- */
50873- if (!get_dumpable(current->mm))
50874- perf_event_exit_task(current);
50875-
50876 /* An exec changes our domain. We are no longer part of the thread
50877 group */
50878
50879@@ -1206,6 +1274,15 @@ void install_exec_creds(struct linux_binprm *bprm)
50880
50881 commit_creds(bprm->cred);
50882 bprm->cred = NULL;
50883+
50884+ /*
50885+ * Disable monitoring for regular users
50886+ * when executing setuid binaries. Must
50887+ * wait until new credentials are committed
50888+ * by commit_creds() above
50889+ */
50890+ if (get_dumpable(current->mm) != SUID_DUMP_USER)
50891+ perf_event_exit_task(current);
50892 /*
50893 * cred_guard_mutex must be held at least to this point to prevent
50894 * ptrace_attach() from altering our determination of the task's
50895@@ -1250,7 +1327,7 @@ static int check_unsafe_exec(struct linux_binprm *bprm)
50866 } 50896 }
50867 rcu_read_unlock(); 50897 rcu_read_unlock();
50868 50898
@@ -50871,7 +50901,7 @@ index 6d56ff2..3bc6638 100644
50871 bprm->unsafe |= LSM_UNSAFE_SHARE; 50901 bprm->unsafe |= LSM_UNSAFE_SHARE;
50872 } else { 50902 } else {
50873 res = -EAGAIN; 50903 res = -EAGAIN;
50874@@ -1450,6 +1525,31 @@ int search_binary_handler(struct linux_binprm *bprm) 50904@@ -1450,6 +1527,31 @@ int search_binary_handler(struct linux_binprm *bprm)
50875 50905
50876 EXPORT_SYMBOL(search_binary_handler); 50906 EXPORT_SYMBOL(search_binary_handler);
50877 50907
@@ -50903,7 +50933,7 @@ index 6d56ff2..3bc6638 100644
50903 /* 50933 /*
50904 * sys_execve() executes a new program. 50934 * sys_execve() executes a new program.
50905 */ 50935 */
50906@@ -1457,6 +1557,11 @@ static int do_execve_common(const char *filename, 50936@@ -1457,6 +1559,11 @@ static int do_execve_common(const char *filename,
50907 struct user_arg_ptr argv, 50937 struct user_arg_ptr argv,
50908 struct user_arg_ptr envp) 50938 struct user_arg_ptr envp)
50909 { 50939 {
@@ -50915,7 +50945,7 @@ index 6d56ff2..3bc6638 100644
50915 struct linux_binprm *bprm; 50945 struct linux_binprm *bprm;
50916 struct file *file; 50946 struct file *file;
50917 struct files_struct *displaced; 50947 struct files_struct *displaced;
50918@@ -1464,6 +1569,8 @@ static int do_execve_common(const char *filename, 50948@@ -1464,6 +1571,8 @@ static int do_execve_common(const char *filename,
50919 int retval; 50949 int retval;
50920 const struct cred *cred = current_cred(); 50950 const struct cred *cred = current_cred();
50921 50951
@@ -50924,7 +50954,7 @@ index 6d56ff2..3bc6638 100644
50924 /* 50954 /*
50925 * We move the actual failure in case of RLIMIT_NPROC excess from 50955 * We move the actual failure in case of RLIMIT_NPROC excess from
50926 * set*uid() to execve() because too many poorly written programs 50956 * set*uid() to execve() because too many poorly written programs
50927@@ -1504,12 +1611,27 @@ static int do_execve_common(const char *filename, 50957@@ -1504,12 +1613,27 @@ static int do_execve_common(const char *filename,
50928 if (IS_ERR(file)) 50958 if (IS_ERR(file))
50929 goto out_unmark; 50959 goto out_unmark;
50930 50960
@@ -50952,7 +50982,7 @@ index 6d56ff2..3bc6638 100644
50952 retval = bprm_mm_init(bprm); 50982 retval = bprm_mm_init(bprm);
50953 if (retval) 50983 if (retval)
50954 goto out_file; 50984 goto out_file;
50955@@ -1526,24 +1648,65 @@ static int do_execve_common(const char *filename, 50985@@ -1526,24 +1650,65 @@ static int do_execve_common(const char *filename,
50956 if (retval < 0) 50986 if (retval < 0)
50957 goto out; 50987 goto out;
50958 50988
@@ -51022,7 +51052,7 @@ index 6d56ff2..3bc6638 100644
51022 current->fs->in_exec = 0; 51052 current->fs->in_exec = 0;
51023 current->in_execve = 0; 51053 current->in_execve = 0;
51024 acct_update_integrals(current); 51054 acct_update_integrals(current);
51025@@ -1552,6 +1715,14 @@ static int do_execve_common(const char *filename, 51055@@ -1552,6 +1717,14 @@ static int do_execve_common(const char *filename,
51026 put_files_struct(displaced); 51056 put_files_struct(displaced);
51027 return retval; 51057 return retval;
51028 51058
@@ -51037,7 +51067,7 @@ index 6d56ff2..3bc6638 100644
51037 out: 51067 out:
51038 if (bprm->mm) { 51068 if (bprm->mm) {
51039 acct_arg_size(bprm, 0); 51069 acct_arg_size(bprm, 0);
51040@@ -1700,3 +1871,283 @@ asmlinkage long compat_sys_execve(const char __user * filename, 51070@@ -1700,3 +1873,283 @@ asmlinkage long compat_sys_execve(const char __user * filename,
51041 return error; 51071 return error;
51042 } 51072 }
51043 #endif 51073 #endif
@@ -56758,6 +56788,67 @@ index 69d4889..a810bd4 100644
56758 { 56788 {
56759 if (sbi->s_bytesex == BYTESEX_PDP) 56789 if (sbi->s_bytesex == BYTESEX_PDP)
56760 return PDP_swab((__force __u32)n); 56790 return PDP_swab((__force __u32)n);
56791diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
56792index de08c92f..732cd63 100644
56793--- a/fs/ubifs/dir.c
56794+++ b/fs/ubifs/dir.c
56795@@ -364,6 +364,24 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
56796 */
56797 return 0;
56798
56799+ if (file->f_version == 0) {
56800+ /*
56801+ * The file was seek'ed, which means that @file->private_data
56802+ * is now invalid. This may also be just the first
56803+ * 'ubifs_readdir()' invocation, in which case
56804+ * @file->private_data is NULL, and the below code is
56805+ * basically a no-op.
56806+ */
56807+ kfree(file->private_data);
56808+ file->private_data = NULL;
56809+ }
56810+
56811+ /*
56812+ * 'generic_file_llseek()' unconditionally sets @file->f_version to
56813+ * zero, and we use this for detecting whether the file was seek'ed.
56814+ */
56815+ file->f_version = 1;
56816+
56817 /* File positions 0 and 1 correspond to "." and ".." */
56818 if (file->f_pos == 0) {
56819 ubifs_assert(!file->private_data);
56820@@ -438,6 +456,14 @@ static int ubifs_readdir(struct file *file, void *dirent, filldir_t filldir)
56821 file->f_pos = key_hash_flash(c, &dent->key);
56822 file->private_data = dent;
56823 cond_resched();
56824+
56825+ if (file->f_version == 0)
56826+ /*
56827+ * The file was seek'ed meanwhile, lets return and start
56828+ * reading direntries from the new position on the next
56829+ * invocation.
56830+ */
56831+ return 0;
56832 }
56833
56834 out:
56835@@ -448,15 +474,13 @@ out:
56836
56837 kfree(file->private_data);
56838 file->private_data = NULL;
56839+ /* 2 is a special value indicating that there are no more direntries */
56840 file->f_pos = 2;
56841 return 0;
56842 }
56843
56844-/* If a directory is seeked, we have to free saved readdir() state */
56845 static loff_t ubifs_dir_llseek(struct file *file, loff_t offset, int whence)
56846 {
56847- kfree(file->private_data);
56848- file->private_data = NULL;
56849 return generic_file_llseek(file, offset, whence);
56850 }
56851
56761diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c 56852diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
56762index e18b988..f1d4ad0f 100644 56853index e18b988..f1d4ad0f 100644
56763--- a/fs/ubifs/io.c 56854--- a/fs/ubifs/io.c