Re: VProc child-sibling list race

Roger Tsang <[email protected]> Thu, 5 Nov 2009 07:54:08 +0000
Newsgroups gmane.linux.cluster.ssic.devel
Message-ID <[email protected]>
In the latest CVS there is a regression in switch_exec_pids() that would
eventually cause an oops decrementing reference count on an already released
vproc at vpop_wait() while running glibc tst-exec4 from
ssic-linux-bugs-2000692.  I checked in the fix.

On Wed, Nov 4, 2009 at 6:18 AM, Roger Tsang <[email protected]> wrote:

> Hi,
>
> This bug is either staring right at me or I am just having a bad hair day.
> In vpop_wait() we see VPROC LOCK is used to protect its parent-child-sibling
> list.  However the ND LIST lock doesn't protect PVP(vo)->pvp_childl from
> other threads.  Also if I am not wrong the for-loop in vpop_wait() is not
> SMP-safe since PVP(vc)->pvp_childl is neither protected by VPROC LOCK nor ND
> LIST lock.
>
> -Roger
>
> <snip>
> VPROC_LOCK_EXCL(vp, "vpop_wait");
> <snip>
>         for (vo = NULL, vc = pvp->pvp_head_childl;
>                                 vc != NULL;
>                                 vo = vc, vc = PVP(vc)->pvp_childl) {
> <snip>
>                                 VPROC_LOCK_ND_LIST_EXCL(vp, "vpop_wait");
>                                 if (vo == NULL)
>                                         pvp->pvp_head_childl =
> pvc->pvp_childl;
>                                 else
>                                         PVP(vo)->pvp_childl =
> pvc->pvp_childl;
>                                 rmb();
>                                 pvc->pvp_childl = NULL;
>                                 VPROC_UNLOCK_ND_LIST_EXCL(vp, "vpop_wait");
> <snip>
> VPROC_UNLOCK_EXCL(vp, "vpop_wait");
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july

_______________________________________________
ssic-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ssic-linux-devel