Message ID | 20201014085642.21167-1-leon@kernel.org |
---|---|
State | New |
Headers | show |
Series | [net] net: sched: Fix suspicious RCU usage while accessing tcf_tunnel_info | expand |
On Wed, Oct 14, 2020 at 1:56 AM Leon Romanovsky <leon@kernel.org> wrote: > > From: Leon Romanovsky <leonro@nvidia.com> > > The access of tcf_tunnel_info() produces the following splat, so fix it > by dereferencing the tcf_tunnel_key_params pointer with marker that > internal tcfa_liock is held. Looks reasonable to me, Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Thanks.
On Wed, 14 Oct 2020 11:56:42 +0300 Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@nvidia.com> > > The access of tcf_tunnel_info() produces the following splat, so fix it > by dereferencing the tcf_tunnel_key_params pointer with marker that > internal tcfa_liock is held. Applied, queued for stable, thanks!
diff --git a/include/net/tc_act/tc_tunnel_key.h b/include/net/tc_act/tc_tunnel_key.h index e1057b255f69..879fe8cff581 100644 --- a/include/net/tc_act/tc_tunnel_key.h +++ b/include/net/tc_act/tc_tunnel_key.h @@ -56,7 +56,10 @@ static inline struct ip_tunnel_info *tcf_tunnel_info(const struct tc_action *a) { #ifdef CONFIG_NET_CLS_ACT struct tcf_tunnel_key *t = to_tunnel_key(a); - struct tcf_tunnel_key_params *params = rtnl_dereference(t->params); + struct tcf_tunnel_key_params *params; + + params = rcu_dereference_protected(t->params, + lockdep_is_held(&a->tcfa_lock)); return ¶ms->tcft_enc_metadata->u.tun_info; #else