Received: by 10.223.176.5 with SMTP id f5csp1013802wra; Wed, 7 Feb 2018 11:07:40 -0800 (PST) X-Google-Smtp-Source: AH8x224GLuPgbvgt2i2spS3afo4C5XqbUBF50jBG/3GNWEijQHT1jprxpgGmofMwToY3rcI+c8U6 X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr7253686pln.164.1518030460875; Wed, 07 Feb 2018 11:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518030460; cv=none; d=google.com; s=arc-20160816; b=D+ojr1efLyb77yF9gWZNL7Tk/llj/bicO6G7FGgPp8SL6JqtYq9V6ECEEvBiMs/6jq mdgRB+lZSzrVQ+hgjahUNuAMSLRGZzoETL3v5rb4mEdcvc004nwXhrVChT0hSzJmpaAv oFguRrd+o4dyZz3FtxhDdx1rrKVcRqH6Rmdul4XQp05UERdUbX0hZ/QYoPMW58SbC4dg wWp/bU3UXLn6wfBjVzFlx9SLhjnn/XioG8aTYV5QzfxR6TgdjnHqG/SFmq99y5ET+J28 IY4jR/ZpK+FmjwTIcCTvk2+swKCgvFts8FfVo/lNS380TgZuWgfq0kmoYx6t1DAEKXiu YAsw== 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:subject:cc:to:from:date :arc-authentication-results; bh=AcwWwu4IywWl79ucGYp6MAAGV9gnzXSgp44tguDuTO8=; b=uuKoSEV0hhGTCPX55e9fi1edQvTGaRWnBzSYYGSfdQMJU9/Pr4rr58hWOob4KLIiYc z4DD+HSRKDIZVEKKsb8vVxnelQse2uMyUQBHksIHLpoPZcsX7IqL64hTlt8Jww1ufV3a oNwhlj52H4UVqzDdxAgPRr25xs0RqazRHkd8p/7FdbvbLjp4mgOeqUFg9xzxCCrLD9YQ OmuLt9ezUkp3LF2ldfCVcFDoNlNBOCtsJ/KAPRDfVJvoYn888bjkSstu9NPiN80Yp8us kUFu56UwuOgbEEBqEDkkmUcgFcIer08pIeQHgtn6a9V+cTVqsbYPao4Xrw/lFX7XNPPj 3JCQ== 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 u91-v6si1491613plb.5.2018.02.07.11.07.27; Wed, 07 Feb 2018 11:07:40 -0800 (PST) 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 S1754696AbeBGTGr (ORCPT + 99 others); Wed, 7 Feb 2018 14:06:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39862 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754141AbeBGTGp (ORCPT ); Wed, 7 Feb 2018 14:06:45 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ECCE0EBF; Wed, 7 Feb 2018 19:06:43 +0000 (UTC) Date: Wed, 7 Feb 2018 11:06:42 -0800 From: Andrew Morton To: Pablo Neira Ayuso Cc: Michal Hocko , Andrea Arcangeli , Yang Shi , Tetsuo Handa , netdev , guro@fb.com, LKML , Ingo Molnar , syzkaller-bugs@googlegroups.com, Linux-MM , coreteam@netfilter.org, netfilter-devel@vger.kernel.org, "Kirill A. Shutemov" , David Rientjes , "Kirill A. Shutemov" , David Miller , Dmitry Vyukov Subject: Re: [netfilter-core] kernel panic: Out of memory and no killable processes... (2) Message-Id: <20180207110642.dbb3fe499a134d1369f05a2f@linux-foundation.org> In-Reply-To: <20180207174439.esm4djxb4trbotne@salvia> References: <20180129182811.fze4vrb5zd5cojmr@node.shutemov.name> <20180129223522.GG5906@breakpoint.cc> <20180130075226.GL21609@dhcp22.suse.cz> <20180130081127.GH5906@breakpoint.cc> <20180130082817.cbax5qj4mxancx4b@node.shutemov.name> <20180130095739.GV21609@dhcp22.suse.cz> <20180130140104.GE21609@dhcp22.suse.cz> <20180130112745.934883e37e696ab7f875a385@linux-foundation.org> <20180131081916.GO21609@dhcp22.suse.cz> <20180207174439.esm4djxb4trbotne@salvia> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Feb 2018 18:44:39 +0100 Pablo Neira Ayuso wrote: > Hi, > > On Wed, Jan 31, 2018 at 09:19:16AM +0100, Michal Hocko wrote: > [...] > > Yeah, we do not BUG but rather fail instead. See __vmalloc_node_range. > > My excavation tools pointed me to "VM: Rework vmalloc code to support mapping of arbitray pages" > > by Christoph back in 2002. So yes, we can safely remove it finally. Se > > below. > > > > > > From 8d52e1d939d101b0dafed6ae5c3c1376183e65bb Mon Sep 17 00:00:00 2001 > > From: Michal Hocko > > Date: Wed, 31 Jan 2018 09:16:56 +0100 > > Subject: [PATCH] net/netfilter/x_tables.c: remove size check > > > > Back in 2002 vmalloc used to BUG on too large sizes. We are much better > > behaved these days and vmalloc simply returns NULL for those. Remove > > the check as it simply not needed and the comment even misleading. > > > > Suggested-by: Andrew Morton > > Signed-off-by: Michal Hocko > > --- > > net/netfilter/x_tables.c | 4 ---- > > 1 file changed, 4 deletions(-) > > > > diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c > > index b55ec5aa51a6..48a6ff620493 100644 > > --- a/net/netfilter/x_tables.c > > +++ b/net/netfilter/x_tables.c > > @@ -999,10 +999,6 @@ struct xt_table_info *xt_alloc_table_info(unsigned int size) > > if (sz < sizeof(*info)) > > return NULL; > > > > - /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */ > > - if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages) > > - return NULL; > > - > > /* __GFP_NORETRY is not fully supported by kvmalloc but it should > > * work reasonably well if sz is too large and bail out rather > > * than shoot all processes down before realizing there is nothing > > Patchwork didn't catch this patch for some reason, would you mind to > resend? From: Michal Hocko Subject: net/netfilter/x_tables.c: remove size check Back in 2002 vmalloc used to BUG on too large sizes. We are much better behaved these days and vmalloc simply returns NULL for those. Remove the check as it simply not needed and the comment is even misleading. Link: http://lkml.kernel.org/r/20180131081916.GO21609@dhcp22.suse.cz Suggested-by: Andrew Morton Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: Florian Westphal Cc: David S. Miller Signed-off-by: Andrew Morton --- net/netfilter/x_tables.c | 4 ---- 1 file changed, 4 deletions(-) diff -puN net/netfilter/x_tables.c~net-netfilter-x_tablesc-remove-size-check net/netfilter/x_tables.c --- a/net/netfilter/x_tables.c~net-netfilter-x_tablesc-remove-size-check +++ a/net/netfilter/x_tables.c @@ -1004,10 +1004,6 @@ struct xt_table_info *xt_alloc_table_inf if (sz < sizeof(*info)) return NULL; - /* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */ - if ((size >> PAGE_SHIFT) + 2 > totalram_pages) - return NULL; - /* __GFP_NORETRY is not fully supported by kvmalloc but it should * work reasonably well if sz is too large and bail out rather * than shoot all processes down before realizing there is nothing _