Received: by 10.192.165.156 with SMTP id m28csp264477imm; Tue, 17 Apr 2018 09:46:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48SB2hmb7WJbDc0inVdZUSCSSvMb1ju3H5Ez1tq8AdmBNW3AmmRDh5CiB8LcXxJ6L9AC2UV X-Received: by 2002:a17:902:5681:: with SMTP id j1-v6mr2621785pli.383.1523983560661; Tue, 17 Apr 2018 09:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523983560; cv=none; d=google.com; s=arc-20160816; b=DC9lAnqQSdAnXxWEHaDpStabrdUacmWRWVboOmg0u2/VQbANCojgdFElTlod/MfJVq Agw6DhQs2Mbjo4S+5hhemGhoHn4FPM8gZMgvJgB40/d3S0ZXwAy34xehRvUGvbFbMWOt kjoFVDBJ8NPL8tbdJI834AfipLkT8dz3pjVLkAiq1SuNw9HWIRI1C4MbCBqAVrq0aGbs 5FyCYYZFn0UaFOkEs6jLiUz6DVz3In9kpYZtVVf9LAyUvaGokVblJDhrz++tUkW/IHTU EQ80+kVzCCh1BAlxRzjGEM63uPLzCSWY7Ed7aPJvJjB+nVCbJX+bKallUFK7uI4yZRI3 +NHQ== 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=HNmDiLV3pQtl4G4Fgjuc1DObfoPrT07/+5KXD6qDihE=; b=EgLyT4fixceCV1fXgsB97TP5pRZP412mh3Hck1h680VDPzYKU4anaD2v16x0tpyW4u AjEpnaBDSIxTaIfjwCzywZCpVP8wvUAsmoq0P7t71DWjww/6tAhRpM4AMa2fRzWv8Xsv C0ZBN6wOBfdg9YRIsISDoWEy3Qn7aRpRkpre5WL0ceREdE0fHe2qqZT4MyDAXqZRgYPm YZZ58SHb/RvknJC+QhOvSYLVm8RNYB4ZA7NkBoFODOdzrfRkKUPajmudAswmJMf8w4Wn AVJ4+WWK8TfpRM1VOpSdhgpQEK+cqlJ3pv0hePq/b/Yws91jDVFm4gtka15/ph9Qw6Nu TjkQ== 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 t12-v6si14937870plq.547.2018.04.17.09.45.45; Tue, 17 Apr 2018 09:46:00 -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 S1754848AbeDQQFw (ORCPT + 99 others); Tue, 17 Apr 2018 12:05:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754816AbeDQQFo (ORCPT ); Tue, 17 Apr 2018 12:05:44 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3BB4BCF2; Tue, 17 Apr 2018 16:05:43 +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.14 01/49] netfilter: ipset: Missing nfnl_lock()/nfnl_unlock() is added to ip_set_net_exit() Date: Tue, 17 Apr 2018 17:58:40 +0200 Message-Id: <20180417155715.098569524@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155715.032245882@linuxfoundation.org> References: <20180417155715.032245882@linuxfoundation.org> User-Agent: quilt/0.65 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.14-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)); }