Received: by 10.192.165.148 with SMTP id m20csp579374imm; Wed, 25 Apr 2018 04:36:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+OVArZ1++6TSgA0CJepiJjd5rW5oU1VUDfz4I2Fv3o+IX0a47NKOftjx+MNJ2aDMrubtuB X-Received: by 10.99.104.131 with SMTP id d125mr23798090pgc.9.1524656190413; Wed, 25 Apr 2018 04:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656190; cv=none; d=google.com; s=arc-20160816; b=Z36CX7ubkXJcVcS/2mbkbrBnUbZaMFhatjQobwO7s4Y/LbAsGaRoXCe/6GTnhcFjgm r1CpvVyKvKvt8+ovcrtGQ1QKlNKPu76D2rJP9CrgHjHrN28fzIitAygtIjkrYzIXZbdK 8KckvLLu90o7eDNdXVmLNDvJgfT1axeomrQ6EfoLnpcHuiH1HTd+7zBTYwJ6rKzlbxAt x+2Q58q3mBwMjKP8QEF2FZBgFxi0q142oAaEBf3LxyO5pkLVyGR8PM9g4rvZJE0tsq32 QFQtmEueMkunb5h/UEUlZwRtV3Q32sukoHmeELFaTJjQvYJzZp+cHa8twKRTLR/5k5Zb 4Vtg== 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=RwEeyDBFRjvarR9Z3Z6kwLaTwjPkbkU4bByK72YNzew=; b=o+BS0Q0n+eAYNuMt6NnO3lKAjl9/+7LuRLURuh+HKiiKD9fYuCtkUNbUonBkyahme/ NeGi5qTjtrBMbhDr5eCPbYNrF8q5YR8+MQS2Kbt+s78NEfSOIK3XuRc1Qv3Rnkql88Cq Dfh1iEN3lnxDxL5AFmBuaiZthkNPpLXhJuoqTTcUCrji7Q1Szg1IJJalCE9v36j+6lDR LOvNwNjyxNuButcyuRuJ1O+ts7SEJsxf37w3Zh9unQ/g28YhyS/7hHNEE614cVhQpd32 F2cnrrSVBVgrE79oEZy5mhkB3TWJyrGZVnQhjT1CSEQNMohNB+i/XBJxPFE/26hznDVK ONmA== 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 i1-v6si15551627pld.152.2018.04.25.04.36.15; Wed, 25 Apr 2018 04:36:30 -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 S1753283AbeDYLfL (ORCPT + 99 others); Wed, 25 Apr 2018 07:35:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50780 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbeDYKeQ (ORCPT ); Wed, 25 Apr 2018 06:34:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9B1C0480; Wed, 25 Apr 2018 10:34:15 +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.16 18/26] netfilter: x_tables: cap allocations at 512 mbyte Date: Wed, 25 Apr 2018 12:33:27 +0200 Message-Id: <20180425103315.583243065@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103314.842517924@linuxfoundation.org> References: <20180425103314.842517924@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.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal commit 19926968ea86a286aa6fbea16ee3f2e7442f10f0 upstream. Arbitrary limit, however, this still allows huge rulesets (> 1 million rules). This helps with automated fuzzer as it prevents oom-killer invocation. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/x_tables.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/netfilter/x_tables.c +++ b/net/netfilter/x_tables.c @@ -40,6 +40,7 @@ MODULE_AUTHOR("Harald Welte = XT_MAX_TABLE_SIZE) return NULL; /* __GFP_NORETRY is not fully supported by kvmalloc but it should