lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130207132455.GA25793@redhat.com>
Date:	Thu, 7 Feb 2013 14:24:55 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Stanislaw Gruszka <sgruszka@...hat.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Dave Jones <davej@...hat.com>,
	John Stultz <john.stultz@...aro.org>,
	Tommi Rantala <tt.rantala@...il.com>
Subject: Re: [PATCH] posix-cpu-timers: fix nanosleep task_struct leak

On 02/07, Stanislaw Gruszka wrote:
>
> On Wed, Feb 06, 2013 at 05:10:11PM +0100, Oleg Nesterov wrote:
> >
> > It is not clear to me why other posix_cpu_timer_del's above can't fail..
> > May be you can add a comment.
>
> Sure, I'll add more comments.

Yes, please. This will help the next reader to understand that no, we
do not forget to check the error code, just we do not need to do this.

> Once posix_cpu_timer_set(..., &zero_it, it) succeed with 0 return value,
> it's not possible to fire timer, so posix_cpu_timer_del() will not fail.
> Similar assumption is with first posix_cpu_timer_del() call I added
> in the patch.

OK, I see.

> > And I am not sure that TIMER_RETRY is the only error we should worry.
> > And perhaps we need even more posix_cpu_timer_del's?
> >
> > For example. Suppose that posix_cpu_timer_create() succeeds and does
> > get_task_struct(p). But than p dies, and the first posix_cpu_timer_set()
> > fails with -ESRCH. No?
>
> On second -ESRCH case posix_cpu_timer_set() internally call
> put_task_struct().

Ah, missed that, thanks.

> It does not remove from cpu_timers list, but
> that is done at exit().

Yes, posix_cpu_timers_exit().

OK, thanks for your explanations, I think the patch is fine.


> BTW: I don't think we handle correctly case when traced process -
> - timer->it.cpu.task will die. Tracing process - timer->it_process will
> probably not be woken up.

Probably... or perhaps we can treat this case as "timer never expires".

Oleg.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ