Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1424570imm; Thu, 5 Jul 2018 23:11:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmhT5HpINqc3wTapi5QS11AZJlGzleJ3lKwSuV07cs/IgOyTqXrm2mk8UV0hZoSdeA3dWU X-Received: by 2002:a17:902:3124:: with SMTP id w33-v6mr8970011plb.235.1530857473724; Thu, 05 Jul 2018 23:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530857473; cv=none; d=google.com; s=arc-20160816; b=uZJOwxZ0kn6ilm8WtGtuL1W3dGEVmJyoKHJP1WpQTx9y7KJvBSsCfsVxTqXQCOcYTu HoJWvImu1pccS2iabp1SwzJpwvrVaGgkKAwtDnQLyAvRm3VrTnZ7Z2zIY4gdOtQMwafD R3Mft4CX27m2G34a+X9rHLjyXjEbsTGK0LB5fP/Immr6EE/kQ6HyV5/JG820To0Wunyx 3+d9cLflhjfSUGjm8+XjPJydAtiwkpZ2apmwgYjgJTUcmMlDDb2Tk5yH2sW3OqQc0T6W zdEtmaOISa2dJ7DJqu0weiChszEqnWswgWONuSPgBUrOQnMIi0JziNlQw5n6Bvch0+NL cRbg== 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=ebykhWSIoqzRL3W4Uh9xAglPn1T6FfWpIWAOmiIi8Ws=; b=k+8w2GFMGIGdS8ITzqqCDCi9gD0FOlySSpcFJA6/wP20reYV/SIg3uOX8dnqARaGPq d9RKoFDsptW9G1/eMEpZvj8l8HaKlVnUFGFgQPMS0pQGEaPBvKqfb6G5P/e3Ms+OmFxN a1SxA8RN+Ok9FdoHWZ+8QfmwGRgDCBBFS84m6c+XMy67TUceKi3RRpUyp8138bzUUnSN dvV+r9utDK8x+j0j6WtwCIc2YADq5sf8uebLuQNMcnSEf+3SDHgMMKSQbNnspR6A9+mY yCwXG+plkUBGQaKNBv16Sbh9qo+ZIU0Gsrfs+mUkPw3jJ0dWDsabrhfVf8HuW57yyzEb hUQQ== 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 f21-v6si6964165pgl.235.2018.07.05.23.10.58; Thu, 05 Jul 2018 23:11:13 -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 S933435AbeGFFtJ (ORCPT + 99 others); Fri, 6 Jul 2018 01:49:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60208 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933395AbeGFFtH (ORCPT ); Fri, 6 Jul 2018 01:49:07 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 47100BA2; Fri, 6 Jul 2018 05:49:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Westphal , Pablo Neira Ayuso Subject: [PATCH 4.17 42/46] netfilter: xt_connmark: fix list corruption on rmmod Date: Fri, 6 Jul 2018 07:47:03 +0200 Message-Id: <20180706054526.667804422@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054524.595521988@linuxfoundation.org> References: <20180706054524.595521988@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.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal commit fc6ddbecce440df74fb4491c17c372b52cf5be83 upstream. This needs to use xt_unregister_targets, else new revision is left on the list which then causes list to point to a target struct that has been free'd. Fixes: 472a73e00757 ("netfilter: xt_conntrack: Support bit-shifting for CONNMARK & MARK targets.") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/xt_connmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/xt_connmark.c +++ b/net/netfilter/xt_connmark.c @@ -211,7 +211,7 @@ static int __init connmark_mt_init(void) static void __exit connmark_mt_exit(void) { xt_unregister_match(&connmark_mt_reg); - xt_unregister_target(connmark_tg_reg); + xt_unregister_targets(connmark_tg_reg, ARRAY_SIZE(connmark_tg_reg)); } module_init(connmark_mt_init);