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, 5 Nov 2012 16:33:35 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Herton Ronaldo Krzesinski <herton.krzesinski@...onical.com>
Cc:	Fengguang Wu <fengguang.wu@...el.com>,
	Vivek Goyal <vgoyal@...hat.com>,
	Ben Hutchings <ben@...adent.org.uk>,
	Jens Axboe <axboe@...nel.dk>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [floppy, blk_peek_request] BUG: scheduling while atomic:
 kworker/u:0/6/0x10000002

On Mon, 5 Nov 2012, Herton Ronaldo Krzesinski wrote:

> > Fengguang, does the patch below make any difference for you please?
> > 
> > Thanks.
> 
> Yes, I saw the same thing here, destroy_workqueue should be done before
> clearing the queue (blk_cleanup_queue) indeed. user_reset_fdc called
> process_fd_request and that scheduled redo_fd_request, that tries to
> take the queue already cleaned up in set_next_request I expect.
> 
> > 
> > 
> > 
> > 
> >  drivers/block/floppy.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
> > index 1c49d71..3b9cc0f 100644
> > --- a/drivers/block/floppy.c
> > +++ b/drivers/block/floppy.c
> > @@ -4329,6 +4329,7 @@ out_unreg_region:
> >  	platform_driver_unregister(&floppy_driver);
> >  out_unreg_blkdev:
> >  	unregister_blkdev(FLOPPY_MAJOR, "fd");
> > +	destroy_workqueue(floppy_wq);
> 
> This should go right after the out_put_disk label, otherwise we may
> leak the floppy_wq on early error.

Indeed.

Fengguang, could you please test with the patch below instead? (it should 
be functionally equivalent in most of the cases though).

Thanks.



 drivers/block/floppy.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 1c49d71..e386d83 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4330,6 +4330,7 @@ out_unreg_region:
 out_unreg_blkdev:
 	unregister_blkdev(FLOPPY_MAJOR, "fd");
 out_put_disk:
+	destroy_workqueue(floppy_wq);
 	for (drive = 0; drive < N_DRIVE; drive++) {
 		if (!disks[drive])
 			break;
@@ -4340,7 +4341,6 @@ out_put_disk:
 		}
 		put_disk(disks[drive]);
 	}
-	destroy_workqueue(floppy_wq);
 	return err;
 }
 

-- 
Jiri Kosina
SUSE Labs
--
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