Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2741354rwb; Mon, 5 Sep 2022 00:07:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR5AOOosts3AU3O/bpvjuDtivH7O+YUjuIoJ/HC7H8ZEo1u3N2egeFzI2ptXEKnMk4+Bdtoa X-Received: by 2002:a17:906:8251:b0:741:7a62:2376 with SMTP id f17-20020a170906825100b007417a622376mr24316128ejx.689.1662361668985; Mon, 05 Sep 2022 00:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662361668; cv=none; d=google.com; s=arc-20160816; b=dVCd+LLrT7xsuRSuzW6ayzgcUvZ9W3nnC7CURRV8QyEIZHb0xuzPbsX9wBrq1aMIpI tRSroE1alEqMXb/xpfqezgWoFstYKQPbOupaHoldc80XAGsKEkKK3UMpy5gh/pEZPW1/ QGHzSdYUi2xIpkcXLWBL7XDrNPNqOJptNye4Kur6Kxv9X8E3v6cCMhKmaKJWqxENw7rZ 65Y/mxol73TH/roJAm0sPbyzItXfSjIyasd5Q4aVd+DtzjOBddv+7/tFeDWs1MpUG9el 4FdbRWDDvERW5h9TGJ2FAKb1lzwkTOm7Tjbpv7996avKKtzXUhD+q77C2KdIle2cIGes SR5A== 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=qJGQHEU+kpkmq4yTgrqxLlEfpOC+9A8WgA8wjMg1leM=; b=DYyQIi/1+RoDNPpUf5RVxMMV+d2sxr+MUMttoHuRj14PR3t6vQKq8wWDkW45s8lEGK 3iQzd5aspDdNHXAc9AzkyEQAxdudJBNndjYbGRrvjQn+DqJOlXc7f7Kwv3w/lvhxsJFR rUTj2ZyJEpe21JpIgnzUdUsymGU6+3sGANHewBiZadW4vo3bsH9mIYikBTNMmSEOwbTM pr+FEK/GsCeib1EWlPvIPbYvu+vmClpp/LuiQRbk8HAI7eLkLj58hxWEJddGqwnD7znH gOQCWxVMUgoCRvaq+Cuulo2JhVNBbj0Ihrk+gM72DEg8volv+8+5rpR4OunYYL4YRl6b n4CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pUF8siy8; 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 l27-20020a50d6db000000b004481b74d9f7si6225396edj.577.2022.09.05.00.07.24; Mon, 05 Sep 2022 00:07:48 -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=pUF8siy8; 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 S237063AbiIEHGl (ORCPT + 99 others); Mon, 5 Sep 2022 03:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237137AbiIEHGX (ORCPT ); Mon, 5 Sep 2022 03:06:23 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8EF63ED43; Mon, 5 Sep 2022 00:06:16 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id u6so10034536eda.12; Mon, 05 Sep 2022 00:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=qJGQHEU+kpkmq4yTgrqxLlEfpOC+9A8WgA8wjMg1leM=; b=pUF8siy89b+MGGymtiGkNqrwC4vnL3rMbK6M5hEGaDrw5Xo58oAQM/yXQs2ULW4V6B ZL1YNAyZyiFgDVVxjFnKImUdzXuol60DLc+bpTOFcooqKzTt8yPJyjgpIvQj2abJZUJh yxnRwA9vuPeOaoNemcPtHYHrXXWfqNWndfV5dcea8/OPwo+nwQt6Il37H2sLMFCE/wwQ eaiIOVEwsYyv1qtAC+DqpoNGzfPdVCqQK4lnBIosUeLcD118rKcCxgVCI2LVAxEbnhJ/ sb6ogC7n2Td/2zkjCtnalAiklP2MjipMDERXav1oE6FqGV6x9K90+P2K4284tGKhjvl7 YLNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=qJGQHEU+kpkmq4yTgrqxLlEfpOC+9A8WgA8wjMg1leM=; b=c+pu6P24xKDkrirH2aU4/1bJdQuoKda+L8vxqDlaACfjF9cMJO5jqB4AqxM2if9D+/ D/93NF/aiHJnOw2q6ZYXpJR8g8H378psoNm/GcQgESQyyWQatGIj+95iL2Yc4pao2w0e 1XHWD1SAk0EpjsdbtWAf+mxYCuwtlElgq3BA9qroCJULiukZ9IFb3BlT+/p5ufgBv7Z5 yPpKArPvUGL9w9eWTliDnWj8hzz9Jmt9lLA/uBRYjozaoBLnTey8Jqsc+QENOAzziZPc vV3Ov8u4uqH0waP+SMD2KNTwZNKhWYdAi4bH5DO5NpEJNIFBgpjGuobltkCIhWNulnro fW5g== X-Gm-Message-State: ACgBeo3IUwI0Ez9ws5dmfS4B5CcDZyNeKXvaoOgYGHM94QhervEQyzem ar1ilc5P15ME+d5KfS6fTnE= X-Received: by 2002:a05:6402:510a:b0:43d:ab25:7d68 with SMTP id m10-20020a056402510a00b0043dab257d68mr41786831edd.102.1662361574723; Mon, 05 Sep 2022 00:06:14 -0700 (PDT) Received: from localhost.localdomain ([2a04:241e:502:a080:40ec:9f50:387:3cfb]) by smtp.gmail.com with ESMTPSA id n27-20020a056402515b00b0043cf2e0ce1csm5882775edd.48.2022.09.05.00.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:06:14 -0700 (PDT) From: Leonard Crestez To: David Ahern , Eric Dumazet , Dmitry Safonov <0x7f454c46@gmail.com> Cc: Francesco Ruggeri , Salam Noureddine , Philip Paeps , Shuah Khan , "David S. Miller" , Herbert Xu , Kuniyuki Iwashima , Hideaki YOSHIFUJI , Jakub Kicinski , Yuchung Cheng , 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 v8 02/26] docs: Add user documentation for tcp_authopt Date: Mon, 5 Sep 2022 10:05:38 +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,T_SCC_BODY_TEXT_LINE 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 bacadd09e570..b134037c94ec 100644 --- a/Documentation/networking/index.rst +++ b/Documentation/networking/index.rst @@ -102,10 +102,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