From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074AbcEWPeB (ORCPT ); Mon, 23 May 2016 11:34:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753089AbcEWPd7 (ORCPT ); Mon, 23 May 2016 11:33:59 -0400 Date: Mon, 23 May 2016 17:33:55 +0200 From: Oleg Nesterov To: Michal Hocko Cc: Aleksa Sarai , LKML , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org Subject: Re: [PATCH] x86: fix potential memleak in do_error_trap Message-ID: <20160523153355.GA8449@redhat.com> References: <20160523111630.GN2278@dhcp22.suse.cz> <20160523135428.GU2278@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160523135428.GU2278@dhcp22.suse.cz> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 23 May 2016 15:33:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/23, Michal Hocko wrote: > > @@ -271,6 +271,7 @@ static void do_error_trap(struct pt_regs *regs, long error_code, char *str, > > if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) != > NOTIFY_STOP) { > + memset(&info, 0, sizeof(info)); > cond_local_irq_enable(regs); > do_trap(trapnr, signr, str, regs, error_code, > fill_trap_info(regs, signr, trapnr, &info)); at first glance fill_trap_info() initializes everything we will copy to user-space in copy_siginfo_to_user(__SI_FAULT). But even if not, shuldn't we change fill_trap_info() instead ? Oleg.