Received: by 10.192.165.156 with SMTP id m28csp267853imm; Tue, 17 Apr 2018 09:49:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx490A3iyqQsmx4fz3CnLE9OTD2upUEGHYSBoyFN1tucaru1FEQDiFbtq6MKMcTT3qqx+jdwG X-Received: by 2002:a17:902:57d8:: with SMTP id g24-v6mr2434250plj.337.1523983790956; Tue, 17 Apr 2018 09:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523983790; cv=none; d=google.com; s=arc-20160816; b=nZqYrcdNxK4DRLDNvKcah4gGR9bv3mclIFYwlayF2GOXuy5uG3zBoMyQU/PdMqLxPb MwYqpKdiDobH1iAZIL/8+2n8AXAG3bNOgIAOlk2RbXHHoVrEeIDkXmU3ZGQENQH2bhwF W0NERktW1evJP95iLFHeXY0aLskoHkjBiKTAbtWBs+b+t6lF5UJa3avO8S9IAQohl9uo HXFWEOa/qlOh+hFAJZcVYod6li2QhqaPU2/xhoiswIHUoWtizfwSxoIMWsFHU0i3zgEI tNBCbubcYbnjQySrsQ40zhT2EmFJ0Fh+nZ4HIoiHOEuNNZ1olzRbuB2GtGU9T0/z6e7i 9COQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Q5a7jCvws31bSNQFuDqwYTPRLmIowFAbkt7+sTNESjw=; b=yj3rkmERaynpU2H+AN1KJbZTeUYKpiwoWxgf5OPieAMPziMbISziUQdyvdK/UbW0sg dpk44LI87Sw+qPdIEmAdyf+1937bIdz9eYm5am54v23SojQgk16nbrNwItXwY3j5I4rS kuFz1W4+MVjDdXI3BYQkVIpn1Sw8kIhBPRfdaZOEjBcF/Muz4KOAtCSQpA+Kyf2yYHH7 +tXnpyHaPlU+GgQXrY37vdKMTpdV4yZr8ls8RVtxofuYaie+VS3tCCzJ0OZoTZTvvXfU 1Lv3amYnjMDbaSY51bBaS/I303tXe8NDw+DFGXHAXGOrBkpqCcSYSQiVn5BlIKzWqq3f R7Lw== ARC-Authentication-Results: i=1; mx.google.com; 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 m68si13357849pfm.0.2018.04.17.09.49.36; Tue, 17 Apr 2018 09:49:50 -0700 (PDT) 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; 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 S1754668AbeDQQFD (ORCPT + 99 others); Tue, 17 Apr 2018 12:05:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34404 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854AbeDQQFA (ORCPT ); Tue, 17 Apr 2018 12:05:00 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id DEA3A8E3; Tue, 17 Apr 2018 16:04:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jozsef Kadlecsik , syzbot+36b06f219f2439fe62e1@syzkaller.appspotmail.com, Pablo Neira Ayuso Subject: [PATCH 4.15 02/53] netfilter: ipset: Missing nfnl_lock()/nfnl_unlock() is added to ip_set_net_exit() Date: Tue, 17 Apr 2018 17:58:27 +0200 Message-Id: <20180417155723.188401861@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155723.091120060@linuxfoundation.org> References: <20180417155723.091120060@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jozsef Kadlecsik commit f998b6b10144cd9809da6af02758615f789e8aa1 upstream. Patch "netfilter: ipset: use nfnl_mutex_is_locked" is added the real mutex locking check, which revealed the missing locking in ip_set_net_exit(). Signed-off-by: Jozsef Kadlecsik Reported-by: syzbot+36b06f219f2439fe62e1@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/ipset/ip_set_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c @@ -2055,6 +2055,7 @@ ip_set_net_exit(struct net *net) inst->is_deleted = true; /* flag for ip_set_nfnl_put */ + nfnl_lock(NFNL_SUBSYS_IPSET); for (i = 0; i < inst->ip_set_max; i++) { set = ip_set(inst, i); if (set) { @@ -2062,6 +2063,7 @@ ip_set_net_exit(struct net *net) ip_set_destroy_set(set); } } + nfnl_unlock(NFNL_SUBSYS_IPSET); kfree(rcu_dereference_protected(inst->ip_set_list, 1)); }