lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180110113242.zo5eazwccsr6yng4@gauss3.secunet.de>
Date:   Wed, 10 Jan 2018 12:32:42 +0100
From:   Steffen Klassert <steffen.klassert@...unet.com>
To:     Darius Ski <darius.ski@...il.com>
CC:     <netdev@...r.kernel.org>
Subject: Re: BUG: 4.14.6 unable to handle kernel NULL pointer dereference at
 xfrm_output_resume

On Wed, Jan 10, 2018 at 12:42:47PM +0200, Darius Ski wrote:
> Hi,
> 
> On Fri, Jan 5, 2018 at 11:38 AM, Steffen Klassert
> <steffen.klassert@...unet.com> wrote:
> > On Tue, Dec 19, 2017 at 10:50:42AM +0200, Darius Ski wrote:
> >> Hi,
> >>
> >> thanks a lot for the patch. I have applied it to 4.14.7 and crossed
> >> fingers, hopefully no more problems.
> >>
> >> I will let community know if there are any more crashes.
> >
> > Any news on this, did the patch help?
> 
> sorry for the late response, i was on vacation. There were no crashes
> since the patch was applied 22 days ago, so i guess the patch is
> golden.

Thanks for testing, the patch below will go to the ipsec tree.

Subject: [PATCH ipsec] xfrm: Fix a race in the xdst pcpu cache.

We need to run xfrm_resolve_and_create_bundle() with
bottom halves off. Otherwise we may reuse an already
released dst_enty when the xfrm lookup functions are
called from process context.

Fixes: c30d78c14a813db39a647b6a348b428 ("xfrm: add xdst pcpu cache")
Reported-by: Darius Ski <darius.ski@...il.com>
Signed-off-by: Steffen Klassert <steffen.klassert@...unet.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 bc5eae12fb09..bd6b0e7a0ee4 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2063,8 +2063,11 @@ xfrm_bundle_lookup(struct net *net, const struct flowi *fl, u16 family, u8 dir,
 	if (num_xfrms <= 0)
 		goto make_dummy_bundle;
 
+	local_bh_disable();
 	xdst = xfrm_resolve_and_create_bundle(pols, num_pols, fl, family,
-						  xflo->dst_orig);
+					      xflo->dst_orig);
+	local_bh_enable();
+
 	if (IS_ERR(xdst)) {
 		err = PTR_ERR(xdst);
 		if (err != -EAGAIN)
@@ -2151,9 +2154,12 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
 				goto no_transform;
 			}
 
+			local_bh_disable();
 			xdst = xfrm_resolve_and_create_bundle(
 					pols, num_pols, fl,
 					family, dst_orig);
+			local_bh_enable();
+
 			if (IS_ERR(xdst)) {
 				xfrm_pols_put(pols, num_pols);
 				err = PTR_ERR(xdst);
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ