[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070827055731.GA91@tv-sign.ru>
Date: Mon, 27 Aug 2007 09:57:31 +0400
From: Oleg Nesterov <oleg@...sign.ru>
To: taoyue <yue.tao@...driver.com>
Cc: Sukadev Bhattiprolu <sukadev@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexey Dobriyan <adobriyan@...ru>, Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Roland McGrath <roland@...hat.com>,
linux-kernel@...r.kernel.org, stable@...nel.org,
Mark Zhan <rongkai.zhan@...driver.com>,
"Ashfield, Bruce" <Bruce.Ashfield@...driver.com>
Subject: Re: [PATCH] sigqueue_free: fix the race with collect_signal()
On 08/27, taoyue wrote:
>
> Oleg Nesterov wrote:
> >On 08/24, Sukadev Bhattiprolu wrote:
> >>>>>
> >>>>I know, using current->sighand->siglock to prevent one sigqueue
> >>>>is free twice. I want to know whether it is possible that the two
> >>>>function is called in different thread. If that, the spin_lock is
> >>>>useless.
> >>>>
> >>>>
> >>>Not sure I understand. Yes, it is possible they are called by 2 different
> >>>threads, that is why we had a race. But all threads in the same thread
> >>>group have the same ->sighand, and thus the same ->sighand->siglock.
> >>>
> I has applied the new patch, and start test program last Friday.
> So far, the test program has run for three days.
Great, thanks.
> In my test program, all threads is created in one process, so they
> are in the same thread group. If two thread is not in the same thread
> group, they have the different ->sighand->siglock. In this case, the
> lock can't prevent the sigqueue object from race condition.
If two thread are not in the same thread, they can't access the same
SIGQUEUE_PREALLOC sigqueue. That is why sigqueue_free() uses current->sighand.
Otherwise, this lock doesn't make any sense, and can't protect list_del(q->list).
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