Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932657AbcK3TWx (ORCPT ); Wed, 30 Nov 2016 14:22:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43986 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754476AbcK3TVs (ORCPT ); Wed, 30 Nov 2016 14:21:48 -0500 Date: Wed, 30 Nov 2016 17:21:45 -0200 From: Marcelo Ricardo Leitner To: Florian Westphal Cc: Neil Horman , netdev , LKML , netfilter-devel@vger.kernel.org Subject: Re: net/sctp: vmalloc allocation failure in sctp_setsockopt/xt_alloc_table_info Message-ID: <20161130192145.GB13169@localhost.localdomain> References: <20161128141340.GA29839@hmsreliant.think-freely.org> <20161128143931.GB29839@hmsreliant.think-freely.org> <20161128151312.GA13172@localhost.localdomain> <20161128174647.GC29839@hmsreliant.think-freely.org> <20161128174710.GE28510@breakpoint.cc> <20161128175626.GD29839@hmsreliant.think-freely.org> <20161128180925.GF28510@breakpoint.cc> <20161128181803.GA13159@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161128181803.GA13159@localhost.localdomain> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 30 Nov 2016 19:21:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 36 On Mon, Nov 28, 2016 at 04:18:03PM -0200, Marcelo Ricardo Leitner wrote: > On Mon, Nov 28, 2016 at 07:09:25PM +0100, Florian Westphal wrote: > > Neil Horman wrote: > > > > [ trimming CCs ] > > > > > On Mon, Nov 28, 2016 at 06:47:10PM +0100, Florian Westphal wrote: > > > > Neil Horman wrote: > > > > > I'm not sure I agree with that. Generally speaking it seems like the right > > > > > thing to do, if you want to avoid filling logs with warnings, but this is the > > > > > sort of error that is going to be accompanied by severe service interruption. > > > > > I'd rather see a reason behind that in the logs, than just have it occur > > > > > silently. > > > > > > > > Its not silent -- the setsockopt call will fail and userspace should > > > > display an error. > > > > > > > Thats not true. If the OOM succedes in freeing enough memory to fulfill the > > > request the setsockopt may complete without error, you're just left with a > > > killed process...somewhere. Thats seems a bit dodgy to me > > > > __GFP_NOWARN is about allocation failures only and it won't disable OOM > kill messages. oom_kill_process() has no idea on GFP_NOWARN when doing > the logging. > > > We should prevent OOM killer from running in first place (GFP_NORETRY should work). > > Oh. Really? > Now I see why. Then we're basically saying that's better to fail this operation than to kill some random process around. And kmalloc() is already using GFP_NORETRY in this same place. Marcelo