Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5641142imu; Mon, 26 Nov 2018 03:24:03 -0800 (PST) X-Google-Smtp-Source: AJdET5cE5jtvSCmWp0B9G9KmIg1VL7ZbgMbKBvM+xbV1Ubacf1qfd/ft4Zl+o/Nw/j+UWqx1Tf1c X-Received: by 2002:a63:2d82:: with SMTP id t124mr24315444pgt.260.1543231443641; Mon, 26 Nov 2018 03:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231443; cv=none; d=google.com; s=arc-20160816; b=RcGWt7tnZX7aHu0wUCpYzlG17j07Gnywkfhki5EK3Imw/OmKI92jiF2FIEHQJGJ/dC k0z8HJx4ILckK+UU8vAdEFYOJB9S0mq5H87QDfqR/+Yqtr7gLHqtJ+xH41uEuIdgKHMq j7CtzcVLwITCXTMbhVqpN7FquJjfqO6jYfh5f9XpnlRmkK+wHcsZ+SWgW2O7LaFrSNgX +6lT04UZWXsQu+y7eLnnjSi4UeTinoyT0jjRQZ9Fp0o5/oaSVZ7E8CSNfZ8DEBmKw7AQ BAMy8ZGBHoZmhDfM5xJyFkju5TKWzS1Mg2ISsQUI+Xy5e4c//fCIr5G+t1mpiUHf+RZV IrkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a518gp3GHUY7/HZveds185V4lTSRS0shHcRo5f14mbU=; b=0LKxIHBXZXYWglCYtr5eMQ+S/D6W9gCsbxn6zY1tWq4UROsmJElfpW/Zl9sZJNQ0/K OHJ04cK+lJFkKkRWbHBleP0HirFgNs4x3O7RZ7KQhNWTMa+zmLS8gaTFTWtzURvWjeoh pgyYQZRYPkrbigC+AP4fkvk8Fwpw703m7lmixILrwigp5axdJnX5IrwNroNXyUTr1fXm pKD9peTXOTOzLTomTweaoK6LPS/l/Br7d6GULAX8rTl36BfWS33E+8JX2hfnG6vBBjWX ZOFpaL3xay1SqZylMHkNmaEDFE+Lt55jhLjhU+bYwRhMiZRsVVli3QJ623KhJU68DM9J aH2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aVT6tahZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7si25673386pfu.270.2018.11.26.03.23.48; Mon, 26 Nov 2018 03:24:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aVT6tahZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbeKZVut (ORCPT + 99 others); Mon, 26 Nov 2018 16:50:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:60090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbeKZVus (ORCPT ); Mon, 26 Nov 2018 16:50:48 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B8792089F; Mon, 26 Nov 2018 10:57:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229823; bh=Uhl00aZDAdPdwveWgKnu5v5GM2fqSTGkLIUC+mAI71A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVT6tahZxGy8rmdnj09kUlFX6WZ48VqhKiIdAaHtKNuvbrGUdRsJNv3Blmd9Jmwso rI8EDpkU+uHVt5dgaCTn2Rkih9XKOQ94QAAfQHBLzJSpfSQBHKnFU+hUHgezx0w3Yl slS35ZT3wAkXuansaewR73zeYLEOQeVpOzt72jVY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jozsef Kadlecsik , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.9 16/46] netfilter: ipset: Correct rcu_dereference() call in ip_set_put_comment() Date: Mon, 26 Nov 2018 11:51:05 +0100 Message-Id: <20181126105047.719779198@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105045.447291262@linuxfoundation.org> References: <20181126105045.447291262@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 17b8b74c0f8dbf9b9e3301f9ca5b65dd1c079951 ] The function is called when rcu_read_lock() is held and not when rcu_read_lock_bh() is held. Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- include/linux/netfilter/ipset/ip_set_comment.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/netfilter/ipset/ip_set_comment.h b/include/linux/netfilter/ipset/ip_set_comment.h index 8d0248525957..9f34204978e4 100644 --- a/include/linux/netfilter/ipset/ip_set_comment.h +++ b/include/linux/netfilter/ipset/ip_set_comment.h @@ -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; -- 2.17.1