Received: by 10.192.165.148 with SMTP id m20csp2726780imm; Sun, 6 May 2018 23:21:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqut7swIME2vyWu0vc+elCKmHnQSKxz1GBNyzHuzkOgzInOAkdaN5TxGt/kOa/0ntqzkW+b X-Received: by 2002:a63:b94a:: with SMTP id v10-v6mr29294808pgo.372.1525674097286; Sun, 06 May 2018 23:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525674097; cv=none; d=google.com; s=arc-20160816; b=KO1lmHGKkqFF/nHtGq25Cq+QtigFzUAhN7lD+eMHfpplVNZJVT3K04AO/YSJyC2Y6U roGuntubOZ5g1fTQDJ8tJFEomF8bMswv+W95g0ZetGRQdDa8JPVKNxFs8P+ehCAUI3Fw x+yIg1hvjVgkfTkedlaZhz4d65YIlp8Gk4lqndp+/B71iVj148Cyja0A/zlVsf70bsAR Pg/z26T53+1JTDXmOs10XrTgKYhfE65Lm4oJ847JgvvUKP/ATfEbU0TI3VSHAgfbXa/T VZHy8Wa6wwHUnoSJ1p25ra24X2FO2XSxcF2kFr038WOe/gbUyT+JTj16e9YvvZ9HpEmM jsjw== 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=FHPfa2YFpmiBtN+dzrspzqCrsIVr0YbCTD7+hMj/VG8=; b=Y0r/jECMEgLtpGlASz2/q85hST/uQY7I5iahiu4P58XxwveiYGCTGTIqV2jTP96muR crjynXpb9IkaFd5xBT8W/L441mT11l5IXEPDz31jJPI+fWJtkxqOxwzSL1GuJlcQxjnT 69TbZ7Znl3f+EUASEmmZtHQsbBKMEAKaKW3G9KYsfvYhZ2edzlA/dT7ImTevTfnxOhZv S794tHc9JfMoXm2GhCds0/gaJO6m48FqxvF42pem4LWiYSGI5Z+0Z1HT+ezwqhIRBqbQ 4fU/sjx2OZAsyw6GQEeBzb7KQmhriqbMLz5uwDvmroFdHTkAjLL0zS8FqZbQPVCnl9s+ Uylg== 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 68-v6si17893572pgd.511.2018.05.06.23.21.21; Sun, 06 May 2018 23:21:37 -0700 (PDT) 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 S1751924AbeEGGUp (ORCPT + 99 others); Mon, 7 May 2018 02:20:45 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:49574 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751892AbeEGGUm (ORCPT ); Mon, 7 May 2018 02:20:42 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 2A0AB201CA; Mon, 7 May 2018 08:20:40 +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 ROTIClhWmNFE; Mon, 7 May 2018 08:20:38 +0200 (CEST) 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 589ED2006E; Mon, 7 May 2018 08:20:38 +0200 (CEST) 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.389.1; Mon, 7 May 2018 08:20:37 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id D7199318244E; Mon, 7 May 2018 08:20:37 +0200 (CEST) Date: Mon, 7 May 2018 08:20:37 +0200 From: Steffen Klassert To: Dmitry Safonov CC: , <0x7f454c46@gmail.com>, Herbert Xu , Masahide NAKAMURA , YOSHIFUJI Hideaki , "David S. Miller" , Subject: Re: [PATCHv2] net/xfrm: Revert "[XFRM]: Do not add a state whose SPI is zero to the SPI hash." Message-ID: <20180507062037.kxuh2yqfu4z5rkgd@gauss3.secunet.de> References: <20180504012009.643-1-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180504012009.643-1-dima@arista.com> User-Agent: NeoMutt/20170609 (1.8.3) 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: 6C0E9F6A-719B-4F01-875B-91B44F9D2810 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 04, 2018 at 02:20:09AM +0100, Dmitry Safonov wrote: > This reverts commit 7b4dc3600e48 ("[XFRM]: Do not add a state whose SPI > is zero to the SPI hash."). > > Zero SPI is legal and defined for IPcomp. > We shouldn't omit adding the state to SPI hash because it'll not be > possible to delete or lookup for it afterward: > __xfrm_state_insert() obviously doesn't add hash for zero > SPI in xfrm.state_byspi, and xfrm_user_state_lookup() will fail as > xfrm_state_lookup() does lookups by hash. > > It also isn't possible to workaround from userspace as > xfrm_id_proto_match() will be always true for ah/esp/comp protos. > > v1 link: https://lkml.kernel.org/r/<20180502020220.2027-1-dima@arista.com> > > Cc: Masahide NAKAMURA > Cc: YOSHIFUJI Hideaki > Cc: Steffen Klassert > Cc: "David S. Miller" > Cc: netdev@vger.kernel.org > Suggested-by: Herbert Xu > Signed-off-by: Dmitry Safonov This patch does much more than reverting the commit you mentioned. It removes all the logic that is needed to handle larval SAs. The result is a disaster, all connections that are negotiated by an IKE deamon stop working. On traffic triggered connections the IKE deamon inserts a new SA for each packet that matches a policy.