From def6213f6561001ec35a5536d09537ea61440d97 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Tue, 18 Oct 2016 22:39:50 -0400 Subject: gnu: Add libseccomp. * gnu/packages/linux.scm (libseccomp): New variable. --- gnu/packages/linux.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 08fd7ac9bb..2d82093371 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3018,3 +3018,28 @@ of flash storage.") (list license:gpl2 ; Almost everything is gpl2 or gpl2+ license:mpl1.1 ; All ftl* files license:expat)))) ; libiniparser + +(define-public libseccomp + (package + (name "libseccomp") + (version "2.3.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/seccomp/libseccomp/" + "releases/download/v" version + "/libseccomp-" version ".tar.gz")) + (sha256 + (base32 + "0asnlkzqms520r0dra08dzcz5hh6hs7lkajfw9wij3vrd0hxsnzz")))) + (build-system gnu-build-system) + (native-inputs + `(("which" ,which))) + (synopsis "Interface to Linux's seccomp syscall filtering mechanism") + (description "The libseccomp library provides an easy to use, platform +independent, interface to the Linux Kernel's syscall filtering mechanism. The +libseccomp API is designed to abstract away the underlying BPF based syscall +filter language and present a more conventional function-call based filtering +interface that should be familiar to, and easily adopted by, application +developers.") + (home-page "https://github.com/seccomp/libseccomp") + (license license:lgpl2.1))) -- cgit v1.2.3 From c17b5986f2fd6ebf100d1a2e6de85b9b5a98b463 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 19 Oct 2016 01:00:03 +0200 Subject: gnu: mcelog: Update to 143. * gnu/packages/linux.scm (mcelog): Update to 143. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 2d82093371..eeafa717d1 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2952,14 +2952,14 @@ the default @code{nsswitch} and the experimental @code{umich_ldap}.") (define-public mcelog (package (name "mcelog") - (version "142") + (version "143") (source (origin (method url-fetch) (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/" "mcelog.git/snapshot/v" version ".tar.gz")) (sha256 (base32 - "15a9hllwj32l1zh7x4swx8985x6nqrplvxjyfdsqysxw2pk6pixr")) + "1mn5i1d6ybfxqgr6smlpxcx1wb53h0r2rp90ild7919b9yqxpk0x")) (file-name (string-append name "-" version ".tar.gz")) (modules '((guix build utils))) (snippet -- cgit v1.2.3 From 88576735bf4251ec893b93812021a54816f79be3 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 20 Oct 2016 17:24:00 -0400 Subject: gnu: linux-libre: Update to 4.8.3. * gnu/packages/linux.scm (%linux-libre-version, %linux-libre-hash) (linux-libre): Update to 4.8.3. --- gnu/packages/linux.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index eeafa717d1..6fe62e497e 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -323,8 +323,8 @@ It has been modified to remove all non-free binary blobs.") (define %intel-compatible-systems '("x86_64-linux" "i686-linux")) (define-public linux-libre - (make-linux-libre "4.8.2" - "111v014j9b2zgyhv8f0aka5lmyc3imdc5yag7azw6hv3vjqqkn67" + (make-linux-libre "4.8.3" + "0plsy54rfk293f4f0sl1667lzbs3gchrf9sx0ghrq85w49d5ag61" %intel-compatible-systems #:configuration-file kernel-config)) @@ -341,8 +341,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) ;; Avoid rebuilding kernel variants when there is a minor version bump. -(define %linux-libre-version "4.8.2") -(define %linux-libre-hash "111v014j9b2zgyhv8f0aka5lmyc3imdc5yag7azw6hv3vjqqkn67") +(define %linux-libre-version "4.8.3") +(define %linux-libre-hash "0plsy54rfk293f4f0sl1667lzbs3gchrf9sx0ghrq85w49d5ag61") (define-public linux-libre-arm-generic (make-linux-libre %linux-libre-version -- cgit v1.2.3 From 5d5cdb7ca40a7dee2047de90040f41ece83d7948 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 20 Oct 2016 17:39:48 -0400 Subject: gnu: linux-libre-4.4: Update to 4.4.26. * gnu/packages/linux.scm (linux-libre): Update to 4.4.26. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 6fe62e497e..07c25e2443 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -329,8 +329,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.4 - (make-linux-libre "4.4.25" - "1a677h8vvjkbzqwnklqnjvhq33lwig5z453dwi125zzzvawgr463" + (make-linux-libre "4.4.26" + "0i3mgcf6y7266sh2zffbk0jgi8s9sjhvi6c21vn1v5rl72xz7a15" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 64de7d1ceb863ad5cebd6ea266de704eac7dea7d Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 22 Oct 2016 00:22:31 -0400 Subject: gnu: make-linux-libre: Add #:patches keyword argument. * gnu/packages/linux.scm (make-linux-libre): Add 'patches' keyword argument. --- gnu/packages/linux.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 07c25e2443..4c64bbe1db 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -220,7 +220,8 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." (extra-version #f) (configuration-file #f) (defconfig "defconfig") - (extra-options %default-extra-linux-options)) + (extra-options %default-extra-linux-options) + (patches (list %boot-logo-patch))) (package (name (if extra-version (string-append "linux-libre-" extra-version) @@ -230,7 +231,7 @@ for ARCH and optionally VARIANT, or #f if there is no such configuration." (method url-fetch) (uri (linux-libre-urls version)) (sha256 (base32 hash)) - (patches (list %boot-logo-patch)))) + (patches patches))) (supported-systems supported-systems) (build-system gnu-build-system) (native-inputs -- cgit v1.2.3 From a861665b75cb0e727204370aaa43d373ecec3a5a Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 22 Oct 2016 00:24:51 -0400 Subject: gnu: linux-libre@4.1: Add fix for CVE-2016-5195. * gnu/packages/patches/linux-libre-4.1-CVE-2016-5195.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/linux.scm (linux-libre-4.1): Add patch. --- gnu/local.mk | 1 + gnu/packages/linux.scm | 5 +- .../patches/linux-libre-4.1-CVE-2016-5195.patch | 99 ++++++++++++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/linux-libre-4.1-CVE-2016-5195.patch (limited to 'gnu/packages/linux.scm') diff --git a/gnu/local.mk b/gnu/local.mk index c6cd5869d2..cfd44803f3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -680,6 +680,7 @@ dist_patch_DATA = \ %D%/packages/patches/libxv-CVE-2016-5407.patch \ %D%/packages/patches/libxvmc-CVE-2016-7953.patch \ %D%/packages/patches/libxslt-generated-ids.patch \ + %D%/packages/patches/linux-libre-4.1-CVE-2016-5195.patch \ %D%/packages/patches/lirc-localstatedir.patch \ %D%/packages/patches/llvm-for-extempore.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 4c64bbe1db..f5f683dd69 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -339,7 +339,10 @@ It has been modified to remove all non-free binary blobs.") (make-linux-libre "4.1.34" "0dajsb363p9lgga22ml8gp9k9lxd8mvrzxk9y3h9c6hpzfcmqdqr" %intel-compatible-systems - #:configuration-file kernel-config)) + #:configuration-file kernel-config + #:patches (list %boot-logo-patch + (search-patch + "linux-libre-4.1-CVE-2016-5195.patch")))) ;; Avoid rebuilding kernel variants when there is a minor version bump. (define %linux-libre-version "4.8.3") diff --git a/gnu/packages/patches/linux-libre-4.1-CVE-2016-5195.patch b/gnu/packages/patches/linux-libre-4.1-CVE-2016-5195.patch new file mode 100644 index 0000000000..37a41f61e4 --- /dev/null +++ b/gnu/packages/patches/linux-libre-4.1-CVE-2016-5195.patch @@ -0,0 +1,99 @@ +Fix CVE-2016-5195, a.k.a. Dirty COW. +Backported to linux-libre-4.1.x by Mark H Weaver . + +From 18652320ea99913c95e7130d654be7f1da6b694f Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Thu, 13 Oct 2016 13:07:36 -0700 +Subject: [PATCH] mm: remove gup_flags FOLL_WRITE games from __get_user_pages() + +commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 upstream. + +This is an ancient bug that was actually attempted to be fixed once +(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix +get_user_pages() race for write access") but that was then undone due to +problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug"). + +In the meantime, the s390 situation has long been fixed, and we can now +fix it by checking the pte_dirty() bit properly (and do it better). The +s390 dirty bit was implemented in abf09bed3cce ("s390/mm: implement +software dirty bits") which made it into v3.9. Earlier kernels will +have to look at the page state itself. + +Also, the VM has become more scalable, and what used a purely +theoretical race back then has become easier to trigger. + +To fix it, we introduce a new internal FOLL_COW flag to mark the "yes, +we already did a COW" rather than play racy games with FOLL_WRITE that +is very fundamental, and then use the pte dirty flag to validate that +the FOLL_COW flag is still valid. + +Reported-and-tested-by: Phil "not Paul" Oester +Acked-by: Hugh Dickins +Reviewed-by: Michal Hocko +Cc: Andy Lutomirski +Cc: Kees Cook +Cc: Oleg Nesterov +Cc: Willy Tarreau +Cc: Nick Piggin +Cc: Greg Thelen +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/mm.h | 1 + + mm/gup.c | 14 ++++++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/include/linux/mm.h b/include/linux/mm.h +index 6b85ec6..7cadf0a 100644 +--- a/include/linux/mm.h ++++ b/include/linux/mm.h +@@ -2064,6 +2064,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma, + #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ + #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ + #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ ++#define FOLL_COW 0x4000 /* internal GUP flag */ + + typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, + void *data); +diff --git a/mm/gup.c b/mm/gup.c +index 6297f6b..e6de9e7 100644 +--- a/mm/gup.c ++++ b/mm/gup.c +@@ -32,6 +32,16 @@ static struct page *no_page_table(struct vm_area_struct *vma, + return NULL; + } + ++/* ++ * FOLL_FORCE can write to even unwritable pte's, but only ++ * after we've gone through a COW cycle and they are dirty. ++ */ ++static inline bool can_follow_write_pte(pte_t pte, unsigned int flags) ++{ ++ return pte_write(pte) || ++ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte)); ++} ++ + static struct page *follow_page_pte(struct vm_area_struct *vma, + unsigned long address, pmd_t *pmd, unsigned int flags) + { +@@ -66,7 +76,7 @@ retry: + } + if ((flags & FOLL_NUMA) && pte_protnone(pte)) + goto no_page; +- if ((flags & FOLL_WRITE) && !pte_write(pte)) { ++ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags)) { + pte_unmap_unlock(ptep, ptl); + return NULL; + } +@@ -315,7 +325,7 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, + * reCOWed by userspace write). + */ + if ((ret & VM_FAULT_WRITE) && !(vma->vm_flags & VM_WRITE)) +- *flags &= ~FOLL_WRITE; ++ *flags |= FOLL_COW; + return 0; + } + +-- +2.10.1 + -- cgit v1.2.3 From 62cf3ae09b82030a83ab61c8b7adaed81ad04b92 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 23 Oct 2016 00:18:42 -0400 Subject: gnu: linux-libre@4.4: Update to 4.4.27. * gnu/packages/linux.scm (linux-libre-4.4): Update to 4.4.27. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index f5f683dd69..b23a6521b2 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -330,8 +330,8 @@ It has been modified to remove all non-free binary blobs.") #:configuration-file kernel-config)) (define-public linux-libre-4.4 - (make-linux-libre "4.4.26" - "0i3mgcf6y7266sh2zffbk0jgi8s9sjhvi6c21vn1v5rl72xz7a15" + (make-linux-libre "4.4.27" + "07g0y8zbspw8d65386llcsnqlbv2s24dxvvbwm9kwm87rk3vin1r" %intel-compatible-systems #:configuration-file kernel-config)) -- cgit v1.2.3 From 35680748a6eb15bd1443e7fcae086eee964f0efc Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 23 Oct 2016 00:21:20 -0400 Subject: gnu: linux-libre: Update to 4.8.4. * gnu/packages/linux.scm (%linux-libre-version, %linux-libre-hash) (linux-libre): Update to 4.8.4. --- gnu/packages/linux.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnu/packages/linux.scm') diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b23a6521b2..616423aef7 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -324,8 +324,8 @@ It has been modified to remove all non-free binary blobs.") (define %intel-compatible-systems '("x86_64-linux" "i686-linux")) (define-public linux-libre - (make-linux-libre "4.8.3" - "0plsy54rfk293f4f0sl1667lzbs3gchrf9sx0ghrq85w49d5ag61" + (make-linux-libre "4.8.4" + "06fb2b1y7w0ixq4savn3hddp326mmzmg3400dpr8lyg919bwck3x" %intel-compatible-systems #:configuration-file kernel-config)) @@ -345,8 +345,8 @@ It has been modified to remove all non-free binary blobs.") "linux-libre-4.1-CVE-2016-5195.patch")))) ;; Avoid rebuilding kernel variants when there is a minor version bump. -(define %linux-libre-version "4.8.3") -(define %linux-libre-hash "0plsy54rfk293f4f0sl1667lzbs3gchrf9sx0ghrq85w49d5ag61") +(define %linux-libre-version "4.8.4") +(define %linux-libre-hash "06fb2b1y7w0ixq4savn3hddp326mmzmg3400dpr8lyg919bwck3x") (define-public linux-libre-arm-generic (make-linux-libre %linux-libre-version -- cgit v1.2.3