Commit d2e0efd4 authored by Eric Dumazet's avatar Eric Dumazet Committed by sanglipeng
Browse files

tcp_metrics: annotate data-races around tm->tcpm_net

stable inclusion
from stable-v5.10.190
commit 05d1dc88c40f106df9cbc7ab465797fc18a06ec1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I928UI

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=05d1dc88c40f106df9cbc7ab465797fc18a06ec1



--------------------------------

[ Upstream commit d5d986ce ]

tm->tcpm_net can be read or written locklessly.

Instead of changing write_pnet() and read_pnet() and potentially
hurt performance, add the needed READ_ONCE()/WRITE_ONCE()
in tm_net() and tcpm_new().

Fixes: 849e8a0c ("tcp_metrics: Add a field tcpm_net and verify it matches on lookup")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230802131500.1478140-6-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent b25abeff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment