From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757394AbcEDKbf (ORCPT ); Wed, 4 May 2016 06:31:35 -0400 Received: from foss.arm.com ([217.140.101.70]:44162 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbcEDKbe (ORCPT ); Wed, 4 May 2016 06:31:34 -0400 Date: Wed, 4 May 2016 10:31:22 +0000 From: Catalin Marinas To: Kangjie Lu Cc: will.deacon@arm.com, james.morse@arm.com, linux-kernel@vger.kernel.org, Kangjie Lu Subject: Re: [PATCH] fix infoleak in mm Message-ID: <20160504103120.GA17182@localhost.localdomain> References: <1462307768-5929-1-git-send-email-kjlu@gatech.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1462307768-5929-1-git-send-email-kjlu@gatech.edu> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 03, 2016 at 04:36:08PM -0400, Kangjie Lu wrote: > The stack object “si” has a total size of 128; however, only 20 > bytes are initialized. The remaining uninitialized bytes are sent > to userland via send_signal > > Signed-off-by: Kangjie Lu > --- > arch/arm64/mm/fault.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c > index 95df28b..f790eda 100644 > --- a/arch/arm64/mm/fault.c > +++ b/arch/arm64/mm/fault.c > @@ -117,6 +117,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, > { > struct siginfo si; > > + memset(&si, 0, sizeof(si)); > if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) { > pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", > tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, I'm not convinced this is necessary. Have you actually seen such information leak getting to user space? The actual writing of siginfo to the user stack happens in copy_siginfo_to_user() (called from setup_rt_frame) which should (at least in theory) only copy pre-populated fields. -- Catalin