Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942229AbcJSRAF (ORCPT ); Wed, 19 Oct 2016 13:00:05 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35755 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934946AbcJSRAE (ORCPT ); Wed, 19 Oct 2016 13:00:04 -0400 Date: Wed, 19 Oct 2016 19:00:00 +0200 From: Michal Hocko To: Oleg Nesterov Cc: Leon Yu , Andrew Morton , Al Viro , Kees Cook , John Stultz , Mateusz Guzik , Janis Danisevskis , linux-kernel@vger.kernel.org Subject: Re: [PATCH] proc: fix NULL dereference when reading /proc//auxv Message-ID: <20161019165958.GM24393@dhcp22.suse.cz> References: <1476885580-7612-1-git-send-email-chianglungyu@gmail.com> <20161019141346.GJ7517@dhcp22.suse.cz> <20161019161207.GD21216@redhat.com> <20161019161731.GK24393@dhcp22.suse.cz> <20161019164428.GE21216@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161019164428.GE21216@redhat.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 19-10-16 18:44:29, Oleg Nesterov wrote: > On 10/19, Michal Hocko wrote: > > > > On Wed 19-10-16 18:12:08, Oleg Nesterov wrote: > > > On 10/19, Michal Hocko wrote: > > > > > > > > Why would we even want to open that file if there is no mm struct? > > > > > > Agreed this is strange, but I am not sure we can change this old > > > behaviour. Say, cat /proc/$pid-of-kthread/mem doesn't fail, it shows > > > the "empty mm". > > > > What kind of application would break? > > I have no idea, probably nobody will ever notice this change, just > I am always nervous when it comes to user-visible changes. > > But why do we want this change? Not that I am going to argue if you > submit a patch, but personally I see no real point. I find it much easier to not allow open than a) have a weird side effects like seeing a hijacked mm and b) risk that similar NULL ptr will repeat again because all the code paths have to check for it explicitly. -- Michal Hocko SUSE Labs