Re: [PATCH 6/9] torture: Address race in module cleanup

From: Davidlohr Bueso
Date: Fri Sep 12 2014 - 14:30:00 EST


On Fri, 2014-09-12 at 11:04 -0700, Paul E. McKenney wrote:
> On Thu, Sep 11, 2014 at 08:40:21PM -0700, Davidlohr Bueso wrote:
> > When performing module cleanups by calling torture_cleanup() the
> > 'torture_type' string in nullified However, callers are not necessarily
> > done, and might still need to reference the variable. This impacts
> > both rcutorture and locktorture, causing printing things like:
> >
> > [ 94.226618] (null)-torture: Stopping lock_torture_writer task
> > [ 94.226624] (null)-torture: Stopping lock_torture_stats task
> >
> > Thus delay this operation until the very end of the cleanup process.
> > The consequence (which shouldn't matter for this kid of program) is,
> > of course, that we delay the window between rmmod and modprobing,
> > for instance in module_torture_begin().
> >
> > Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx>
>
> Good catch! I had just been ignoring the (null), and my scripting
> doesn't care, but it is better to have it taken care of.

In addition, for locktorture this issue can cause not only null but the
printing the wrong cleanup string when a new module is loaded with a
different torture_type.

Thanks,
Davidlohr

--
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/