Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp180066imd; Wed, 31 Oct 2018 16:56:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5cxAAPyYqhSYfMjIxyj3vMRkGO9eJ9efVMBgmiGpiqkbGNpFgY9BKtURBrfCeZHjwEW3bo9 X-Received: by 2002:a63:5102:: with SMTP id f2-v6mr4983169pgb.31.1541030186907; Wed, 31 Oct 2018 16:56:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030186; cv=none; d=google.com; s=arc-20160816; b=UjmuBvy8OBm1qmBQrASStQ/dhR7OBT3G5PmoO+Nb9eHfYDBFbQCT7N9ELZdXJKQcsm 0qquBTj6Q6r75PuxR3VkwSjQSno99VIyyc533Kx5jAUtzg1COlGDQ0UO6KiWijjOPWAn POyKAEDtM/1ccrDDUJaO73bHcBo9ILoJP/xohmMQlA6p3Hf4uHExYevIXmp4RT4pbj/q 6l3Jcz0RX2SbkCBeqSB3TwU5zx7bZ5bH3mWFRSk9COz9S/+MIUCqlijSgAnZgPvYxS22 c7pyhIGwKK8cu4Z/uO3/3sUAdxmLBXoWx4tMZ0obw6aBIUg3O1F3El34hYUq1dlueWfD XfCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GAiqMO9acWhS3ZVkVfGLwaf3lLrn2J8bNg+7+jSg5dQ=; b=U011kqHTIdeLwWdUu6YBmPzHxj4NxQ7y85eQiHQmWznbLDkwq+a39N/BHPn9+JvUln ZgsJsVc4lwxD0jGAhEwQ8wnesPflfJxhHzp9c00zO0GsToh0psBVFsdy39T8M48GFS6O g2RMPWv6ppL+AbLGjBZ45sdCtUHg7JhsAaN0zRD4bT9x3ltR21QQoCxbAHo6lVRqO9ho 0YfokcxBumhf6G32RrihLq77DTKd383o22JwylTc3ZUohEGfpCoVP7RhrUzA4G0e90kc /a7lBNEzz1/dIcVj+8prQdVa8c7ajPurovrcKj/ufVWEK7Iwjxz249mKycR1R4JzHomi sLFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZawKatXN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si29472205ply.48.2018.10.31.16.56.12; Wed, 31 Oct 2018 16:56:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ZawKatXN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbeKAIGA (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:52602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbeKAIF6 (ORCPT ); Thu, 1 Nov 2018 04:05:58 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 300A72081B; Wed, 31 Oct 2018 23:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027147; bh=dmTmDw5DWyZK6c8ksWdkiDh5kuStnoBoGKfBOtvHF6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZawKatXNiMFLYcnF9yyMU+xK84OyH4DoMIWY/wI4mDP73bFT+atu6NScaUC+X9WX9 0H8G0HCQqVk2EYXhynihTaDbobKQy9VNJpE0n7V8Al4YAxZ7MRL7ClwsbT3zgmiabM Vd/HZqAXV+EJERXiR+xHPQjf2K06qnE+okWyw6z0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paolo Abeni , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH AUTOSEL 4.19 005/146] netfilter: xt_nat: fix DNAT target for shifted portmap ranges Date: Wed, 31 Oct 2018 19:03:20 -0400 Message-Id: <20181031230541.28822-5-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni [ Upstream commit cb20f2d2c0507d60d94ef896991e95708f051dd1 ] The commit 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges") did not set the checkentry/destroy callbacks for the newly added DNAT target. As a result, rulesets using only such nat targets are not effective, as the relevant conntrack hooks are not enabled. The above affect also nft_compat rulesets. Fix the issue adding the missing initializers. Fixes: 2eb0f624b709 ("netfilter: add NAT support for shifted portmap ranges") Signed-off-by: Paolo Abeni Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/xt_nat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/netfilter/xt_nat.c b/net/netfilter/xt_nat.c index 8af9707f8789..ac91170fc8c8 100644 --- a/net/netfilter/xt_nat.c +++ b/net/netfilter/xt_nat.c @@ -216,6 +216,8 @@ static struct xt_target xt_nat_target_reg[] __read_mostly = { { .name = "DNAT", .revision = 2, + .checkentry = xt_nat_checkentry, + .destroy = xt_nat_destroy, .target = xt_dnat_target_v2, .targetsize = sizeof(struct nf_nat_range2), .table = "nat", -- 2.17.1