Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp126131pxk; Thu, 24 Sep 2020 01:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAi5jqXguHXEOJTg6vnIN4K0zlvQso//baSz2ZcqCzaJDYdD2cH1lSMVJTnP7/R1ePH03z X-Received: by 2002:a17:906:2b4f:: with SMTP id b15mr3419648ejg.477.1600934621464; Thu, 24 Sep 2020 01:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600934621; cv=none; d=google.com; s=arc-20160816; b=dohOhdb2Ay73IHD0sQhg+AnuOJxL0VRIYyAS8kVmdvqi3u8Ucw2qwZHkERClfGKMEH GAJe/fgZLImXklVklfC7WfNSDybkzKhyrwHiEQ3lICa0+jgpZng1hec36bKVtwWlGZ6t jqzMPSsa/1hxuZ3h7WuzGqCXbA5x9tMFMQuGrDj3CCM4QD3tnA+xkp2+KkaHZNNerVXx SLcK21zJwfoz5BgRoU716pXaq9GxUBmTWafFcIFxW6QS5elewb98xu7bSMD4iVwcTig7 RiNbq9bN54QJwG1uzV6adByyYmrJh1F1orMlgZgfvWjAaE24Hp9DK/zsBB95zPlmC2Ud ogBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=C02AaUZKbd/WlwyDggGwWx59N10z0jGtUiz5zdJqUzE=; b=wkyO9oMsVwqj2TftQtlLm88WlqrHXuBqwLjujmh9AL4/WH3RLLkg5P8OaVWNO2mDkz +oWNRoMDG40LLE4V8H//uZGUu55NOm0un57PYVR2FF8GAIqRBlhds56ucoP/mJN4OBNi WixuQ5hDULxhfyjfkoSRR+RjqZXw+RJosEUKdqTM1moWOeBIhkLQQwJAo4G7G9dmDobC bp/8ymuWRisdaDd9XTEOiTBuN+Cg9Ki+8tWiC5mQJooFl9Va5Jc8Z886uVvix2A6tRAc aaiSni6S1z+F7LCGaEOci9UdR1cheYVQawzYrGnKhL/xEAWU/WVzBtXj4ba139FAqiJq G4/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si1401208ejv.661.2020.09.24.01.03.09; Thu, 24 Sep 2020 01:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727219AbgIXICJ (ORCPT + 99 others); Thu, 24 Sep 2020 04:02:09 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:45656 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbgIXICJ (ORCPT ); Thu, 24 Sep 2020 04:02:09 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 0EDFC2054D; Thu, 24 Sep 2020 10:02:07 +0200 (CEST) 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 N2Hha3N5lro5; Thu, 24 Sep 2020 10:02:06 +0200 (CEST) Received: from mail-essen-02.secunet.de (unknown [10.53.40.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 94CD62026E; Thu, 24 Sep 2020 10:02:06 +0200 (CEST) Received: from mbx-essen-01.secunet.de (10.53.40.197) by mail-essen-02.secunet.de (10.53.40.205) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 24 Sep 2020 10:02:06 +0200 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-01.secunet.de (10.53.40.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Thu, 24 Sep 2020 10:02:06 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 0ADA23180126; Thu, 24 Sep 2020 10:02:06 +0200 (CEST) Date: Thu, 24 Sep 2020 10:02:05 +0200 From: Steffen Klassert To: Herbert Xu CC: syzbot , , , , , Subject: Re: KASAN: stack-out-of-bounds Read in xfrm_selector_match (2) Message-ID: <20200924080205.GD20687@gauss3.secunet.de> References: <0000000000009fc91605afd40d89@google.com> <20200924074026.GC20687@gauss3.secunet.de> <20200924074351.GB9879@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200924074351.GB9879@gondor.apana.org.au> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: cas-essen-01.secunet.de (10.53.40.201) To mbx-essen-01.secunet.de (10.53.40.197) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 24, 2020 at 05:43:51PM +1000, Herbert Xu wrote: > On Thu, Sep 24, 2020 at 09:40:26AM +0200, Steffen Klassert wrote: > > > > This is yet another ipv4 mapped ipv6 address with IPsec socket policy > > combination bug, and I'm sure it is not the last one. We could fix this > > one by adding another check to match the address family of the policy > > and the SA selector, but maybe it is better to think about how this > > should work at all. > > > > We can have only one socket policy for each direction and that > > policy accepts either ipv4 or ipv6. We treat this ipv4 mapped ipv6 > > address as ipv4 and pass it down the ipv4 stack, so this dual usage > > will not work with a socket policy. Maybe we can require IPV6_V6ONLY > > for sockets with policy attached. Thoughts? > > I'm looking at the history of this and it used to work at the start > because you'd always interpret the flow object with a family. This > appears to have been lost with 8444cf712c5f71845cba9dc30d8f530ff0d5ff83. I'm sure it can be fixed to work with either ipv4 or ipv6. If I understand that right, it should be possible to talk ipv4 and ipv6 through that socket, but the policy will accept only one address family. > I'm working on a fix. Thanks!