Received: by 10.223.176.5 with SMTP id f5csp4094955wra; Tue, 30 Jan 2018 01:58:33 -0800 (PST) X-Google-Smtp-Source: AH8x225Mte8cX3fUpg1oBZSFZ7GfCXvi7DY2ja1bdJ2iEAXoNvQ25kyrer5Bdxz3tJoLEOc3IUs5 X-Received: by 10.99.164.25 with SMTP id c25mr23486851pgf.430.1517306313855; Tue, 30 Jan 2018 01:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517306313; cv=none; d=google.com; s=arc-20160816; b=uAYCcFi8B613vv3TB4Hzl73dT8fMCUzDy+z9duQffoLqcqy6HCDTBat88V3gV2P21j mf9CP1IgAS8yKWP7rk3348ycwHMCXVm8tPrn8IpzAwhzPmAYwBcg3Ajdn/vF/jtLalwy GKzAa2hbSP1ZkLBGvfPd9SvNgk9nuNZl7M5zcNmGk+U4lE5aO4AkKIc7em5i3DiOlJKJ 4CrN55O9HGNU1n27pZcmvRgBXQDkW3B2z73YwnwSatF0ARMOhtjhuRLE9br50YnrA4tI 1WbVB8gqPhCVhcCJtFoZ/iLB8v4bgc/0rs4w1bNHsDVwpv1G25MA+7K9j/xwvnZlTjjv TBcg== 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=c+Hy/S/JjBRgKUF4HGEknyJvwDF+VdGqwEerXKJdOTw=; b=Cyn8rE+EvtlkZ+lU6RI9w2SIPR7qJ3ipJ1e8ObqysTiE+cvyBDTl2DMk6DkHX5EJsl K3lHZ1CTk+ljmpbKJH0bAZ+Iep5PTPaq8ZC6tyoZN/ATGw1/4BYsnyFn3DVqTdVmF2HY Nt42aWRK5RHe09/RjyV9bRqwUxfvfZVjmPGcFNcvI2OW3jsZt+jCiSs4R9QUvc0xNGXC ENDipESfZLviYFruLOnPhnxA3CZ9tjWCHp0RnjM2UjKb94ikv1Q6ZcgB1d75A6IpSnHD YUsxOF5T1dKTGI/0cHhLAekc3VL9fg17hTaihOuxVJEdt2YSNbjiizo5lBMKJNepPGuL 9tPQ== 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 m14si4386711pgd.207.2018.01.30.01.58.19; Tue, 30 Jan 2018 01:58:33 -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 S1751718AbeA3J5p (ORCPT + 99 others); Tue, 30 Jan 2018 04:57:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:38721 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751296AbeA3J5m (ORCPT ); Tue, 30 Jan 2018 04:57:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CE6B0AE10; Tue, 30 Jan 2018 09:57:40 +0000 (UTC) Date: Tue, 30 Jan 2018 10:57:39 +0100 From: Michal Hocko To: Dmitry Vyukov Cc: "Kirill A. Shutemov" , Florian Westphal , Tetsuo Handa , David Miller , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev , Andrea Arcangeli , Yang Shi , syzkaller-bugs@googlegroups.com, LKML , Ingo Molnar , Linux-MM , David Rientjes , Andrew Morton , guro@fb.com, "Kirill A. Shutemov" Subject: Re: [netfilter-core] kernel panic: Out of memory and no killable processes... (2) Message-ID: <20180130095739.GV21609@dhcp22.suse.cz> References: <201801290020.w0T0KK8V015938@www262.sakura.ne.jp> <20180129072357.GD5906@breakpoint.cc> <20180129082649.sysf57wlp7i7ltb2@node.shutemov.name> <20180129165722.GF5906@breakpoint.cc> <20180129182811.fze4vrb5zd5cojmr@node.shutemov.name> <20180129223522.GG5906@breakpoint.cc> <20180130075226.GL21609@dhcp22.suse.cz> <20180130081127.GH5906@breakpoint.cc> <20180130082817.cbax5qj4mxancx4b@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 30-01-18 10:02:34, Dmitry Vyukov wrote: > On Tue, Jan 30, 2018 at 9:28 AM, Kirill A. Shutemov > wrote: > > On Tue, Jan 30, 2018 at 09:11:27AM +0100, Florian Westphal wrote: > >> Michal Hocko wrote: > >> > On Mon 29-01-18 23:35:22, Florian Westphal wrote: > >> > > Kirill A. Shutemov wrote: > >> > [...] > >> > > > I hate what I'm saying, but I guess we need some tunable here. > >> > > > Not sure what exactly. > >> > > > >> > > Would memcg help? > >> > > >> > That really depends. I would have to check whether vmalloc path obeys > >> > __GFP_ACCOUNT (I suspect it does except for page tables allocations but > >> > that shouldn't be a big deal). But then the other potential problem is > >> > the life time of the xt_table_info (or other potentially large) data > >> > structures. Are they bound to any process life time. > >> > >> No. > > > > Well, IIUC they bound to net namespace life time, so killing all > > proccesses in the namespace would help to get memory back. :) > > ... unless the namespace is mounted into file system. > > Let's start with NOWARN as that's what kernel generally uses for > allocations with user-controllable size. ENOMEM is roughly as > informative as the WARNING message in this case. You want __GFP_NORETRY but that is not _fully_ supported by kvmalloc right now. More specifically kvmalloc doesn't guanratee that the request will not trigger the OOM killer (like regular __GFP_NORETRY). This is because of internal vmalloc restrictions. If you are however OK to simply bail out in most cases then __GFP_NORETRY should work reasonably fine. > I think we also need to consider setting up memory cgroup for > syzkaller test processes (we do RLIMIT_AS, but that's weak). Well, this is not about syzkaller, it merely pointed out a potential DoS... And that has to be addressed somehow. -- Michal Hocko SUSE Labs