From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 419A2C433FE for ; Sat, 19 Nov 2022 03:18:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231656AbiKSDSQ (ORCPT ); Fri, 18 Nov 2022 22:18:16 -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 Precedence: bulk List-ID: X-Mailing-List: netdev@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.