Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp113419ybg; Mon, 8 Jun 2020 17:59:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrJGQWbF4PM6ITRS1JCFaU+V5gQERvBLo1XqHR50VsGbetQ1I9an2Q+yzjjCNohXCkt/pc X-Received: by 2002:a17:906:17c1:: with SMTP id u1mr24487722eje.47.1591664371467; Mon, 08 Jun 2020 17:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664371; cv=none; d=google.com; s=arc-20160816; b=Am0ws/wx6GXNIXajltkG5CVn9xxdAws/0JznpewR2bQkDpF+72ua8TbbhuZ+YKg1PW KtorapeGnhV0A4k4rdA1Nt3Dpwzg1zYGqTCIngS1GxdHn0abb0WHGgAMnmmwmV94JHdZ 0s3+8Uan7T7+6M3ss+yx1bp81lcw8RCs9rP998HoTg1N2wE8R8iudftAsIkfMb++WXZY DtOxMQZPyhU5GHW6/ffeaNawVOcB2CbBPOs8uD69QS6w9lrT9QO/H2SuwnuOBjKrotWQ D69XsUn9bXqooACUzDa2Fxp1wizRvX4yvBPBo+uJwZ2L8WDIemczcJ0VFiWIobNlU6BI Mmog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Z3iEEnwp+bRujITwFsuylYmHLQs1EIXCGCf3aUX4100=; b=umi1IEwQbTJfcHqUhKzd+lC0JcqQqTfkNySwc6FnVYLVcGjkDwzMYEqrTY7x8KxZOj mtUxqsHBYWEa+3SfAojc0v6K5bR/x4WgroYTMrUXP55PZA1OfeZcP+9TD5Y6GjNPUrFM rZOnYoiJjhDkCnly5uqqYh8UDfwWYgU/RPi/V3GjuyFNJ1Pe36R9ubnD3PKyZfkd4Num ONCHKhdhrhBtW8xh36ysZHrsjjjryUWt54a9iBu00U/dAAr1S6baHyLKcfJiPdYoNIhq uCfsuO1X6Ql/U2oL1tXhk0BgBd5/0j42ZVpyknrUn+XnpFR2gFrjtkX0V2yxWI7t7jzf NKgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n1mK95cf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id dp4si12074412ejc.258.2020.06.08.17.59.08; Mon, 08 Jun 2020 17:59:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n1mK95cf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1732639AbgFIA5X (ORCPT + 99 others); Mon, 8 Jun 2020 20:57:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:54468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728273AbgFHXIx (ORCPT ); Mon, 8 Jun 2020 19:08:53 -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 E1BC820890; Mon, 8 Jun 2020 23:08:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657733; bh=LqIvZdy0rZViN+9Rw5CFoFIo9NiAxYZqFGNN6r9tn/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1mK95cfqwdhOTBa4rQ1ZwJxhYxOzm2hG0j28XhtUnwFZhCX/XVy+RrmIlqnVbi0Y MqxzqiPQizq7FQFZ38DqiT3EqJWuevboRGMvgnkJEfPz3o1TnPcN/80ohKLRhjRZbF uCOO2nYMwH1pgiQW0O1OdHr/ruHCngA6/SunVm5c= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pablo Neira Ayuso , Sasha Levin , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 124/274] netfilter: nft_nat: return EOPNOTSUPP if type or flags are not supported Date: Mon, 8 Jun 2020 19:03:37 -0400 Message-Id: <20200608230607.3361041-124-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pablo Neira Ayuso [ Upstream commit 0d7c83463fdf7841350f37960a7abadd3e650b41 ] Instead of EINVAL which should be used for malformed netlink messages. Fixes: eb31628e37a0 ("netfilter: nf_tables: Add support for IPv6 NAT") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_nat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nft_nat.c b/net/netfilter/nft_nat.c index 8b44a4de5329..bb49a217635e 100644 --- a/net/netfilter/nft_nat.c +++ b/net/netfilter/nft_nat.c @@ -129,7 +129,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr, priv->type = NF_NAT_MANIP_DST; break; default: - return -EINVAL; + return -EOPNOTSUPP; } if (tb[NFTA_NAT_FAMILY] == NULL) @@ -196,7 +196,7 @@ static int nft_nat_init(const struct nft_ctx *ctx, const struct nft_expr *expr, if (tb[NFTA_NAT_FLAGS]) { priv->flags = ntohl(nla_get_be32(tb[NFTA_NAT_FLAGS])); if (priv->flags & ~NF_NAT_RANGE_MASK) - return -EINVAL; + return -EOPNOTSUPP; } return nf_ct_netns_get(ctx->net, family); -- 2.25.1