From patchwork Wed Jun 8 16:27:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 1640797 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nwl.cc header.i=@nwl.cc header.a=rsa-sha256 header.s=mail2022 header.b=Aj93W74e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LJCLY40J1z9sFk for ; Thu, 9 Jun 2022 02:27:33 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245496AbiFHQ1a (ORCPT ); Wed, 8 Jun 2022 12:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245492AbiFHQ13 (ORCPT ); Wed, 8 Jun 2022 12:27:29 -0400 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 762DC4C7B5 for ; Wed, 8 Jun 2022 09:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nwl.cc; s=mail2022; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=gLCuitXM5U0UsjT6aqh4FTxejPxgOzkRnoMtylxwL5M=; b=Aj93W74e11vf25sioSDjLqJDZ2 NruEIIQanSDrmh1O+8WVTXEk4RkIwW/Y9tZ9tbJXmjzFLIL+SVOiNoxEz+Ojv+JNbZTBl1gxiqRfw x1f8HQHT4VXkRJac4c7/x3aaHu7luXTtrOHjbXIr3aZo/QepcpmMD7GA/AA365qIV8HJ0ip0io7wj X0uBYzu6QRRkjFy9xZa8cRsDKRvrA7cSMZNuxJgCIIa9giFPURZIu0Vg6yNsU6se3ojcgKWKHSf5l XahNAeOiksrv0WME7X8bZmWs/YAzp4fhnBKI/60cY2Bx17Vl0gLP2Hkt/3vo4ZbIymryEBKK0dAYy 0on6LaQg==; Received: from localhost ([::1] helo=xic) by orbyte.nwl.cc with esmtp (Exim 4.94.2) (envelope-from ) id 1nyyWk-00084u-S7 for netfilter-devel@vger.kernel.org; Wed, 08 Jun 2022 18:27:26 +0200 From: Phil Sutter To: netfilter-devel@vger.kernel.org Subject: [iptables PATCH 6/9] ebtables-restore: Deny --init-table Date: Wed, 8 Jun 2022 18:27:09 +0200 Message-Id: <20220608162712.31202-7-phil@nwl.cc> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220608162712.31202-1-phil@nwl.cc> References: <20220608162712.31202-1-phil@nwl.cc> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: netfilter-devel@vger.kernel.org Allowing this segfaults the program. The deny is in line with legacy ebtables, so no point in implementing support for that. Signed-off-by: Phil Sutter --- iptables/xtables-eb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index 3d15063e80e91..b986fd9e84799 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -1077,6 +1077,9 @@ print_zero: flags |= LIST_MAC2; break; case 11: /* init-table */ + if (restore) + xtables_error(PARAMETER_PROBLEM, + "--init-table is not supported in daemon mode"); nft_cmd_table_flush(h, *table, false); return 1; case 13 :