Re: possible memory leak in exec.c, pre-10 2.0.31

Bill Hawes (whawes@star.net)
Wed, 15 Oct 1997 14:13:46 -0400


Ingo Molnar wrote:
> tried to write exploit code for this (possible) memory leak, but failed.
> But it looks like definit weak code? The patch is tested otherwise.

Hi mingo,
As long as you're working in fs/exec.c, you might want to take a look at
a low probability but massive memory leak in exec_mmap. If a clone task
with mm->count > 1 blocks while setting up a new mm, the other clone(s)
might exit, leaving the old mm->count at 1. But the old mm is
unconditionally abandoned, leaking lots of memory, inode counts, etc.

I changed 2.1.xx a while back to avoid this, but it might be worthwile
to check for the problem in 2.0.xx. (Or at least put in a printk to see
if it ever happens.)

Regards,
Bill