lkml.org 
[lkml]   [2016]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: fix potential memleak in do_error_trap
On Mon 23-05-16 17:33:55, Oleg Nesterov wrote:
> 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).

Ohh, you are right. Dunno, how I managed to miss it. Sorry about the
noise.

> But even if not, shuldn't we change fill_trap_info() instead ?

Yes that would be the proper place.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-05-23 20:01    [W:1.064 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site