Skip to content

Commit

Permalink
netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()
Browse files Browse the repository at this point in the history
[ Upstream commit 17b8b74 ]

The function is called when rcu_read_lock() is held and not
when rcu_read_lock_bh() is held.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jozsef Kadlecsik authored and gregkh committed Nov 27, 2018
1 parent 064cd45 commit d8ccc61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/netfilter/ipset/ip_set_comment.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ ip_set_init_comment(struct ip_set_comment *comment,
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
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)
return 0;
Expand Down

0 comments on commit d8ccc61

Please sign in to comment.