Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2577322imm; Thu, 16 Aug 2018 11:48:29 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzK7KmvIiw4vXXh31B+JZWsFk2Imy+lp6bBgHWLNFfqtA6XLT1cH4X5x5mKoOdueK3OJYhq X-Received: by 2002:a17:902:7c89:: with SMTP id y9-v6mr30154261pll.187.1534445309423; Thu, 16 Aug 2018 11:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534445309; cv=none; d=google.com; s=arc-20160816; b=NRxqGzAgpeWS8WVtSwHTfMwDWbfpLUg4KGWAeiBxtmyBkeF/o0rdHDxwi6y2Kv0w2h 5htyDWwBWp6XrRylrBaGK1WMXM9TZ/TE6GIZDUXJQ5vy/RDtHuy+au28lS1uC1MA2lfB /637tlzH8NJq5bpj4nPMmNWGVm1PzsFqsgegBUTrH7+WEFPUE5UoociEr23D4EguoCMg 8n8q9K9tv7DFG75k4syjKTUsd2zlf8CG9Q19ZaIGAkq2G7d52RUqjS6Pk99J4FzPlytQ IChxYfE62g+kKfJUWIT4CgI3szjxuP1riMFMNpLCdypd1su5YGW7zsXMQ0wo41sZRKqR yUGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=XvXl+CTteoJGMHkDYziYMpoLErwI4wN+73ofyP0b2YY=; b=GjhAPskkoC2xYw+W2Ug6BicZ09CzBNQ9YgCYr2dkxqRIfvm9ZrKpKUWaw4e0jbFRxG jvnyBxvErUbeFQMNoDxdJqp4lDiTAnsRlMyPilL8i24xFUE+urOSZHRW/WnKV5lyagLH VIr7MEURHYFUl3tixf1Y07L5RZVQPfvJkhIxpGvmz0seVDud4ViQBrYxKh59pDMpqRVJ GhWloHPETyV3IwLstoQxGYrem577jdzGhUHveDKUpSGtKyp20CetfEAPPd9j/ST/SUtK Bkk8VK2zNqSzW6UkRzBHR1oFdsoRfW9mQ5NYsPh1SYVoDUcRAnHadBAT9JSUQB3nwgjT WQpQ== 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 b8-v6si56784plx.110.2018.08.16.11.48.13; Thu, 16 Aug 2018 11:48:29 -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 S2392554AbeHPTkx (ORCPT + 99 others); Thu, 16 Aug 2018 15:40:53 -0400 Received: from mail.us.es ([193.147.175.20]:49780 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727949AbeHPTkw (ORCPT ); Thu, 16 Aug 2018 15:40:52 -0400 Received: from antivirus1-rhel7.int (unknown [192.168.2.11]) by mail.us.es (Postfix) with ESMTP id 1F9BE249FA for ; Thu, 16 Aug 2018 18:38:51 +0200 (CEST) Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id 0B6EDDA729 for ; Thu, 16 Aug 2018 18:38:51 +0200 (CEST) Received: by antivirus1-rhel7.int (Postfix, from userid 99) id DE9CBDA7E9; Thu, 16 Aug 2018 18:38:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on antivirus1-rhel7.int X-Spam-Level: X-Spam-Status: No, score=-108.2 required=7.5 tests=ALL_TRUSTED,BAYES_50, SMTPAUTH_US2,USER_IN_WHITELIST autolearn=disabled version=3.4.1 Received: from antivirus1-rhel7.int (localhost [127.0.0.1]) by antivirus1-rhel7.int (Postfix) with ESMTP id A0377DA794; Thu, 16 Aug 2018 18:38:48 +0200 (CEST) Received: from 192.168.1.97 (192.168.1.97) by antivirus1-rhel7.int (F-Secure/fsigk_smtp/550/antivirus1-rhel7.int); Thu, 16 Aug 2018 18:38:48 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/antivirus1-rhel7.int) Received: from us.es (sys.soleta.eu [212.170.55.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 1984lsi) by entrada.int (Postfix) with ESMTPSA id 6E595426CC47; Thu, 16 Aug 2018 18:38:48 +0200 (CEST) Date: Thu, 16 Aug 2018 18:41:10 +0200 X-SMTPAUTHUS: auth mail.us.es From: Pablo Neira Ayuso To: Michal Hocko Cc: Florian Westphal , Vlastimil Babka , Georgi Nikolov , Andrew Morton , "David S. Miller" , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Michal Hocko Subject: Re: [PATCH] netfilter/x_tables: do not fail xt_alloc_table_info too easilly Message-ID: <20180816164110.g2dedcm7nh75zjms@salvia> References: <20180807195400.23687-1-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180807195400.23687-1-mhocko@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 07, 2018 at 09:54:00PM +0200, Michal Hocko wrote: > From: Michal Hocko > > eacd86ca3b03 ("net/netfilter/x_tables.c: use kvmalloc() > in xt_alloc_table_info()") has unintentionally fortified > xt_alloc_table_info allocation when __GFP_RETRY has been dropped from > the vmalloc fallback. Later on there was a syzbot report that this > can lead to OOM killer invocations when tables are too large and > 0537250fdc6c ("netfilter: x_tables: make allocation less aggressive") > has been merged to restore the original behavior. Georgi Nikolov however > noticed that he is not able to install his iptables anymore so this can > be seen as a regression. > > The primary argument for 0537250fdc6c was that this allocation path > shouldn't really trigger the OOM killer and kill innocent tasks. On the > other hand the interface requires root and as such should allow what the > admin asks for. Root inside a namespaces makes this more complicated > because those might be not trusted in general. If they are not then such > namespaces should be restricted anyway. Therefore drop the __GFP_NORETRY > and replace it by __GFP_ACCOUNT to enfore memcg constrains on it. Applied, thanks.