From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755893AbcEWNer (ORCPT ); Mon, 23 May 2016 09:34:47 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36731 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755345AbcEWNep (ORCPT ); Mon, 23 May 2016 09:34:45 -0400 Date: Mon, 23 May 2016 15:34:42 +0200 From: Michal Hocko To: Martin Schwidefsky Cc: Oleg Nesterov , Aleksa Sarai , LKML , Heiko Carstens , linux-s390@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org Subject: Re: siginfo memory leak? Message-ID: <20160523133442.GS2278@dhcp22.suse.cz> References: <20160523111630.GN2278@dhcp22.suse.cz> <20160523144319.7579e75f@mschwide> <20160523130538.GR2278@dhcp22.suse.cz> <20160523152921.11bf49d9@mschwide> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160523152921.11bf49d9@mschwide> 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 Mon 23-05-16 15:29:21, Martin Schwidefsky wrote: > On Mon, 23 May 2016 15:05:38 +0200 > Michal Hocko wrote: > > > On Mon 23-05-16 14:43:19, Martin Schwidefsky wrote: > > > On Mon, 23 May 2016 13:16:30 +0200 > > [...] > > > > diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c > > > > index 791a4146052c..41913fac14e4 100644 > > > > --- a/arch/s390/mm/fault.c > > > > +++ b/arch/s390/mm/fault.c > > > > @@ -248,6 +248,7 @@ static noinline void do_sigsegv(struct pt_regs *regs, int si_code) > > > > si.si_signo = SIGSEGV; > > > > si.si_code = si_code; > > > > si.si_addr = (void __user *)(regs->int_parm_long & __FAIL_ADDR_MASK); > > > > + si.si_errno = 0; > > > > force_sig_info(SIGSEGV, &si, current); > > > > } > > > > > > > > > > The other for place where s390 calls force_sig_info are correct. > > > Only do_sigsegv misses the clear of si_errno. > > > > I can send a full patch with the proper changelog but I am really > > wondering whether we can plug this in a more systematic way. If you > > prefer a small s390 specific I will do it right away though. Same > > applies to x86 one. > > Why not fix the bug with a small patch and then provide the "big" > solution? A potential information leak is not good .. Fair enough. Will send two patches for the places which do not do the proper initialization. -- Michal Hocko SUSE Labs