Received: by 10.223.164.202 with SMTP id h10csp510182wrb; Wed, 15 Nov 2017 03:38:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMaNqmGC7tHubBNTcYNxKfbZ07vJfJmOJrEO1DytV1SUZugCPdl5CuyHYig7tGQTOf8bRBS0 X-Received: by 10.159.233.131 with SMTP id bh3mr9874485plb.97.1510745892349; Wed, 15 Nov 2017 03:38:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510745892; cv=none; d=google.com; s=arc-20160816; b=i33oJKxagem6VIcdl/k8v05RwzXHtEPfEqQxKVRM49eWY0D9aJO3VJb+Z9qqUT/5E5 VddKGxrS7MZBIzK8FsJQFLClVebNqOcIemno9aT6KSMxF76HqTgOpmy1+Tsr4W5mm5A0 FUgSDo/pWv99+oyGiwgfcl4WuxFaLVMftr00/ISy4SX3hwCW9FBNHFAPRJH7krAXSHw2 y7kGlr30CHmYX0NxaNq0nvn5HdTcJV1Bv5siMDd48Y4xrgN3KZaxYpEJuUfpQ9kCUGYw rP6OD0mZaEQaztAVG9vIGw0qWLmiBeQ2eq9IqKJGaeJnTjS/skZ572V7ktBqdFJLIiuV zgyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Ue3L6UYWvH4975lfA5KRo6JBjL1OUnStpJJE6x1iyEQ=; b=cSX8leMek1uW7wT6OqSWXW3Fde1dXoOpOlULy8bdunN2MjOQgIbGXD0kbiPEVsIgc3 i11YaD7ZXLttKwiQqVaRtTNwlRj836D+wc7EYDv+w+gG4uDg/lh0YQpIISb+6Wejmf3m 7n0aR1qjaU7mKQmyoCycuQfpHXkjguaUzklrIlSsiZsXvkE980XLvwNGVPTjdUCvNLQi 45waJhJ9v0J797ifneaPJbOISqUc8BED5VvhR2XpZV3k0AcgmkMEoTXzImOpq86lM7lV 9jfTphQRl2ZGXUaP0o2MnQwaqFAdTzSaDVQcTFyjA63xfkU7QN8W5F1SVIEmRHnbLT3R t5Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si4531737pgs.719.2017.11.15.03.37.59; Wed, 15 Nov 2017 03:38:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757780AbdKOLhF (ORCPT + 90 others); Wed, 15 Nov 2017 06:37:05 -0500 Received: from a.mx.secunet.com ([62.96.220.36]:57150 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752860AbdKOLg6 (ORCPT ); Wed, 15 Nov 2017 06:36:58 -0500 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 96D76201C2; Wed, 15 Nov 2017 12:36:57 +0100 (CET) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J8wj4ArIo9Wr; Wed, 15 Nov 2017 12:36:57 +0100 (CET) Received: from mail-essen-01.secunet.de (mail-essen-01.secunet.de [10.53.40.204]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 28C18201B4; Wed, 15 Nov 2017 12:36:57 +0100 (CET) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.361.1; Wed, 15 Nov 2017 12:36:56 +0100 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 8D0BF140342; Wed, 15 Nov 2017 12:36:56 +0100 (CET) Date: Wed, 15 Nov 2017 12:36:56 +0100 From: Steffen Klassert To: Florian Westphal CC: syzbot , , , , , , Subject: Re: KASAN: stack-out-of-bounds Read in xfrm_state_find (2) Message-ID: <20171115113656.GU11292@secunet.com> References: <20171101220608.GA9424@breakpoint.cc> <20171102103237.GL11292@secunet.com> <20171102122528.GB9424@breakpoint.cc> <20171103121012.GA23855@secunet.com> <20171106101646.GG23855@secunet.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20171106101646.GG23855@secunet.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: 8246F3AC-CF00-47F4-A508-ECD1EA994965 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 06, 2017 at 11:16:46AM +0100, Steffen Klassert wrote: > > Subject: [PATCH ipsec] xfrm: Fix stack-out-of-bounds read in xfrm_state_find. > > 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 using the addresses > from the template unconditionally. > > Signed-off-by: Steffen Klassert I had to revert this, it broke transport mode when the policy template has no src and dst addresses configured. I'll come up with some other fix, probably don't do policy/flow maching when a socket policies address family does not match the flow address family. This should hopefully fix this whole class of IPv4 mapped IPv6 with socket policy bugs. From 1583312393931350440@xxx Mon Nov 06 10:32:44 +0000 2017 X-GM-THRID: 1582886692223881834 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread