Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp999145rdg; Wed, 11 Oct 2023 11:11:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaXh78Tg/5SW4UfBbc/tBUF0VZsKxG5f1mJvUCnhkPhC/br1Jiopjs7g2/VHjfzmzOJgfZ X-Received: by 2002:a05:6870:d186:b0:1bb:6136:9cc1 with SMTP id a6-20020a056870d18600b001bb61369cc1mr26918123oac.2.1697047870920; Wed, 11 Oct 2023 11:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697047870; cv=none; d=google.com; s=arc-20160816; b=UX9LGMY+/lhKHBv108AkpN6/RJ28t1UK2GqB7OZhMWy4Wzo7rMgHKxdzKu6mr+0bxx cTzjJEUh3GpcqEMgsx3xJGOHLIbecdGJZYu6sutosQ+xIcR0hCHU9P1nMia2/kuSHkSj ZLB4PXvanNtgSSN2lGVpDHRBeJTp7JZ6TXAtzlbQ3Qr6wj3KiH15rfQGNewpN4URr+2f d4Nnc+J9fV2UxBPa+G1YzpdNdE0GpPFJJyfPdOgYiMSdJHEchOjSrUe3JA4LQgb2MUjE 6+jfqVxZ5q0csck6lag+O5hP8pBRAxYKBooo+VRP6LL4M41M9dsqzCLZRA9VQmi2954R 9vpw== 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=ll2dO80dKdNtktHpD8Nup75jkjUJEZ6P5R1J+WyNECY=; fh=uECARM74R8dU0sWxKfjaZrLYloVcg4mJqpozaTqotHg=; b=ER05xkMdmJWbqwL+qjbr5K/nMce8qTUciNDGZ/Ie+aBFVuOqDIh8hMt3+Alcyswjq8 oWofKlZuHO546g14Xiv5cTZjV95nh12kYhS9d2P/Wr+8TW361hstKOU4ZkrjkBbMeqeq LdqGsyCp/ouyxE4QKKEVueoNBk5y4NQXVHH2iaUBgrmYj4gZMe1z0+10XRZ0c2E259Qp e36T/siiaxR5hwC+kFYj2kh+xQ49ir6ofU8UfieBPhiaugsoZAYTwhLX2w+JXjzrmOYj ZbSh5mSlojTep5ObnFlIka0R77keWrW1qpjybj0xnW11rS2bHuxGlw6s7Oy/WpuVO8Nq fn6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YkKwz31F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b7-20020a63cf47000000b00573fc6a17dbsi283196pgj.435.2023.10.11.11.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 11:11:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YkKwz31F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 44A3280289E1; Wed, 11 Oct 2023 11:10:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232919AbjJKSKf (ORCPT + 99 others); Wed, 11 Oct 2023 14:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbjJKSKd (ORCPT ); Wed, 11 Oct 2023 14:10:33 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F27099E for ; Wed, 11 Oct 2023 11:10:31 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-405459d9a96so10265e9.0 for ; Wed, 11 Oct 2023 11:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697047830; x=1697652630; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ll2dO80dKdNtktHpD8Nup75jkjUJEZ6P5R1J+WyNECY=; b=YkKwz31F5HP8JUaJw1v+viSHW2+XXpHLRke3TRM/2azgDWa0OOAn6n/dtblz1eu+Be h/v6AfOD6VcpccnJJ4mH/XZWRN125507eLaCvYFVyGG6sIua7RU7eoVMcXjH1hBzI5jk Pq08rjSZYSYdsf3pFIy5iZuS5LZQ06DDzwPBQqR8cTG7XVoRDh2+LgR0buuihvVYx78s JQjW1iijNjw7qB3+DMQJvX7mBaSdEDzUDblB2iG4jdme28F94fUAJIC9a2lsoIXhMa+r U1ko1dQG8Wyx5/ePX4mMeoXq+7PH0n4q2kMEIzg5tMZeknSKOfzOpEUezB50HrK6rBm7 UX9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697047830; x=1697652630; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ll2dO80dKdNtktHpD8Nup75jkjUJEZ6P5R1J+WyNECY=; b=u9bi+hEsI/TON5IC3sfg1EyzT8bgGi2/oXzqW/DcBMSuGT00hfXMJBzD1j3tUjpyJl WLCSMiU+mxEOSHPfqgs7kc7yf1BmB2w7Uq3BOawhVbSjrLEkMnocbLRj+L28ITNnETqX yAr4TSZPETu372fQAfvlJqdnTwf+ZmoIVOud1FCAINu7Q13mvoQuMmGD5DQuC8DeKb5/ Dp45lLc+HbySHv/dx8WVr8k+fNoY59xFu7WnG9vWlDuKVsNFO5WSxqcYaR3HmHZNofFS U38yBW4JC+y30v1KcbKWvuyiilGqwv+0yTZOSAtmb3CbIItvxIj38i95n8ykF8YSZr8X mogg== X-Gm-Message-State: AOJu0YxtSvhShqunLcrtXHIWQZHJaeblChEkypKhVVT1pI2Wzu16ffrH l3xrHd+egGcjdav3qiL1BpRrhIhjHmNc128BVGr/Ow== X-Received: by 2002:a05:600c:1ca6:b0:400:c6de:6a20 with SMTP id k38-20020a05600c1ca600b00400c6de6a20mr125146wms.3.1697047830169; Wed, 11 Oct 2023 11:10:30 -0700 (PDT) MIME-Version: 1.0 References: <20231009230722.76268-1-dima@arista.com> <20231009230722.76268-10-dima@arista.com> In-Reply-To: <20231009230722.76268-10-dima@arista.com> From: Eric Dumazet Date: Wed, 11 Oct 2023 20:10:19 +0200 Message-ID: Subject: Re: [PATCH v14 net-next 09/23] net/tcp: Add TCP-AO sign to twsk To: Dmitry Safonov Cc: David Ahern , Paolo Abeni , Jakub Kicinski , "David S. Miller" , linux-kernel@vger.kernel.org, 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Wed, 11 Oct 2023 11:10:53 -0700 (PDT) On Tue, Oct 10, 2023 at 1:07=E2=80=AFAM Dmitry Safonov wr= ote: > > Add support for sockets in time-wait state. > ao_info as well as all keys are inherited on transition to time-wait > socket. The lifetime of ao_info is now protected by ref counter, so > that tcp_ao_destroy_sock() will destruct it only when the last user is > gone. > > Co-developed-by: Francesco Ruggeri > Signed-off-by: Francesco Ruggeri > Co-developed-by: Salam Noureddine > Signed-off-by: Salam Noureddine > Signed-off-by: Dmitry Safonov > Acked-by: David Ahern > --- > include/linux/tcp.h | 3 ++ > include/net/tcp_ao.h | 11 ++++- > net/ipv4/tcp_ao.c | 46 +++++++++++++++++--- > net/ipv4/tcp_ipv4.c | 92 +++++++++++++++++++++++++++++++--------- > net/ipv4/tcp_minisocks.c | 4 +- > net/ipv4/tcp_output.c | 2 +- > net/ipv6/tcp_ipv6.c | 72 ++++++++++++++++++++++--------- > 7 files changed, 181 insertions(+), 49 deletions(-) > > diff --git a/include/linux/tcp.h b/include/linux/tcp.h > index c38778b0baa0..51458219be4e 100644 > --- a/include/linux/tcp.h > +++ b/include/linux/tcp.h > @@ -512,6 +512,9 @@ struct tcp_timewait_sock { > #ifdef CONFIG_TCP_MD5SIG > struct tcp_md5sig_key *tw_md5_key; > #endif > +#ifdef CONFIG_TCP_AO > + struct tcp_ao_info __rcu *ao_info; > +#endif > }; > > static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) > diff --git a/include/net/tcp_ao.h b/include/net/tcp_ao.h > index 629ab0365b83..af2caf7e76fc 100644 > --- a/include/net/tcp_ao.h > +++ b/include/net/tcp_ao.h > @@ -85,6 +85,7 @@ struct tcp_ao_info { > __unused :31; > __be32 lisn; > __be32 risn; > + atomic_t refcnt; /* Protects twsk destruct= ion */ This needs to be a refcount_t