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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81DC4C25B0E for ; Tue, 16 Aug 2022 23:44:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EC5AC401B3; Tue, 16 Aug 2022 23:44:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EC5AC401B3 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uDEO8H5Q X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ygxDA6IWL_fL; Tue, 16 Aug 2022 23:44:41 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 00CEF4015D; Tue, 16 Aug 2022 23:44:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 00CEF4015D Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DB4E4C0033; Tue, 16 Aug 2022 23:44:40 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 985B0C002D for ; Tue, 16 Aug 2022 23:44:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5DF0D416EF for ; Tue, 16 Aug 2022 23:44:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5DF0D416EF Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uDEO8H5Q X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B7YjLSwluBjZ for ; Tue, 16 Aug 2022 23:44:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 50B86416B9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by smtp4.osuosl.org (Postfix) with ESMTPS id 50B86416B9 for ; Tue, 16 Aug 2022 23:44:38 +0000 (UTC) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 350E661348; Tue, 16 Aug 2022 23:44:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B4F7C433C1; Tue, 16 Aug 2022 23:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660693476; bh=OAzkgD5LmFOw0cU+/xIlB9h5Vph5ExEgMh4qFj5H50A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uDEO8H5QZeU9XvjDP5n5ihdX6f32eqoyRUxcYOZ+bvYDd1xTbA2RNWjQB4igljzDh y6IpaJ62pAdBsyCSQvq/RUtbV3aYd422+8gP+ek/eY02kLD5grw6qqazi9T02C1uuP LJ8JdErwQK8O9NDuaB/SaX+Q2Cvp8TyKk6S0AY5OGhvuWr5RNTs/tFOPpNR0M+sbUC pFQmNwlP6KVQmXTdZ0rAOCW/iC7aydW6xumFXJN6vWXAbcKM8oiK/ZEw4V+/Mhil/z AyyuJbTmuNuoUrYr92W8nZ+kZY/ZuGtjoO+1FshsEgJ2Q+wmOEMV/6ICtNI8+7NnyN GgJ52V4PQ2xsw== Date: Tue, 16 Aug 2022 16:44:35 -0700 From: Jakub Kicinski To: David Howells Subject: Re: [PATCH] net: Fix suspicious RCU usage in bpf_sk_reuseport_detach() Message-ID: <20220816164435.0558ef94@kernel.org> In-Reply-To: <804153.1660684606@warthog.procyon.org.uk> References: <20220816103452.479281-1-yin31149@gmail.com> <166064248071.3502205.10036394558814861778.stgit@warthog.procyon.org.uk> <804153.1660684606@warthog.procyon.org.uk> MIME-Version: 1.0 Cc: Song Liu , Martin KaFai Lau , Jakub Sitnicki , Daniel Borkmann , linux-kernel@vger.kernel.org, John Fastabend , Alexei Starovoitov , Andrii Nakryiko , Eric Dumazet , netdev@vger.kernel.org, Yonghong Song , KP Singh , Hawkins Jiawei , bpf@vger.kernel.org, Paolo Abeni , linux-kernel-mentees@lists.linuxfoundation.org, "David S. Miller" X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Tue, 16 Aug 2022 22:16:46 +0100 David Howells wrote: > So either __rcu_dereference_sk_user_data_with_flags_check() has to be a macro, > or we need to go with something like the first version of my patch where I > don't pass the condition through. Do you have a preference? I like your version because it documents what the lock protecting this field is. In fact should we also add && sock_owned_by_user(). Martin, WDYT? Would that work for reuseport? Jakub S is fixing l2tp to hold the socket lock while setting this field, yet most places take the callback lock... One the naming - maybe just drop the _with_flags() ? There's no version of locked helper which does not take the flags. And not underscores? _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees