Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4734896ioa; Wed, 27 Apr 2022 09:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVyEF8d0HrSvwO8oPoNeyk0aabmb6o0pNerkXh/j0pGBqmuX8PoI/ML+E+44/HBb/njPfW X-Received: by 2002:a17:902:7088:b0:156:1aa9:79eb with SMTP id z8-20020a170902708800b001561aa979ebmr29357232plk.71.1651078652553; Wed, 27 Apr 2022 09:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651078652; cv=none; d=google.com; s=arc-20160816; b=Y72858g183qdHbAutHSLJzQgO2f04HuGi8oCE+YRBgGp1SEQt6y12UM/oJIsXk0uf+ GCsmp76dtfKoCLvFP7d8S9MzP2XeSGJ7qk5jS4C6luRCKenwrz3K84HZQ+FuMUs2OBhC GRzUtpA1u7B6chJnLlva+O2c+mp4MA3D+DPnlOznCfs2NK3Hpc512QcNc7eY9nIz/pny sePbBwBg7Pi2bp8NZhg41RuK5Kxlsd4wLAhaWEoRoFXQBMv51tKP/NITw+RyHysygQFx y76JiEaXlkygKkNzUQmmV80wzjDcDCmCP3Ny7RE6Z83gm3Zx1LAIEv2nGAqRh7AYWKuo TQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UZh0GJknH01UnAvd0ICuOwLfH4/gy0FfkPh8RIK9KHI=; b=UMHel0nIzOI9lF7/dsnap8WeD4f/QcJObxf5y3+t9Wbk/feO6ziI6E/yyEkFo1gn8/ 69T7u/n+x1j0Gm0wVgVn20aOSyUiEjuATlPc3mt7MvoIfLMbfKaKs2QHtj3kD5yamvPn 7SRP4HPzfIiPoPvh1VUDfMk+f86oou/T989Eo8++IyWpA4ZdjUY21N6a8eViV+dh96sJ jD1RVVVH4uGj7YVBvEyWgaP8BFsH6v3zP3y2dT3e3YR8r9EcLoigm2gwMWSpk3UzyM9s n7FOcy+zng0dPMasJ8GMAptPD95y30dvr0Xz1njMczLAqahnieNuMhIQGypFcE0y03Ud mmUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j30-20020a63595e000000b003a2b62df230si1942599pgm.772.2022.04.27.09.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:57:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5458526575; Wed, 27 Apr 2022 09:27:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242379AbiD0Q2X (ORCPT + 99 others); Wed, 27 Apr 2022 12:28:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243186AbiD0Q1h (ORCPT ); Wed, 27 Apr 2022 12:27:37 -0400 Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 009BF41FB5; Wed, 27 Apr 2022 09:22:12 -0700 (PDT) Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 23RGLwSQ003715; Wed, 27 Apr 2022 18:21:58 +0200 Date: Wed, 27 Apr 2022 18:21:58 +0200 From: Willy Tarreau To: Stephen Hemminger Cc: netdev@vger.kernel.org, David Miller , Jakub Kicinski , Eric Dumazet , Moshe Kol , Yossi Gilad , Amit Klein , linux-kernel@vger.kernel.org Subject: Re: [PATCH net 3/7] tcp: resalt the secret every 10 seconds Message-ID: <20220427162158.GC3488@1wt.eu> References: <20220427065233.2075-1-w@1wt.eu> <20220427065233.2075-4-w@1wt.eu> <20220427085621.5f2d1759@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220427085621.5f2d1759@hermes.local> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Hi Stephen, On Wed, Apr 27, 2022 at 08:56:21AM -0700, Stephen Hemminger wrote: > On Wed, 27 Apr 2022 08:52:29 +0200 > Willy Tarreau wrote: > > > From: Eric Dumazet > > > > In order to limit the ability for an observer to recognize the source > > ports sequence used to contact a set of destinations, we should > > periodically shuffle the secret. 10 seconds looks effective enough > > without causing particular issues. > > > > Cc: Moshe Kol > > Cc: Yossi Gilad > > Cc: Amit Klein > > Tested-by: Willy Tarreau > > Signed-off-by: Eric Dumazet > > --- > > net/core/secure_seq.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c > > index 2cdd43a63f64..200ab4686275 100644 > > --- a/net/core/secure_seq.c > > +++ b/net/core/secure_seq.c > > @@ -22,6 +22,8 @@ > > static siphash_aligned_key_t net_secret; > > static siphash_aligned_key_t ts_secret; > > > > Rather than hard coding, why not have a sysctl knob for this? > That way the tinfoil types can set it smaller. It's a legit question. First I think that there's no good value; before it used to be infinite, and now we're trying to figure a reasonable value that make the attack impractical without going too close to the risk of occasionally failing to establish a connection. I'm really not convinced that there's any benefit in fiddling with that, except for breaking one's stack by resalting too often and complaining about stupid network issues with ACK or RST being sent in response to a SYN. And stupidly, dividing jiffies by a constant known at build time is slightly cheaper than dividing by a variable. I know it's a detail but we tried hard to limit the accumulation of details here :-/ Just my two cents, Willy