Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp451097imn; Mon, 25 Jul 2022 23:17:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tEL0SBQEz+6/W3ZDh6PlIW57xuB/FjfEORkGD2SiU6GyXklLxJmfUg2Gvf56rjNaZ9Zpzd X-Received: by 2002:a17:90b:3a90:b0:1f2:edfe:db4 with SMTP id om16-20020a17090b3a9000b001f2edfe0db4mr2202785pjb.105.1658816241717; Mon, 25 Jul 2022 23:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658816241; cv=none; d=google.com; s=arc-20160816; b=FojFGHDju1+FSigOxoD2OkPqe+LYjQjvjfOpfiBM/CQ+hEYSb3/qNTSSESWRWIc1Ig 29sds0feUmNSRF8e4BNkYwNZcMnLXcND8WNhdeA0rsezapWyFtfJnZ+GNWpcmGVqDynt vcMOboQlnW5hNSYJhoY5NC5whmUDaUEkaab6VJXs1pjeX8wawZvfVE9VGY/CvFzxQMx/ cc9GT5kZQEavdGDf2L8mD3nm3vPeo2kGmuVOvBhno44ZkdOp9xUyzhNhrn7MtWVhaZ1d 5kGsFZC+tPHk+FIZ26vdNXW9/+70+YyO31OOMaS+fiq9dcpZoM5WlSATo4Mbbh9fphg0 MXHg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6LjuhIC/pbHS+8spopbsWARAYbdtibeJdvNxgS2b0Q0=; b=kW7nMLB2a3YXD4YkChHkIJPJyw5ZtKMgMsmRRECV5l4tCczbLaYWn30dk1u2DypfMK 8PLc+Mml3sEn3K4kOz08y+Tr5RqxRpZB5KN9yB/jXm3CbshZNcg+Fn6Bvh/9GWmnoMls 9xcxlmAmcx9cScTmPSQLgQZi/0XMXcxarMwhAZIdn0cleh5K/tHoQtfXsHDvrjM0b6iT xVFH/BU4sKky23jaJh+de5Rp5NgAOm5SXocl9kK4fBymzzjOBZ6uHIkLalwbfVRrrHGb A7Z1NVu58UXkoNZd6I3VXLrD18YPOv8MFujGGfVIrUtJJAidaA25i8NIacDTu6Qp7ETu N7ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Jp9L4FYf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a62d14e000000b004fa3a8e002csi15965505pfl.227.2022.07.25.23.17.04; Mon, 25 Jul 2022 23:17:21 -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=@gmail.com header.s=20210112 header.b=Jp9L4FYf; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237558AbiGZGPw (ORCPT + 99 others); Tue, 26 Jul 2022 02:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbiGZGPp (ORCPT ); Tue, 26 Jul 2022 02:15:45 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F1865B5; Mon, 25 Jul 2022 23:15:44 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id w5so4081089edd.13; Mon, 25 Jul 2022 23:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6LjuhIC/pbHS+8spopbsWARAYbdtibeJdvNxgS2b0Q0=; b=Jp9L4FYfu0jGtLqSJdzfPszfj6sXWOJy4TQKGDvQ0MVSe4g2GNyhdZMpkLtL511E8m +A/BYrgaZ3PElIlZxCHxZQkR2txyCTHzkqlTez3tTY8e29FEOn7mzGAuiFDoT00TIMyr K9Fv8BlzXWSoyPciq1r9IWfsJnCxBwAE7njUMKOTmCHArhaKtestUGKqqYrO4UVeliGo 9RS9RZSY22NS7amBO38IkqJ5Zi+iUCIOAAWG2oGo3bkcWjZ9JoefVFvVIO+/J1g8Jzs1 Qztm2gDebiruEX/vocGPVEmHZH/KujGclS9DotrIA6fbH8zhx0IC6QjDmPHJgcqFT3tx J0YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6LjuhIC/pbHS+8spopbsWARAYbdtibeJdvNxgS2b0Q0=; b=T8U8KAFShiDxP+W9H29fa57NT4dTCU9vJjCPsbwBUoEn3fEQK+o4/xVA3kZGrkXZ6R QhBvN7HCQfXkZ9+lqfeoyc+uh49ucO4CgAcdoH3dM7L5mzQagK1GoRmS4xyimg0AvKZe EmDiZ5N7IP7L3yCdv0ycBRH6tR1+B9lg7ZWTFncLq6+wMD4HSGy3WbtD+Fh1xE38V1mm PbXp2KuqjGnV1xS2TLBekJgSlZ1osOAdxDygMUkDnIS6cVBH1yvSBrbc7MG+5csBr7Um cSOgqW6BuJxeZuRmi+WJ2BaARUiz7sQvabOEEJo4+wj/hjxGuDnM9p1lEk4cEoOEoTvz AtUA== X-Gm-Message-State: AJIora8pWwsf3wd6lgeliFYYoiRiqtmAOD7PmiQeVKBA0d5tnLLSdPJr BNP23InhFZPQS+3rY0Ud2vA= X-Received: by 2002:aa7:c403:0:b0:43b:d0a3:95f with SMTP id j3-20020aa7c403000000b0043bd0a3095fmr16224245edq.74.1658816143705; Mon, 25 Jul 2022 23:15:43 -0700 (PDT) Received: from localhost.localdomain ([2a04:241e:502:a080:2b68:36a:5a94:4ba1]) by smtp.gmail.com with ESMTPSA id l23-20020a056402345700b0043ba7df7a42sm8133067edc.26.2022.07.25.23.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 23:15:43 -0700 (PDT) From: Leonard Crestez To: David Ahern , Eric Dumazet , Philip Paeps Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Shuah Khan , "David S. Miller" , Herbert Xu , Kuniyuki Iwashima , Hideaki YOSHIFUJI , Jakub Kicinski , Yuchung Cheng , Francesco Ruggeri , Mat Martineau , Christoph Paasch , Ivan Delalande , Caowangbao , Priyaranjan Jha , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 03/26] docs: Add user documentation for tcp_authopt Date: Tue, 26 Jul 2022 09:15:05 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 The .rst documentation contains a brief description of the user interface and includes kernel-doc generated from uapi header. Signed-off-by: Leonard Crestez --- Documentation/networking/index.rst | 1 + Documentation/networking/tcp_authopt.rst | 51 ++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Documentation/networking/tcp_authopt.rst diff --git a/Documentation/networking/index.rst b/Documentation/networking/index.rst index 03b215bddde8..294b87137cd2 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -103,10 +103,11 @@ Contents: strparser switchdev sysfs-tagging tc-actions-env-rules tcp-thin + tcp_authopt team timestamping tipc tproxy tuntap diff --git a/Documentation/networking/tcp_authopt.rst b/Documentation/networking/tcp_authopt.rst new file mode 100644 index 000000000000..72adb7a891ce --- /dev/null +++ b/Documentation/networking/tcp_authopt.rst @@ -0,0 +1,51 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================= +TCP Authentication Option +========================= + +The TCP Authentication option specified by RFC5925 replaces the TCP MD5 +Signature option. It similar in goals but not compatible in either wire formats +or ABI. + +Interface +========= + +Individual keys can be added to or removed through an TCP socket by using +TCP_AUTHOPT_KEY setsockopt and a struct tcp_authopt_key. There is no +support for reading back keys and updates always replace the old key. These +structures represent "Master Key Tuples (MKTs)" as described by the RFC. + +Per-socket options can set or read using the TCP_AUTHOPT sockopt and a struct +tcp_authopt. This is optional: doing setsockopt TCP_AUTHOPT_KEY is sufficient to +enable the feature. + +Configuration associated with TCP Authentication is global for each network +namespace, this means that all sockets for which TCP_AUTHOPT is enabled will +be affected by the same set of keys. + +Manipulating keys requires ``CAP_NET_ADMIN``. + +Key binding +----------- + +Keys can be bound to remote addresses in a way that is somewhat similar to +``TCP_MD5SIG``. By default a key matches all connections but matching criteria can +be specified as fields inside struct tcp_authopt_key together with matching +flags in tcp_authopt_key.flags. The sort of these "matching criteria" can +expand over time by increasing the size of `struct tcp_authopt_key` and adding +new flags. + + * Address binding is optional, by default keys match all addresses + * Local address is ignored, matching is done by remote address + * Ports are ignored + +RFC5925 requires that key ids do not overlap when tcp identifiers (addr/port) +overlap. This is not enforced by linux, configuring ambiguous keys will result +in packet drops and lost connections. + +ABI Reference +============= + +.. kernel-doc:: include/uapi/linux/tcp.h + :identifiers: tcp_authopt tcp_authopt_flag tcp_authopt_key tcp_authopt_key_flag tcp_authopt_alg -- 2.25.1