[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250114133648.36702172@kernel.org>
Date: Tue, 14 Jan 2025 13:36:48 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni
<pabeni@...hat.com>, netdev@...r.kernel.org, Simon Horman
<horms@...nel.org>, David Ahern <dsahern@...nel.org>,
eric.dumazet@...il.com
Subject: Re: [PATCH net-next] inet: ipmr: fix data-races
On Mon, 13 Jan 2025 17:15:09 +0000 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.
Drivers poke into this:
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c:1006:43: error: invalid operands to binary != (have ‘atomic_long_t’ {aka ‘atomic64_t’} and ‘u64’ {aka ‘long long unsigned int’})
+ 1006 | if (mr_route->mfc->mfc_un.res.pkt != packets)
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~
+ | |
+ | atomic_long_t {aka atomic64_t}
--
pw-bot: cr
Powered by blists - more mailing lists