[RHEL7,COMMIT] ms/netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()

Submitted by Vasily Averin on Dec. 3, 2020, 9:07 a.m.

Details

Message ID 202012030907.0B397pnV002247@vz7build.vvs.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Vasily Averin Dec. 3, 2020, 9:07 a.m.
The commit is pushed to "branch-rh7-3.10.0-1160.6.1.vz7.171.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.6.1.vz7.171.1
------>
commit 45a46d32a35938d32b5031e8d16e7ab95fc83b77
Author: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Date:   Thu Dec 3 12:07:50 2020 +0300

    ms/netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment()
    
    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>
    
    (cherry-picked from commit 17b8b74c0f8dbf9b9e3301f9ca5b65dd1c079951)
    https://jira.sw.ru/browse/PSBM-123063
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 include/linux/netfilter/ipset/ip_set_comment.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h
index 8e2bab1..70877f8d 100644
--- a/include/linux/netfilter/ipset/ip_set_comment.h
+++ b/include/linux/netfilter/ipset/ip_set_comment.h
@@ -43,11 +43,11 @@  ip_set_init_comment(struct ip_set *set, 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, const 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;