Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2687998rwa; Mon, 22 Aug 2022 11:49:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4+FL0CMoxkDaVdIuHx7kExUR6/bEU69dhmaUbg8Q7huXfZsIKVwm/gm9qBUBrKnt6C845+ X-Received: by 2002:a17:90b:3e8a:b0:1fb:27a0:c39b with SMTP id rj10-20020a17090b3e8a00b001fb27a0c39bmr7866352pjb.155.1661194173216; Mon, 22 Aug 2022 11:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661194173; cv=none; d=google.com; s=arc-20160816; b=H4ZhOzCXuy77T2bkGnZVQDko/bLfZ9dLRbX0tCYxGfGHtmD6AkAo3DLkIRBgSqKajg VGvdKEKbkrpHLT0S45SBIFPJRyZiMTrk7+4mxdeJNkygHM0AhluboBnPEpvJOW+K9pAn nUFZexkiQrZa8Uxdbs074s2y2lnIoiuCqdy8Aopc+lNFXkXFUQH877Us2QAAXDm3Ml8Y awDQCUWZTR9lNgm4xh3bD8OdLcXVZGHdGRtFxOwjHlnMwOJLiRg4LT4zahcXq58drHtP lJrwxQ+ZOy8S1ViRuyJmQsOyCYD0BSHtpoCYIWqnKtoq5LJ7mlOV0eRcFR4GSCFoTI6p QdHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=skzCG58l+HqXhjJKQO4lGgqfYIra8NXlt0XqK+Dm+co=; b=vCKMdVsRQTUIu7oWAmhvDsyG4l89rMLQJi9ZGegXwmc8VLm0oVllbK91RNtyE5gIUH 4F2eIw0vR+gYcuVHp8x6HIJ1ICfdm/Nlzn/MLp7JyS7+AjBCiRYvPoqmYxxUsPL/tohl W/E13CH4yPWn3Cx7u3Uw28FiO4Bh34k6z39gNRNI/4KmkKZG5ORPTLZJYL43/zi08fdi T7G3NjduoL1DdRRt5U+bHA49rfyWFTUGZcd0yWmigQAHMw/PBWYcjEJze759fiYb9S1F 2ronLieb9oSc6yUiy4F09BPTBJYnxkE2b/eoxPgCNJgvPfqigYBn8yBneSiwlohrGPMw yS+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=dx3NiSAt; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a1709027e8600b00172bb8cb613si681708pla.377.2022.08.22.11.49.09; Mon, 22 Aug 2022 11:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=dx3NiSAt; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237725AbiHVSpD (ORCPT + 99 others); Mon, 22 Aug 2022 14:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237666AbiHVSos (ORCPT ); Mon, 22 Aug 2022 14:44:48 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40600BE16 for ; Mon, 22 Aug 2022 11:42:47 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso8289557wma.2 for ; Mon, 22 Aug 2022 11:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=skzCG58l+HqXhjJKQO4lGgqfYIra8NXlt0XqK+Dm+co=; b=dx3NiSAtEGzJGfO8Eei9gt+WPU+TFmsqSP8lo8aUcEY9SRecb90LQhJLHXFxWBkz+K uebpZQ4QXAOzd1RmygSNSxE23ik1uofISPNpbwlPoZfs2hMc6aQoCuRVi5AbfJAoR59q F9SOivk2DtOGDfzREl9zsRfm5Tuy1D9SB/efL3oVI/bLQ8MkeFByzi7UT7PF/VBZs+QD pIsOBvF1hgJtGo1jIay6ibiSM5JR1GeaGaqKUtL2+5Ir51iBZ47BTHpdQgE4G94u03k+ z6brz9tx8VhuGIVUNGCckUNXmMco6QjXmzOJgpqYy8s/KbM3hDDipepQjHuerXJqjGSQ 6AWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=skzCG58l+HqXhjJKQO4lGgqfYIra8NXlt0XqK+Dm+co=; b=un3OwcHupr+L9hSBl3mR0TXT+ebiHDEKSVeUkBQCH8LBMFoNmSoJqIDSOXesHjY4NJ 6RQPq084K8/1ZYzVKGMkoMmLYVGCykP7apc0DoYigYp6u8n7lH/JKTQsefjDBcCvyIZ3 icnMqbu2UiVkIkyHPVQVW/1J8pxPrIAiCVOf7GOSBUzbo5ZmAGkIYzn7fwSH1sah25Zt sQgT1resGLNFuATGH6MhxP6aV4PZU/t11pwmWUarVeqoLsMFSBLQgFYwurJRscsXBHvq tDAIXC+t34Pud2UsF9gcKGohvbqwHqHFmJap6FLCSQaiRJF/wB3IdvsAWfBPzCZ5BeA+ Be0g== X-Gm-Message-State: ACgBeo0exVGBaH/IH4ZHxHSkKU9a/l5sMm64ez/MP2xBX1ddG1xD6Ve+ wr7o6DvigiM3fEE1avzK6gdXbAQSwOSlfOeO7MdKfA== X-Received: by 2002:a7b:c8d3:0:b0:3a6:2e:d4a8 with SMTP id f19-20020a7bc8d3000000b003a6002ed4a8mr16289164wml.135.1661193765556; Mon, 22 Aug 2022 11:42:45 -0700 (PDT) MIME-Version: 1.0 References: <20220818170005.747015-1-dima@arista.com> In-Reply-To: From: Salam Noureddine Date: Mon, 22 Aug 2022 11:42:34 -0700 Message-ID: Subject: Re: [PATCH 00/31] net/tcp: Add TCP-AO support To: Leonard Crestez Cc: Dmitry Safonov , Eric Dumazet , "David S. Miller" , David Ahern , Andy Lutomirski , Ard Biesheuvel , Bob Gilligan , Dmitry Safonov <0x7f454c46@gmail.com>, Eric Biggers , Francesco Ruggeri , Herbert Xu , Hideaki YOSHIFUJI , Ivan Delalande , Jakub Kicinski , Paolo Abeni , Shuah Khan , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Sun, Aug 21, 2022 at 1:34 PM Leonard Crestez wrote= : > > On 8/18/22 19:59, Dmitry Safonov wrote: > > This patchset implements the TCP-AO option as described in RFC5925. The= re > > is a request from industry to move away from TCP-MD5SIG and it seems th= e time > > is right to have a TCP-AO upstreamed. This TCP option is meant to repla= ce > > the TCP MD5 option and address its shortcomings. ... > > > > The patch set was written as a collaboration of three authors (in alpha= betical > > order): Dmitry Safonov, Francesco Ruggeri and Salam Noureddine. Additio= nal > > credits should be given to Prasad Koya, who was involved in early proto= typing > > a few years back. There is also a separate submission done by Leonard C= restez > > whom we thank for his efforts getting an implementation of RFC5925 subm= itted > > for review upstream [2]. This is an independent implementation that mak= es > > different design decisions. > > Is this based on something that Arista has had running for a while now > or is a recent new development? > This is based on prototype code we had worked on internally three years ago. The implementation effort was restarted to get it over the finish line. For business reasons we had to have our own implementation ready and not tied to unmerged upstream code. Please also note that our implementation is based on linux-4.19 and was only ported forward to mainline recently. So it wasn=E2=80=99t ready to be submitted upstream. > > For example, we chose a similar design to the TCP-MD5SIG implementation= and > > used setsockopt()s to program per-socket keys, avoiding the extra compl= exity > > of managing a centralized key database in the kernel. A centralized dat= abase > > in the kernel has dubious benefits since it doesn=E2=80=99t eliminate p= er-socket > > setsockopts needed to specify which sockets need TCP-AO and what are th= e > > currently preferred keys. It also complicates traffic key caching and > > preventing deletion of in-use keys. > > My implementation started with per-socket lists but switched to a global > list because this way is much easier to manage from userspace. In > practice userspace apps will want to ensure that all sockets use the > same set of keys anyway. > We did consider a global list early on but we didn=E2=80=99t find it beneficial. We still believe that per-socket lists reduce complexity of the implementation, are more scalable and ensure predictable behavior. Our expectation is that TCP-AO will be only useful for a limited set of routing applications, rather than used transparently like IPSEC for non-routing apps. We would be happy to discuss this in more detail. > > In this implementation, a centralized database of keys can be thought o= f > > as living in user space and user applications would have to program tho= se > > keys on matching sockets. On the server side, the user application prog= rams > > keys (MKTS in TCP-AO nomenclature) on the listening socket for all peer= s that > > are expected to connect. Prefix matching on the peer address is support= ed. ... > > My series doesn't try to prevent inconsistencies inside the key lists > because it's not clear that the kernel should prevent userspace from > shooting itself in the foot. Worst case is connection failure on > misconfiguration which seems fine. > > The RFC doesn't specify in detail how key management is to be performed, > for example if two valid keys are available it doesn't mention which one > should be used. Some guidance is found in RFC8177 but again not very much= . > > I implemented an ABI that can be used by userspace for RFC8177-style key > management and asked for feedback but received very little. If you had > come with a clear ABI proposal I would have tried to implement it. > > Here's a link to our older discussion: > > https://lore.kernel.org/netdev/e7f0449a-2bad-99ad-4737-016a0e6b8b84@gmail= .com/ > > Seeing an entirely distinct unrelated implementation is very unexpected. > What made you do this? > > -- > Regards, > Leonard Our goal was not to have a competing TCP-AO upstream submission but to implement the RFC for our customers to use. Had there been an already upstreamed implementation we would have used it and implemented customer requirements on top of it. Just like we do with all other kernel features. This is not a bad situation, we believe it is good for the upstream community to have two fully functioning implementations to consider. Possibly a third collaborative submission might emerge that takes the best of both. A year ago, there wasn=E2=80=99t much available online about TCP-AO besides the RFC. We are excited with the current interest in TCP-AO and hope to see it upstreamed soon. Best, Salam