[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110911015431.GK29319@htj.dyndns.org>
Date: Sun, 11 Sep 2011 10:54:31 +0900
From: Tejun Heo <tj@...nel.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: "Rafael J. Wysocki" <rjw@...k.pl>, matthltc@...ibm.com,
paul@...lmenage.org, containers@...ts.linux-foundation.org,
linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] freezer: fix wait_event_freezable/__thaw_task races
Hello,
On Thu, Sep 08, 2011 at 07:59:26PM +0200, Oleg Nesterov wrote:
> > Indeed, nice catch. This one actually is pretty dangerous. We
> > probably want to make a separate fix for this and backport it to
> > -stable?
>
> And I forgot to mention that wait_event_freezable_timeout() doesn't
> handle -ERESTARTSYS at all.
>
> But I don't think -stable needs this fix. According to grep, nobody
> check the returned value, and none of the callers plays with signals.
Ah, no user, okay.
> > Yeap, with freezable_with_signal gone, this looks correct & simpler to
> > me
>
> I don't really understand this... set_freezable_with_signal() has a
> lot of problems, yes... But even if it wasn't removed this fix makes
> sense anyway, afaics.
>
> If freezable_with_signal caller does wait_event_freezable_timeout(),
> __retval becomes -ERESTARTSYS after freeze_task(). The next iteration
> will return 0 with the KERN_ERR message from schedule_timeout().
Hmmm... but with the change, if a kthread gets TIF_SIGPENDING from
freezer and then thawed, it would not enter try_to_freeze() and thus
won't clear TIF_SIGPENDING. The original code was racy too but the
window would be much larger afterwards. Anyways, this doesn't matter
anymore.
> > but it would be nice if you can sprinkle some documentation while
> > at it. :)
>
> But they already have the comment ;) What can I add?
Proper /** - */ comment w/ return value documentation? :P
Thanks.
--
tejun
--
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