Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1460376rwb; Fri, 18 Nov 2022 19:47:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf7A/rooG2zS/6h6DVAaeW8a3K9TPVz+gLJJUbFkrO4DxdViTbWP/PQHuNaTiSeOQQFDiz7D X-Received: by 2002:a63:556:0:b0:46f:75bc:8438 with SMTP id 83-20020a630556000000b0046f75bc8438mr8926970pgf.520.1668829666591; Fri, 18 Nov 2022 19:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668829666; cv=none; d=google.com; s=arc-20160816; b=PenC7QlEwqJYZUZVZzEMu/uLEGHKFFLmx/dydYj7x2rOktTzcGXqGCqcNpnLzqr8Dh pfqUhnGXDKSBvx7kvRLKbk5xpLR+w/CfbovA9qLBw1n82xjeHpSJWV/R1E3b7rLr+lHN wkA6BnQ56fwoSWCSYZKGY+WEDk+ZqPfoVoKvZ8eIpB3KoVrddBrxQasLECWL8P64f/Hz QQeHRbKfq9QuSVKHZMkxXIZI5ujq3iv1IH6x2TZ08c34LizcAjiA673UEKsLO9D6TSFS QUjzCFrs/qk5IAgELtLV7ynmE7WLlxb4I7ZzAYId6u2pxJABSZhASxF6vGZzOz8vPL9k sU9Q== 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:subject:cc:to:from:date :dkim-signature; bh=0/7bT/F+d8Kx9NzRKN4OeQimcnoVT0zSewyCsKN29n4=; b=0o9W8dGOCNmGEm+a/tnbK7SGGGi5yLNir1fnUsbWUzUj496+uvf4iyfxvY968PFp6V 5I+T7e030MXb/QKMVK+BsmIDzZtczOzLMIDH4lhU6ysA2cBW9QjrF6qbA5GoCclcYuFV PDtSldUJ+iFEgir3G0ibjmf5Zopqf6x3aG++oP2ss1QNyOVdaIlDWes3Uk8uqJQPK2sv FL+HNmBI5L4TaURwFpY14FE2uDUs2B33ft1dy/oVsDVpNb+MTePWm+v+uLxmHMGdRgFI KiMEuvaEaHd5G6y2ejK5dgGdydznyRCtHHV9NXdZLpyydYPO78ron35F2tDI+uFKrAC4 0gVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QFd7ysay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a056a00158e00b005627d896458si5840420pfk.142.2022.11.18.19.47.35; Fri, 18 Nov 2022 19:47:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b=QFd7ysay; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232320AbiKSDSR (ORCPT + 90 others); Fri, 18 Nov 2022 22:18:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230271AbiKSDSP (ORCPT ); Fri, 18 Nov 2022 22:18:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ECBB5CD2C; Fri, 18 Nov 2022 19:18:14 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E03B4B8265A; Sat, 19 Nov 2022 03:18:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 913CAC433C1; Sat, 19 Nov 2022 03:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668827891; bh=Skx/V/hHZ/xZPl7pWfc2hBThZcNpW83cxRVyzlPkisk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=QFd7ysay0SxnX6WGed+t2yDLqWHbqa9tdwrPa8FA/cqYm4gcCXJqOgDGmZFGRltqv Eet7LgnNzONIfphzorvLMC3Lp5s3YxT4dPv/REGVAlElyykHE4ZQKTp0/1KHEDmoqJ vEm+sgGP4qumzeJfXmoh3/B9es6W6/W/K83KTM/2DJ/GWXUc8kBF4duY4fYE9zwnV7 od6sT58U7ap8z7VWmvZAttiKOGcuVB2Ts/oMCiDhDjviqbzXyuk+6bG0S51SMk5jwO wC4A9p/7/YL1D8QqwFyY6Qs02CzDZgoYw/3cv/DsZrADRu58Cm4KVlNjtBlat4j5BQ ir/GcYp77BjUg== Date: Fri, 18 Nov 2022 19:18:09 -0800 From: Jakub Kicinski To: Dmitry Safonov Cc: linux-kernel@vger.kernel.org, David Ahern , Eric Dumazet , Peter Zijlstra , Ard Biesheuvel , Bob Gilligan , "David S. Miller" , Dmitry Safonov <0x7f454c46@gmail.com>, Francesco Ruggeri , Hideaki YOSHIFUJI , Jason Baron , Josh Poimboeuf , Paolo Abeni , Salam Noureddine , Steven Rostedt , netdev@vger.kernel.org Subject: Re: [PATCH v4 3/5] net/tcp: Disable TCP-MD5 static key on tcp_md5sig_info destruction Message-ID: <20221118191809.0174f4da@kernel.org> In-Reply-To: <20221115211905.1685426-4-dima@arista.com> References: <20221115211905.1685426-1-dima@arista.com> <20221115211905.1685426-4-dima@arista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-kernel@vger.kernel.org On Tue, 15 Nov 2022 21:19:03 +0000 Dmitry Safonov wrote: > + if (!rcu_dereference_protected(tp->md5sig_info, lockdep_sock_is_held(sk))) { > + if (tcp_md5sig_info_add(sk, sk_gfp_mask(sk, GFP_ATOMIC))) > + return -ENOMEM; > + > + if (!static_key_fast_inc_not_negative(&tcp_md5_needed.key.key)) { > + struct tcp_md5sig_info *md5sig = tp->md5sig_info; I don't think sparse will be able to deduce that ->md5sig_info access is safe here, so could you wrap it up as well? Maybe it wouldn't be the worst move to provide a sk_rcu_dereference() or rcu_dereference_sk() or some such wrapper. More importantly tho - was the merging part for this patches discussed? They don't apply to net-next.