diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2016-01-20 13:46:01 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2016-01-20 13:46:40 +0000 |
commit | 846dd1727054b81549d8fdf2cbec2699cb2e5e43 (patch) | |
tree | 2893349c24271614b28e5fd33069b3814159d82e /main | |
parent | be8c8499edb6dbdbff89e7f5a800c4bd092ced20 (diff) | |
download | aports-846dd1727054b81549d8fdf2cbec2699cb2e5e43.tar.bz2 aports-846dd1727054b81549d8fdf2cbec2699cb2e5e43.tar.xz |
main/linux-grsec: security fix CVE-2016-0728
Diffstat (limited to 'main')
-rw-r--r-- | main/linux-grsec/APKBUILD | 6 | ||||
-rw-r--r-- | main/linux-grsec/keys-fix-keyring-ref-leak-in-join_session_keyring.patch | 81 |
2 files changed, 86 insertions, 1 deletions
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD index 8062840405..bf11f823b7 100644 --- a/main/linux-grsec/APKBUILD +++ b/main/linux-grsec/APKBUILD @@ -7,7 +7,7 @@ case $pkgver in *.*.*) _kernver=${pkgver%.*};; *.*) _kernver=${pkgver};; esac -pkgrel=4 +pkgrel=5 pkgdesc="Linux kernel with grsecurity" url=http://grsecurity.net depends="mkinitfs" @@ -33,6 +33,7 @@ source="http://ftp.kernel.org/pub/linux/kernel/v4.x/linux-$_kernver.tar.xz 0001-ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch keys-fix-race-between-destruction-and-finding-keyring-by-name.patch keys-fixes.patch + keys-fix-keyring-ref-leak-in-join_session_keyring.patch config-grsec.x86 config-grsec.x86_64 @@ -230,6 +231,7 @@ e4590e034252bb838220d2bedc19be2e pptp-verify-sockaddr_len.patch 0ac0bfd35d8d857b790f3cf55028d967 0001-ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch 0526ef5b0cb5c8b697ab8fcd337d303e keys-fix-race-between-destruction-and-finding-keyring-by-name.patch 370b4498d0dc52eb8a85a23a5973bebf keys-fixes.patch +6470e9783bd1c7a8feddc2d67f07afd5 keys-fix-keyring-ref-leak-in-join_session_keyring.patch 8592323596689e3ef967ff96d1190d1b config-grsec.x86 81aab21a18c16cf96d0fa719564281ec config-grsec.x86_64 c4c15b3ba79bb557a67cd9356b56d7c4 config-grsec.armhf @@ -252,6 +254,7 @@ eb787ea2e4637708475569f7498c1ef0fa5e4e80ae22df5c5f44092615f86ebd kvm-svm-uncond 464fbfe582c2b841c629c78508d117108505aafdcc6fec8a2ae0b34193d04bbe 0001-ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch c3a7a6d1ca5c23c98ea703c716144dc88b5bcf5052416a7ff3c766beed78d7db keys-fix-race-between-destruction-and-finding-keyring-by-name.patch 653bdfac4fdac0fed19b60c8ae34afe97a699bbabe0e00888584c1ef52a626e1 keys-fixes.patch +c11bf7442041f2ddaf6aea62b897c0753200aa64ca0e7b9f2c9700ea16326997 keys-fix-keyring-ref-leak-in-join_session_keyring.patch fbc303521afbecbe2dccbe9955d108af53aaaa3388f2ca0962fc93f26a535a56 config-grsec.x86 0d770dbef70ec200e9f0341f7840847c228ac5e5061401614aaa27db59922614 config-grsec.x86_64 01b4f4e7eae350d40749f34e916e69c101f2fb5b3b7c2bd1917c29b8df3c2668 config-grsec.armhf @@ -274,6 +277,7 @@ d41f3b7c30d59a0fb43f877fff5a311c7fad8e12dfb51c519af368e8d1511202e6cceace3e051620 928492c522cc376abc244f9aec25b10abf0efc4cf19e5f3b7130ed8efed904e674975a05b70f3f46343dba5aa324c46981cb98eea7a619defbb7235742a3333e 0001-ovl-fix-getcwd-failure-after-unsuccessful-rmdir.patch d4d65eacdac1d9baed2ddf926f09a6d66b4dc42ea40ac9b118ad69dfd8dcc06052afb742aaf906fad54d70182d2243bdc1f0649eea7754a2402fc94447d568b1 keys-fix-race-between-destruction-and-finding-keyring-by-name.patch 2611db9cca53ac6851beb9f48e51651090e6b97a644d260671d6f4aa2b2d75ff71276b6d14d0b2e5908bc261c86fc6c2dc4bd88e093fdd74e144983c720f0a2b keys-fixes.patch +89ba4dd5bc12bc188a63d370f815573885e91f9e856c57eab4410d41033d443554a20e417b72a810024ff8b3195300edb35a2d1f4c5a9feec036b387ad1f8fe5 keys-fix-keyring-ref-leak-in-join_session_keyring.patch 819ff2d16b5c15399de9b3c254d4ed6b7ef580a5b7cdacb209d90d35d178e93e34a5d6159b0edfab4afec9decf404901a7504f7b106c62c3dba0cdb4f0951a61 config-grsec.x86 61b2f6b1264e51548c657b337a23592d7bdf0fe730f71e9039af098dd9ebd1b2bd7dbff1811ccb36c7c50b4cfef4cf19534a1f25ef05048a404fd6a6c3120a59 config-grsec.x86_64 3be2587ca157eff3910ad1cd4dd9013c699e08d6f8fdde22458caa423f17591a7b386aad5f592f79baac4da6b32f5965483c3080c1cf2bc906fdffbe33a16bf7 config-grsec.armhf diff --git a/main/linux-grsec/keys-fix-keyring-ref-leak-in-join_session_keyring.patch b/main/linux-grsec/keys-fix-keyring-ref-leak-in-join_session_keyring.patch new file mode 100644 index 0000000000..49020d7dba --- /dev/null +++ b/main/linux-grsec/keys-fix-keyring-ref-leak-in-join_session_keyring.patch @@ -0,0 +1,81 @@ +From 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2 Mon Sep 17 00:00:00 2001 +From: Yevgeny Pats <yevgeny@perception-point.io> +Date: Tue, 19 Jan 2016 22:09:04 +0000 +Subject: KEYS: Fix keyring ref leak in join_session_keyring() + +This fixes CVE-2016-0728. + +If a thread is asked to join as a session keyring the keyring that's already +set as its session, we leak a keyring reference. + +This can be tested with the following program: + + #include <stddef.h> + #include <stdio.h> + #include <sys/types.h> + #include <keyutils.h> + + int main(int argc, const char *argv[]) + { + int i = 0; + key_serial_t serial; + + serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, + "leaked-keyring"); + if (serial < 0) { + perror("keyctl"); + return -1; + } + + if (keyctl(KEYCTL_SETPERM, serial, + KEY_POS_ALL | KEY_USR_ALL) < 0) { + perror("keyctl"); + return -1; + } + + for (i = 0; i < 100; i++) { + serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, + "leaked-keyring"); + if (serial < 0) { + perror("keyctl"); + return -1; + } + } + + return 0; + } + +If, after the program has run, there something like the following line in +/proc/keys: + +3f3d898f I--Q--- 100 perm 3f3f0000 0 0 keyring leaked-keyring: empty + +with a usage count of 100 * the number of times the program has been run, +then the kernel is malfunctioning. If leaked-keyring has zero usages or +has been garbage collected, then the problem is fixed. + +Reported-by: Yevgeny Pats <yevgeny@perception-point.io> +Signed-off-by: David Howells <dhowells@redhat.com> +Acked-by: Don Zickus <dzickus@redhat.com> +Acked-by: Prarit Bhargava <prarit@redhat.com> +Acked-by: Jarod Wilson <jarod@redhat.com> +Signed-off-by: James Morris <james.l.morris@oracle.com> +--- + security/keys/process_keys.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c +index a3f85d2..e6d50172 100644 +--- a/security/keys/process_keys.c ++++ b/security/keys/process_keys.c +@@ -794,6 +794,7 @@ long join_session_keyring(const char *name) + ret = PTR_ERR(keyring); + goto error2; + } else if (keyring == new->session_keyring) { ++ key_put(keyring); + ret = 0; + goto error2; + } +-- +cgit v0.12 + |