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:	Tue, 16 Jun 2009 14:10:07 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	"Mike Miller (OS Dev)" <mikem@...rdog.cca.cpqcorp.net>
Cc:	jens.axboe@...cle.com, james.bottomley@...senpartnership.com,
	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH 1/1] cciss: use timeout to ensure scan thread exits

On Tue, 16 Jun 2009 15:43:25 -0500
"Mike Miller (OS Dev)" <mikem@...rdog.cca.cpqcorp.net> wrote:

> Patch 1 of 1
> 
> This patch implements wait_for_completion_interruptible_timeout in the
> scan_thread function to ensure it will exit cleanly during rmmod. Calling
> complete in cciss_remove_one caused a race condition. Using the wait with a
> timeout seems to work around that but it does fire the thread. The overhead
> should be minimal.
> 
> Changelog:
> Replace wait_for_completion_interruptible with
> wait_for_completion_interruptible_timeout in scan_thread().
> Use 5 second timeout value to avoid race.
> 
> Signed-off-by: Mike Miller
> 
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 4d4d5e0..76e7c10 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -3043,7 +3043,7 @@ static int scan_thread(void *data)
>  	h->rescan_wait = &wait;
>  
>  	for (;;) {
> -		rc = wait_for_completion_interruptible(&wait);
> +		rc = wait_for_completion_interruptible_timeout(&wait, 5);
>  		if (kthread_should_stop())
>  			break;
>  		if (!rc)

c'mon Mike, that's a hack.
--
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