RE: memory leak in call_usermodehelper()

From: Srikumar Subramanian
Date: Wed Dec 31 2003 - 00:23:32 EST



This is my sample syscall implementation

---
asmlinkage int sys_mysyscall (int arg1, char * arg2)
{
char * argv[2], * envp[3];

argv[0] = "/usr/test"; //this program does nothing, simply returns
0
argv[1] = 0;

envp[0] = "HOME=/";
envp[1] = "PATH=/bin:/sbin/:/usr/bin:/usr/sbin";
envp[2] = 0;

call_usermodehelper (argv[0], argv, envp); //calling this way leads
to memory leak in kernel.

return 1;
}
---

Is there any alternative to call_usermodehelper in kernel 2.4.20?

Any suggestion of patch will be greatly appreciated.

Thanks & regards,
Srikumar

-----Original Message-----
From: Srikumar Subramanian
Sent: Tuesday, December 30, 2003 12:14 PM
To: 'Andrew Morton'
Cc: linux-kernel@xxxxxxxxxxxxxxx; Srikumar Subramanian; Boopathi Veerappan
Subject: RE: memory leak in call_usermodehelper()

Hi,
I am using 2.4.20-8 Redhat 9 kernel.

-----Original Message-----
From: Andrew Morton [mailto:akpm@xxxxxxxx]
Sent: Tuesday, December 30, 2003 6:20 AM
To: Srikumar Subramanian
Cc: linux-kernel@xxxxxxxxxxxxxxx; SrikumarS@xxxxxxx; BoopathiV@xxxxxxx
Subject: Re: memory leak in call_usermodehelper()

Srikumar Subramanian <SrikumarS@xxxxxxx> wrote:
>
> Hi All,
>
> >From my customized system call, I merely call call_usermodehelper() to
spawn
> a process. When I call my_system_call around 1000 times in order to spawn
> 'hello world' program, I noticed in 'top' program that system has lost 200
> KB of free memory.
> I just increased the iteration to 700000, I lost the entire 128 MB free
> memory from my system and eventually the system is freezed.
>

What version of the kernel were you using?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/