Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp372266rdb; Mon, 18 Sep 2023 19:18:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLEjz715NN5SckvoDoM2hFcIr0SagWTxXtjmBseFCMo9u5HL411cDJSd5OTqdwMeSM+cBw X-Received: by 2002:a17:902:d54e:b0:1bd:d141:f02d with SMTP id z14-20020a170902d54e00b001bdd141f02dmr8193797plf.68.1695089913559; Mon, 18 Sep 2023 19:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695089913; cv=none; d=google.com; s=arc-20160816; b=e7tCgEPhWkohNjnKG5LfaZ5Sqc5zYxi4yUZJJIzA77V9j0ATNdtddQQSR4D45RhTrO snhpAf1coTKfp/KCH74qbdBHLfkccu2EyS69fE/iI5rHlXMBNiqPrLJ/og4W2HjaT5ri SA13aPrHGbPrqWHcMOc5CZcTbpZOzzVNgnmDGIQ30fULD5Edb0dKtLC2oBCFU0x6oBc5 i661apVu0idfd77cPfr33NivTAxKXYIi4eQWbk1W3jkND7boA45H+KnBzfVwy2Rpc3N1 wpiVL6zvcgvhwdXxxCT1LUcz0nd9GfvTtBbu1Kj4WBNVchJOq9LSsf+acshUMgd5YsBQ 9RYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Ll/AvVRrBQm6SEVrUQpNi67a39m/OvrEmI+jt6Dj7aQ=; fh=QryqvAn9CpbSDwwRensfsZ3wJIRZj/gC+p5DlooXiiI=; b=EmRgBuvWH6uJxvVKOHA4HgxGryITS+e0a+8TIMdAFDjQYu19wFrJWYpM6ginAqrRNO DnzG1eXDMXJ+KbmWjZ/9pl6njr6sckcGnyYxtK0GXlrvbHPoayxHOz7Ul3Hhz6Zfjqlt V07gHYtLT1+Uhiw4/ilsvdiMf2A6OQFBN5FslvRAErEToBBmmITax4ZSPRUumWtN3j0x qhtqdjS49iaoVZ/Rqj1SaK4ioU0hw4E0yGpTbvdxR8myiDgIYdDmCUYHp8Y97JgqKY8c McTkW56DZ5ByPX0NCOIuvzznckstzLEGF++Yq8UdpH+z6tdD524GLJt3f9hwsdKARwLt QPpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=WBe7iUuj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id jb12-20020a170903258c00b001b8922e82e3si3954470plb.297.2023.09.18.19.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 19:18:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=google header.b=WBe7iUuj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=arista.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5E639807DE2D; Mon, 18 Sep 2023 12:00:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjIRTAp (ORCPT + 99 others); Mon, 18 Sep 2023 15:00:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjIRTAn (ORCPT ); Mon, 18 Sep 2023 15:00:43 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4A7810E for ; Mon, 18 Sep 2023 12:00:36 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-403004a96a4so54134025e9.3 for ; Mon, 18 Sep 2023 12:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; t=1695063635; x=1695668435; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ll/AvVRrBQm6SEVrUQpNi67a39m/OvrEmI+jt6Dj7aQ=; b=WBe7iUuj1yximGeBscfmUCPaiMOuP+QUFipw/x0yHuLvAzNODU6T3cBeCLF2FBRTqu TKlsIoxqTVK2hxg5aI8+NVjU/msmB1mJqQIu0Xux+CM+CoMFNHWcDJ+uCYAzAISjKq3z 9VFUWu+XJbYFkG4QztVqpaN89kKD4XR5zXKlE+PrSRzCCASyFg2+Zm+8QBtU3Gk4x4xP Zel4n2R+f38JAAU/vk/o84QzRqRacQKI8dvSm6/GFf1ZJsKN4Dgbo+H7GVI/Sj6DgCEA 1xmkiQJS+FsQhIh499APaq8kX/GxoaVTA0x3St8V/etUnWS5mr87k7zp/sxRXwrMAaKX Zf6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695063635; x=1695668435; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ll/AvVRrBQm6SEVrUQpNi67a39m/OvrEmI+jt6Dj7aQ=; b=gTXyOXjYSp6EBPxdKJbILGWhL+ZuXRSxCiUNtuPA7VyCe7UbPeFEx+r/+1F2lCK1IK /9FDlpxu3yBKYiiB7zzalspA8XGBJ/K6HBJnhrmMhE/fjkPFFo9SVUaxDICOw6XGoXa/ uzOuSnRTjHeb2F4tMla56sUXsMECSEHdaPp3aNKSlW27BKP5CIaIvrVDSFwD2StC1Yo9 VXiiErqls8UcTpMC6LR1X4s9kOndOd1jjKNdXveKaoJ8JmCQGIFwPt0cs907HIGa0RfJ TxO/GyYc1q6IUoGWoxzK7Xt1xYwRUqgRmumkSS1ogSjhGB/2oHse8BgeWY8LLwMXjaeE ly6g== X-Gm-Message-State: AOJu0YxAKpws69CpOwYhd1Jibh4uQK1qtsiivpE3lZGVkzMGbZw2L1g4 Dn7Few6HEW2WmT3rNgB++oiBjA== X-Received: by 2002:a7b:ce0f:0:b0:3fe:1b4e:c484 with SMTP id m15-20020a7bce0f000000b003fe1b4ec484mr8291094wmc.5.1695063635291; Mon, 18 Sep 2023 12:00:35 -0700 (PDT) Received: from Mindolluin.ire.aristanetworks.com ([217.173.96.166]) by smtp.gmail.com with ESMTPSA id n9-20020a05600c3b8900b004047ac770d1sm10762707wms.8.2023.09.18.12.00.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 12:00:34 -0700 (PDT) From: Dmitry Safonov To: David Ahern , Eric Dumazet , Paolo Abeni , Jakub Kicinski , "David S. Miller" Cc: linux-kernel@vger.kernel.org, Dmitry Safonov , Andy Lutomirski , Ard Biesheuvel , Bob Gilligan , Dan Carpenter , David Laight , Dmitry Safonov <0x7f454c46@gmail.com>, Donald Cassidy , Eric Biggers , "Eric W. Biederman" , Francesco Ruggeri , "Gaillardetz, Dominik" , Herbert Xu , Hideaki YOSHIFUJI , Ivan Delalande , Leonard Crestez , "Nassiri, Mohammad" , Salam Noureddine , Simon Horman , "Tetreault, Francois" , netdev@vger.kernel.org, Steen Hegelund , Jonathan Corbet , linux-doc@vger.kernel.org Subject: [PATCH v12 net-next 00/23] net/tcp: Add TCP-AO support Date: Mon, 18 Sep 2023 19:59:58 +0100 Message-ID: <20230918190027.613430-1-dima@arista.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_BLOCKED,SPF_HELO_NONE,SPF_NONE 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-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 12:00:44 -0700 (PDT) Hi, This is version 12 of TCP-AO support. The changes from v11 address Eric's review comments. The biggest change was defining a common (struct tcp_key) that merges tcp_ao_key with tcp_md5sig_key on TCP fast-path, therefore in order to help reviewing I provide the ranged-diff between the versions here: https://gist.github.com/0x7f454c46/fe546b9cf323ca21acc3d0eabbd41236 There's one Sparse warning introduced by tcp_sigpool_start(): __cond_acquires() seems to currently being broken. I've described the reasoning for it on v9 cover letter. Also, checkpatch.pl warnings were addressed, but yet I've left the ones that are more personal preferences (i.e. 80 columns limit). Please, ping me if you have a strong feeling about one of them. The following changes since commit a5ea26536e89d04485aa9e1c8f60ba11dfc5469e: Merge branch 'stmmac-devvm_stmmac_probe_config_dt-conversion' (2023-09-18 12:44:36 +0100) are available in the Git repository at: git@github.com:0x7f454c46/linux.git tcp-ao-v12 for you to fetch changes up to 45aa51f1d541b7ce961b379eb0f45031b89575d6: Documentation/tcp: Add TCP-AO documentation (2023-09-18 18:07:32 +0100) ---------------------------------------------------------------- And another branch with selftests, that will be sent later separately: git@github.com:0x7f454c46/linux.git tcp-ao-v12-with-selftests Thanks for your time and reviews, Dmitry --- Changelog --- Changes from v11: - Define (struct tcp_key) for tcp-fast path and detect by type what key was used. This also benefits from TCP-MD5/TCP-AO static branches (Eric) - Remove sk_gso_disable() from TCP-AO fast-path in __tcp_transmit_skb() (Eric) - Don't leak skb on failed kmalloc() in __tcp_transmit_skb() (Eric) - skb_dst_drop() is not necessary as kfree_skb() calls it (Eric) - Don't dereference tcp_ao_key in net_warn_ratelimited(), outside of rcu_read_lock() (Eric) Changes from v10: - Make seq (u32) in tcp_ao_prepare_reset() and declare the argument in "net/tcp: Add TCP-AO SNE support", where it gets used (Simon) - Fix rebase artifact in tcp_v6_reqsk_send_ack(), which adds compile-error on a patch in the middle of series (Simon) - Another rebase artifact in tcp_v6_reqsk_send_ack() that makes keyid, requested by peer on ipv6 reqsk ACKs not respected (Simon) Version 10: https://lore.kernel.org/all/20230815191455.1872316-1-dima@arista.com/T/#u The pre-v10 changelog is on version 10 cover-letter. Cc: Andy Lutomirski Cc: Ard Biesheuvel Cc: Bob Gilligan Cc: Dan Carpenter Cc: David Ahern Cc: David Laight Cc: "David S. Miller" Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Donald Cassidy Cc: Eric Biggers Cc: Eric Dumazet Cc: "Eric W. Biederman" Cc: Francesco Ruggeri Cc: Gaillardetz, Dominik Cc: Herbert Xu Cc: Hideaki YOSHIFUJI Cc: Ivan Delalande Cc: Jakub Kicinski Cc: Leonard Crestez Cc: Nassiri, Mohammad Cc: Paolo Abeni Cc: Salam Noureddine Cc: Simon Horman Cc: Tetreault, Francois Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Dmitry Safonov (23): net/tcp: Prepare tcp_md5sig_pool for TCP-AO net/tcp: Add TCP-AO config and structures net/tcp: Introduce TCP_AO setsockopt()s net/tcp: Prevent TCP-MD5 with TCP-AO being set net/tcp: Calculate TCP-AO traffic keys net/tcp: Add TCP-AO sign to outgoing packets net/tcp: Add tcp_parse_auth_options() net/tcp: Add AO sign to RST packets net/tcp: Add TCP-AO sign to twsk net/tcp: Wire TCP-AO to request sockets net/tcp: Sign SYN-ACK segments with TCP-AO net/tcp: Verify inbound TCP-AO signed segments net/tcp: Add TCP-AO segments counters net/tcp: Add TCP-AO SNE support net/tcp: Add tcp_hash_fail() ratelimited logs net/tcp: Ignore specific ICMPs for TCP-AO connections net/tcp: Add option for TCP-AO to (not) hash header net/tcp: Add TCP-AO getsockopt()s net/tcp: Allow asynchronous delete for TCP-AO keys (MKTs) net/tcp: Add static_key for TCP-AO net/tcp: Wire up l3index to TCP-AO net/tcp: Add TCP_AO_REPAIR Documentation/tcp: Add TCP-AO documentation Documentation/networking/index.rst | 1 + Documentation/networking/tcp_ao.rst | 434 +++++ include/linux/sockptr.h | 23 + include/linux/tcp.h | 30 +- include/net/dropreason-core.h | 30 + include/net/tcp.h | 288 +++- include/net/tcp_ao.h | 347 ++++ include/uapi/linux/snmp.h | 5 + include/uapi/linux/tcp.h | 105 ++ net/ipv4/Kconfig | 17 + net/ipv4/Makefile | 2 + net/ipv4/proc.c | 5 + net/ipv4/syncookies.c | 4 + net/ipv4/tcp.c | 246 +-- net/ipv4/tcp_ao.c | 2341 +++++++++++++++++++++++++++ net/ipv4/tcp_input.c | 97 +- net/ipv4/tcp_ipv4.c | 363 ++++- net/ipv4/tcp_minisocks.c | 50 +- net/ipv4/tcp_output.c | 263 ++- net/ipv4/tcp_sigpool.c | 358 ++++ net/ipv6/Makefile | 1 + net/ipv6/syncookies.c | 5 + net/ipv6/tcp_ao.c | 168 ++ net/ipv6/tcp_ipv6.c | 374 +++-- 24 files changed, 5122 insertions(+), 435 deletions(-) create mode 100644 Documentation/networking/tcp_ao.rst create mode 100644 include/net/tcp_ao.h create mode 100644 net/ipv4/tcp_ao.c create mode 100644 net/ipv4/tcp_sigpool.c create mode 100644 net/ipv6/tcp_ao.c base-commit: a5ea26536e89d04485aa9e1c8f60ba11dfc5469e -- 2.41.0