diff options
author | David P <megver83@parabola.nu> | 2018-01-05 23:42:45 -0300 |
---|---|---|
committer | David P <megver83@parabola.nu> | 2018-01-05 23:42:45 -0300 |
commit | dba7d654b0f3fc1cf9a749467464016fc7b2b13b (patch) | |
tree | d2f421d6c6d4e15ac65a2ef80d6c2d0365573900 /libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch | |
parent | ea466373788409c3db888022adc1fff3c63a8d79 (diff) | |
download | abslibre-dba7d654b0f3fc1cf9a749467464016fc7b2b13b.tar.gz abslibre-dba7d654b0f3fc1cf9a749467464016fc7b2b13b.tar.bz2 abslibre-dba7d654b0f3fc1cf9a749467464016fc7b2b13b.zip |
libre/linux-libre: add Arch Linux security patches and fix objtool issue
Diffstat (limited to 'libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch')
-rw-r--r-- | libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch b/libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch new file mode 100644 index 000000000..edd7b24a3 --- /dev/null +++ b/libre/linux-libre/0005-xfrm-Fix-stack-out-of-bounds-read-on-socket-policy-l.patch @@ -0,0 +1,49 @@ +From 3721d64246982f91a5bf863fc17ac60ff722e0c4 Mon Sep 17 00:00:00 2001 +Message-Id: <3721d64246982f91a5bf863fc17ac60ff722e0c4.1514959852.git.jan.steffens@gmail.com> +In-Reply-To: <fb89d912d5f7289d3a922c77b671e36e1c740f5e.1514959852.git.jan.steffens@gmail.com> +References: <fb89d912d5f7289d3a922c77b671e36e1c740f5e.1514959852.git.jan.steffens@gmail.com> +From: Steffen Klassert <steffen.klassert@secunet.com> +Date: Fri, 22 Dec 2017 10:44:57 +0100 +Subject: [PATCH 5/7] xfrm: Fix stack-out-of-bounds read on socket policy + lookup. + +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 <syzkaller@googlegroups.com> +Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> +--- + 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 6bc16bb61b5533ef..50c5f46b5cca942e 100644 +--- a/net/xfrm/xfrm_policy.c ++++ b/net/xfrm/xfrm_policy.c +@@ -1169,9 +1169,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; +-- +2.15.1 + |