NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/42053: access of procfs occurs anonpage data leak



The following reply was made to PR kern/42053; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: ryo%nerv.org@localhost, gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/42053: access of procfs occurs anonpage data leak
Date: Sun, 13 Sep 2009 18:09:13 +0000

 On Sat, Sep 12, 2009 at 07:30:01PM +0000, ryo%nerv.org@localhost wrote:
  > access /proc/#/stat many times, anonpage data leaks.
  > then, occur "out of swap" and crash kernel.
 
 This should fix it:
 
 Index: procfs_linux.c
 ===================================================================
 RCS file: /cvsroot/src/sys/miscfs/procfs/procfs_linux.c,v
 retrieving revision 1.57
 diff -u -p -r1.57 procfs_linux.c
 --- procfs_linux.c     11 Jan 2009 03:16:33 -0000      1.57
 +++ procfs_linux.c     13 Sep 2009 18:07:39 -0000
 @@ -379,6 +379,8 @@ procfs_do_pid_statm(struct lwp *curl, st
                (unsigned long)(vm->vm_ssize),  /* stack size in pages */
                (unsigned long) 0);
  
 +      uvmspace_free(vm);
 +
        if (len == 0)
                goto out;
  
 @@ -483,6 +485,8 @@ procfs_do_pid_stat(struct lwp *curl, str
        mutex_exit(p->p_lock);
        mutex_exit(proc_lock);
  
 +      uvmspace_free(vm);
 +
        if (len == 0)
                goto out;
  
 
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index