Re: [PATCH] ksm: fix race between ksmd and exiting task

From: Chris Wright
Date: Thu Jun 02 2011 - 17:25:00 EST


* Andrea Righi (andrea@xxxxxxxxxxxxxxx) wrote:
> On Thu, Jun 02, 2011 at 10:35:49AM -0700, Chris Wright wrote:
> > Andrea Righi reported a case where an exiting task can race against
> > ksmd.
> >
> > ksm_scan.mm_slot == the only registered mm
> > CPU 1 (bug program) CPU 2 (ksmd)
> > list_empty() is false
> > lock
> > ksm_scan.mm_slot
> > list_del
> > unlock
> > slot == &ksm_mm_head (but list is now empty_)
> >
> > Close this race by revalidating that the new slot is not simply the list
> > head again.
>
> I confirm this fixes the problem on my side.
>
> Tested-by: Andrea Righi <andrea@xxxxxxxxxxxxxxx>

Great, thanks for verifying.

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