Commit 59cd9a3b authored by Jozsef Kadlecsik's avatar Jozsef Kadlecsik Committed by Kleber Sacilotto de Souza

netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()

BugLink: https://bugs.launchpad.net/bugs/1810958

[ Upstream commit 17b8b74c ]

The function is called when rcu_read_lock() is held and not
when rcu_read_lock_bh() is held.
Signed-off-by: default avatarJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 12a2d708
...@@ -41,11 +41,11 @@ ip_set_init_comment(struct ip_set_comment *comment, ...@@ -41,11 +41,11 @@ ip_set_init_comment(struct ip_set_comment *comment,
rcu_assign_pointer(comment->c, c); rcu_assign_pointer(comment->c, c);
} }
/* Used only when dumping a set, protected by rcu_read_lock_bh() */ /* Used only when dumping a set, protected by rcu_read_lock() */
static inline int static inline int
ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment) ip_set_put_comment(struct sk_buff *skb, struct ip_set_comment *comment)
{ {
struct ip_set_comment_rcu *c = rcu_dereference_bh(comment->c); struct ip_set_comment_rcu *c = rcu_dereference(comment->c);
if (!c) if (!c)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment