Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3923214pxb; Mon, 21 Feb 2022 08:23:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/aiAHDeMpgPABON0fbdgoUMR6SlIOfaIaEcbfW9PtcI2HovJbjGwDjGK4qp3qqR3z2fm1 X-Received: by 2002:a17:906:c259:b0:6ce:a165:cd0d with SMTP id bl25-20020a170906c25900b006cea165cd0dmr15898749ejb.270.1645460597991; Mon, 21 Feb 2022 08:23:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645460597; cv=none; d=google.com; s=arc-20160816; b=cQmfkbxOe3Rjw1dVmseXLG1Vgv+WWmxvrhhHXs+S5/pwjB1lt4pmKB72uVSa+aKkBR SN+3agXDVD7Y4H3ZUKmAOWmPfP40DVkUvETo1Kx18uadzHOblfA6qW61bCCSfD429Ydf is3klkPWCS9PjumBU8qUMetGtweQlVgpC18vWkgQ20AIGyB/uwLf2PxRW7XEp+BA4/Yf P2Nmb0z49yHbYaP7B2JBN2A+kXq8LKWCgpA96l9ITkGS9RxP+NbpQbahVN3qBP+xK0VH 3Y9Xcjl0tl6MNOSYNWrLBiBiSVuyrm81xugt2snCLZDW8Jy6WNeZf0eAUr0Bfy2MXa+i Zg6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rSZfTnYQqTOQDiuyCIWwYD1PoEA9/4Gn3xFJLe+fhBQ=; b=qxAhkRWl7tGhsEMlQiAZydHeGQVYw8Xxq5imEOUhTGPcjt+PxXs/mm1FDYwAm36Tpv SjhzLTwM7eKWejNE4ibhfAbqDNAjX9w7ORkrrUBgadQ3r6J6xa692fmgAzsKIvrHdlrw SBjlTgXuumYl63QN0LwV7p84JkoYmuB+adw7bSaCUXAz8+dFDXuOiLMBm8oi4GtRsPtA 1g/xYJ53CRsLLOi5MWmoXri+XnD+TXmPqTIrNx/XBDsa9p4Jh2etb1wr9LyXs2v1kmdj SIXHjtQgl1QfLv2PRb+UpjlkBpHowRRjh+O5belJbHfxhEzb14iRVEdm1MTeqUIjinz9 uOow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o2n60tDo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gk1si11619473ejc.36.2022.02.21.08.22.55; Mon, 21 Feb 2022 08:23:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o2n60tDo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347958AbiBUJKP (ORCPT + 99 others); Mon, 21 Feb 2022 04:10:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347446AbiBUJFs (ORCPT ); Mon, 21 Feb 2022 04:05:48 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B23024095; Mon, 21 Feb 2022 00:59:07 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A2174B80EA1; Mon, 21 Feb 2022 08:59:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEC06C340EB; Mon, 21 Feb 2022 08:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433944; bh=uCDU3Iu8HRlLzNeHWBl0YvfMWpvWbc7yd8s/av4iXHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o2n60tDoDWXEE+L8ufpkYZ9NqzM0nsUP61Qux2EELqPKXfSp7VnL+0g/O/MkOvjjK xBabQyw5UnpMoh8AczP+atUjr8kGRMzTNZfJYX79wMg/n/4y0G6rS3cupZw91Jppl/ dvGJ2bgRRLvHlVICCgcBmJp/9RGZcO4i1APTYIqY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.4 38/80] netfilter: nft_synproxy: unregister hooks on init error path Date: Mon, 21 Feb 2022 09:49:18 +0100 Message-Id: <20220221084916.817774605@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Neira Ayuso commit 2b4e5fb4d3776c391e40fb33673ba946dd96012d upstream. Disable the IPv4 hooks if the IPv6 hooks fail to be registered. Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nft_synproxy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/netfilter/nft_synproxy.c +++ b/net/netfilter/nft_synproxy.c @@ -191,8 +191,10 @@ static int nft_synproxy_do_init(const st if (err) goto nf_ct_failure; err = nf_synproxy_ipv6_init(snet, ctx->net); - if (err) + if (err) { + nf_synproxy_ipv4_fini(snet, ctx->net); goto nf_ct_failure; + } break; }