lkml.org 
[lkml]   [2013]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: clock_nanosleep() task_struct leak
On Tue, 5 Feb 2013, Stanislaw Gruszka wrote:
> On Mon, Feb 04, 2013 at 08:32:23PM +0100, Oleg Nesterov wrote:
> > On 02/01, Thomas Gleixner wrote:
> > >
> > > B1;2601;0cOn Fri, 1 Feb 2013, Tommi Rantala wrote:
> > >
> > > > Hello,
> > > >
> > > > Trinity discovered a task_struct leak with clock_nanosleep(), reproducible with:
> > > >
> > > > -----8<-----8<-----8<-----
> > > > #include <time.h>
> > > >
> > > > static const struct timespec req;
> > > >
> > > > int main(void) {
> > > > return clock_nanosleep(CLOCK_PROCESS_CPUTIME_ID,
> > > > TIMER_ABSTIME, &req, NULL);
> > > > }
> > > > -----8<-----8<-----8<-----
> >
> > posix_cpu_timer_create()->get_task_struct() I guess...
> >
> > Cough. I am not sure I ever understood this code, but now it certainly
> > looks as if I never saw it before.
>
> Looks on do_cpu_nanosleep() we call posix_cpu_timer_create(), but we do
> not call posix_cpu_timer_del() at the end. Fix will not be super simple,
> since we need to care about error cases. I can cook a patch if nobody
> else want to do this.

Would be much appreciated!

Thanks,

tglx


\
 
 \ /
  Last update: 2013-02-05 12:46    [W:0.117 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site