From 7ad4f111f4b1e988f621c98034bf42f8e58641a5 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 8 Feb 2018 10:27:18 -0800 Subject: Updated to 4.15.2.a --- ...017-8824-dccp-use-after-free-in-DCCP-code.patch | 42 - PKGBUILD | 36 +- config.x86_64 | 2740 ++++++++++++++------ ...ut-of-bounds-read-on-socket-policy-lookup.patch | 53 - 4 files changed, 1927 insertions(+), 944 deletions(-) delete mode 100644 CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch delete mode 100644 xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-lookup.patch diff --git a/CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch b/CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch deleted file mode 100644 index b033485..0000000 --- a/CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 69c64866ce072dea1d1e59a0d61e0f66c0dffb76 Mon Sep 17 00:00:00 2001 -From: Mohamed Ghannam -Date: Tue, 5 Dec 2017 20:58:35 +0000 -Subject: [PATCH] dccp: CVE-2017-8824: use-after-free in DCCP code - -Whenever the sock object is in DCCP_CLOSED state, -dccp_disconnect() must free dccps_hc_tx_ccid and -dccps_hc_rx_ccid and set to NULL. - -Signed-off-by: Mohamed Ghannam -Reviewed-by: Eric Dumazet -Signed-off-by: David S. Miller ---- - net/dccp/proto.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/net/dccp/proto.c b/net/dccp/proto.c -index b68168fcc06a..9d43c1f40274 100644 ---- a/net/dccp/proto.c -+++ b/net/dccp/proto.c -@@ -259,6 +259,7 @@ int dccp_disconnect(struct sock *sk, int flags) - { - struct inet_connection_sock *icsk = inet_csk(sk); - struct inet_sock *inet = inet_sk(sk); -+ struct dccp_sock *dp = dccp_sk(sk); - int err = 0; - const int old_state = sk->sk_state; - -@@ -278,6 +279,10 @@ int dccp_disconnect(struct sock *sk, int flags) - sk->sk_err = ECONNRESET; - - dccp_clear_xmit_timers(sk); -+ ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); -+ ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); -+ dp->dccps_hc_rx_ccid = NULL; -+ dp->dccps_hc_tx_ccid = NULL; - - __skb_queue_purge(&sk->sk_receive_queue); - __skb_queue_purge(&sk->sk_write_queue); --- -2.15.1 - diff --git a/PKGBUILD b/PKGBUILD index 3074342..037be37 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,8 +4,8 @@ # Contributor: Thomas Baechler pkgbase=linux-libre-hardened -_majver=4.14 -_minver=17 +_majver=4.15 +_minver=2 _fullver=${_majver}.${_minver} _basever=${_majver}-gnu _pkgver=${_fullver}-gnu @@ -26,31 +26,27 @@ source=(https://linux-libre.fsfla.org/pub/linux-libre/releases/${_basever}/linux 90-linux.hook # pacman hook for initramfs regeneration linux.preset # standard config files for mkinitcpio ramdisk - # https://bugs.archlinux.org/task/56605 - xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-lookup.patch # https://bugs.archlinux.org/task/56711 drm-i915-edp-Only-use-the-alternate-fixed-mode-if-its-asked-for.patch - CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch ) -sha256sums=('70f0098d823472402619a053211532423d15bfef628de7f49616014c81658278' +sha256sums=('e6556514286f9cd6b46f5d5769b2cc3c61ac7d6fa9c9c400e3c2fb5949490186' 'SKIP' - 'a7569d770004cefbcf98d6d70ce3c9012463d13491dd8678391bdb97faafb790' + '81ec59f4d123f7b8bb358c765b4cae32979c6859816641f4830e6c87dc974875' 'SKIP' - '77b6c3188a029d3a03164b2ca75bcd9781ea8a32b1e021114667e4a39c1b4bd1' + 'c8a0c7fc3ef0ea4d7fe6f786b9987952e62c6bce7e3b20002358848c2117cfd9' 'SKIP' - '50184a1ffa47bf180952175968d22c0153ba2e916f55563858c2614e1f249213' + '7c5a6ece4e49755cc4f96251788610afbea6c6b2b4afd582dfca0f0879f8082a' 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919' 'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65' - '294c928b8252112d621df1d13fbfeade13f28ddea034d44e89db41b66d2b7d45' - 'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148' - '6be803c62b7ce41f1b4de6c867715398812b1c1a3e68a0078512f2872e2a3fa9') + 'c08d12c699398ef88b764be1837b9ee11f2efd3188bd1bf4e8f85dfbeee58148') validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva '65EEFE022108E2B708CBFCF7F9E712E59AF5F22A' # Daniel Micay ) _kernelname=${pkgbase#linux-libre} +: ${_kernelname:=-ARCH} prepare() { cd ${_srcname} @@ -58,8 +54,6 @@ prepare() { # add upstream patch msg2 "Applying upstream patch" patch -p1 -i "${srcdir}/patch-${_basever}-${_pkgver}" - # XXX: GNU patch doesn't support git-style file mode - chmod +x tools/objtool/sync-check.sh # Hotfixes patch -p1 -i "${srcdir}/CVE-2017-8824-dccp-use-after-free-in-DCCP-code.patch" @@ -73,15 +67,13 @@ prepare() { # add latest fixes from stable queue, if needed # http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git - cp -Tf ../config.${CARCH} .config - - if [ "${_kernelname}" != "" ]; then - sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config - sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config - fi + cat ../config.x86_64 - >.config < -X-Patchwork-Id: 852277 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20171222094501.23345-5-steffen.klassert@secunet.com> -To: David Miller -Cc: Herbert Xu , - Steffen Klassert , -Date: Fri, 22 Dec 2017 10:44:57 +0100 -From: Steffen Klassert -List-Id: - -When we do tunnel or beet mode, we pass saddr and daddr from the -template to xfrm_state_find(), this is ok. On transport mode, -we pass the addresses from the flowi, assuming that the IP -addresses (and address family) don't change during transformation. -This assumption is wrong in the IPv4 mapped IPv6 case, packet -is IPv4 and template is IPv6. - -Fix this by catching address family missmatches of the policy -and the flow already before we do the lookup. - -Reported-by: syzbot -Signed-off-by: Steffen Klassert ---- - net/xfrm/xfrm_policy.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c -index 9542975eb2f9..038ec68f6901 100644 ---- a/net/xfrm/xfrm_policy.c -+++ b/net/xfrm/xfrm_policy.c -@@ -1168,9 +1168,15 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir, - again: - pol = rcu_dereference(sk->sk_policy[dir]); - if (pol != NULL) { -- bool match = xfrm_selector_match(&pol->selector, fl, family); -+ bool match; - int err = 0; - -+ if (pol->family != family) { -+ pol = NULL; -+ goto out; -+ } -+ -+ match = xfrm_selector_match(&pol->selector, fl, family); - if (match) { - if ((sk->sk_mark & pol->mark.m) != pol->mark.v) { - pol = NULL; -- cgit v1.2.1