Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp118295pxk; Thu, 24 Sep 2020 00:45:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqXn6JVFUnKBD+8jX9pfrQ+N+IBAJU9TIVcPhTYiaI5M+wGbBT6fk6ezcgFTfk5z4Qqm5v X-Received: by 2002:a17:907:20d0:: with SMTP id qq16mr3125770ejb.65.1600933528649; Thu, 24 Sep 2020 00:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600933528; cv=none; d=google.com; s=arc-20160816; b=0KvR2JKsYLSgvnWUejv6bkn3CVoouz7QusM86FsTDqWH7tToALJw3dTyGu34iULdh2 NHHZScKfm9+RZEBskj62vRzWhnRV5wtonnmVgfsBSqBCr+v6doXIGog91Rpdt/h59mGn euw3RIG1cxLFpSRkyncOeRCsso3BhfBPX30n+7UFmcaUxadUIf05bMhOw/J4zgh7NPJX ccuV3ZFaA6ZZhayfLuOMnc5eZ2TRJya3pH+NFhCghcWbQiKco72WJWTlfcSqxnrZSjv/ PH+X7V8p6mzS5aXH2Uvemd+R2MKb+Xn0c5atQV7u6sfCT5XanA5LeCVptP8GeSzhFD5B 6bQQ== 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=Ln3WDcPCLmXG2V6MvaHww5ddHhzSus4INM57IF+zsTQ=; b=t22p5najR2nw8M4WSZJHqSZOoBvopSHYReMOE36jcguzD65qsRzv3Pii8XBBTs0G2D O0p7YTEqo9w4vouoxUFvBPIH6LepvS52brk7KRy4GkstUhsNISLKKdtolXF5gTHvlaDP +BGOZqS32F4gQtrE4/8Ml89SjAkQA5OA0cGYtG/bcuHqsvcctzztZLi2p4piNPV478wV +ekzrYGskRPlvTsz44IGKdOhiqJMFZtfg3SRLOiYx6bMLPP4Wfr2bfTrMmrNPYzyJln6 jk69OlG+EPT530r4aHKgiZHXJ5goDGlaBx1oNMrNtn4D6qWUKROlyBQj40Ho5QmNkk1e 4DEQ== 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 z14si1387749eja.502.2020.09.24.00.45.04; Thu, 24 Sep 2020 00:45:28 -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 S1727128AbgIXHn7 (ORCPT + 99 others); Thu, 24 Sep 2020 03:43:59 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:49626 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbgIXHn7 (ORCPT ); Thu, 24 Sep 2020 03:43:59 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1kLLux-0004ri-K0; Thu, 24 Sep 2020 17:43:52 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 24 Sep 2020 17:43:51 +1000 Date: Thu, 24 Sep 2020 17:43:51 +1000 From: Herbert Xu To: Steffen Klassert Cc: syzbot , davem@davemloft.net, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: KASAN: stack-out-of-bounds Read in xfrm_selector_match (2) Message-ID: <20200924074351.GB9879@gondor.apana.org.au> References: <0000000000009fc91605afd40d89@google.com> <20200924074026.GC20687@gauss3.secunet.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200924074026.GC20687@gauss3.secunet.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 working on a fix. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt