lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Jan 2012 10:53:32 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Rabin Vincent <rabin@....in>
Cc:	Chanho Min <chanho0207@...il.com>, Jens Axboe <axboe@...nel.dk>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/backing-dev.c: fix crash when USB/SCSI device is
 detached

On Sun, Jan 15, 2012 at 09:11:07PM +0530, Rabin Vincent wrote:
> On Sun, Jan 15, 2012 at 08:58:53PM +0800, Wu Fengguang wrote:
> > On Sun, Jan 15, 2012 at 03:58:43PM +0530, Rabin Vincent wrote:
> > > diff --git a/mm/backing-dev.c b/mm/backing-dev.c
> > > index 71034f4..a39ad70 100644
> > > --- a/mm/backing-dev.c
> > > +++ b/mm/backing-dev.c
> > > @@ -318,7 +318,7 @@ static void wakeup_timer_fn(unsigned long data)
> > >  	if (bdi->wb.task) {
> > >  		trace_writeback_wake_thread(bdi);
> > >  		wake_up_process(bdi->wb.task);
> > > -	} else {
> > > +	} else if (bdi->dev) {
> > >  		/*
> > >  		 * When bdi tasks are inactive for long time, they are killed.
> > >  		 * In this case we have to wake-up the forker thread which
> > > @@ -584,6 +584,8 @@ EXPORT_SYMBOL(bdi_register_dev);
> > >   */
> > >  static void bdi_wb_shutdown(struct backing_dev_info *bdi)
> > >  {
> > > +	struct task_struct *task = NULL;
> > 
> > NULL not necessary?
> 
> Will fix.
> 
> Also, I notice another problem here.  bdi->dev should be made NULL before the
> device is unregistered, not after:

Yes, good catch!

> 		if (!bdi_cap_flush_forker(bdi))
> 			bdi_wb_shutdown(bdi);
> 		bdi_debug_unregister(bdi);
> 		device_unregister(bdi->dev);
> 		bdi->dev = NULL;

Thanks,
Fengguang
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ