From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29AF724024E for ; Tue, 14 Jan 2025 00:35:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736814942; cv=none; b=G0wc7nh11abTued4sqjuiTmjiaadI7xGV6mn6xqB9uXplss5NvCLaNevQphD8z4cbbzMahe+NX3rrYL+lSf+tn/JNz3MbROJ0laW5CRr9WWJCc2u2AaRjygjKSffrJXLfzYVKXvtEu2QlUIHhoV0sLdDi831+HLpP6aivJYM3Y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736814942; c=relaxed/simple; bh=Z4FJ1qGx+wY2ENI6JGO9FScRIImbqT6YtQrivVRNsow=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fdhlRKr/o3G1wnl1zSsjqs8SpNOxQlmc0Tk6PD9XQ6Zmv7Bpnj+rkbsgczGPGo20s+OcZnW+XzUCKZgCi4Hgll/SNpeXc96dU7ycppWmnaOJ/wiswZByzjzLO2nh+tmincijDjM/UnKgfFK2T7k5g7gGT3IE9rJeDnoJLghRPVs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HSNerIMN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HSNerIMN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0259C4CED6; Tue, 14 Jan 2025 00:35:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736814942; bh=Z4FJ1qGx+wY2ENI6JGO9FScRIImbqT6YtQrivVRNsow=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HSNerIMNF2rR2B5WOgbzxFPFX73A5+LNqZGvdHjyV8wtucJSVT/rQAKpJPVx15Xxh cXpMxJCTII3bXzwE2fc+kKg5DtFqdbBvsZ2cbpoAEtk/d3azOdg3SjNf8S46SBfZTi htf3O71kyTJxk86FShqyxp8W4J0ilw8hR+vPZ/BH7kgydgy178x0mh8RzqRO0fXZVD ONNpqYLkPjL7J8aK67wBREincpeG5ETd38e7uozeP1bw/u/mt/DGVfQuPQlHQYq/ZI 7Ocyvv88KwV4f+3HFF7k+JYNRozrh8QIrRZQWu/6OagdlOG3Sm2dX7NtwNzWhfen89 fQ9YXvwL56G1A== Message-ID: <0543159a-addf-485f-8806-c6e56705ee28@kernel.org> Date: Mon, 13 Jan 2025 17:35:40 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next] inet: ipmr: fix data-races Content-Language: en-US To: Eric Dumazet , "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, Simon Horman , eric.dumazet@gmail.com References: <20250113171509.3491883-1-edumazet@google.com> From: David Ahern In-Reply-To: <20250113171509.3491883-1-edumazet@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/13/25 10:15 AM, Eric Dumazet wrote: > Following fields of 'struct mr_mfc' can be updated > concurrently (no lock protection) from ip_mr_forward() > and ip6_mr_forward() > > - bytes > - pkt > - wrong_if > - lastuse > > They also can be read from other functions. > > Convert bytes, pkt and wrong_if to atomic_long_t, > and use READ_ONCE()/WRITE_ONCE() for lastuse. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Eric Dumazet > --- > include/linux/mroute_base.h | 6 +++--- > net/ipv4/ipmr.c | 28 ++++++++++++++-------------- > net/ipv4/ipmr_base.c | 6 +++--- > net/ipv6/ip6mr.c | 28 ++++++++++++++-------------- > 4 files changed, 34 insertions(+), 34 deletions(-) > Reviewed-by: David Ahern