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]
Message-Id: <20080407161555.3dd540f9.akpm@linux-foundation.org>
Date:	Mon, 7 Apr 2008 16:15:55 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Dmitry Adamushko <dmitry.adamushko@...il.com>
Cc:	linux-mtd@...ts.infradead.org, dwmw2@...radead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mtd/chips: add missing set_current_state() to
 cfi_{amdstd,staa}_sync()

On Thu, 03 Apr 2008 21:38:23 +0200
Dmitry Adamushko <dmitry.adamushko@...il.com> wrote:

> From: Dmitry Adamushko <dmitry.adamushko@...il.com>
> Subject: [mtd/chips] add missing set_current_state() to cfi_{amdstd,staa}_sync()
> 
> cfi_amdstd_sync() and cfi_staa_sync() call schedule() without changing
> task's state appropriately.
> 
> In case of e.g. chip->state == FL_ERASING, cfi_*_sync() will be busy-looping
> either redundantly for a fixed interval of time (for SCHED_NORMAL tasks) or
> possibly endlessly (for RT tasks and UP).
> 
> Signed-off-by: Dmitry Adamushko <dmitry.adamushko@...il.com>
> 
> ---
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
> index d072e87..458d477 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0002.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0002.c
> @@ -1763,6 +1763,7 @@ static void cfi_amdstd_sync (struct mtd_info *mtd)
>  
>  		default:
>  			/* Not an idle state */
> +			set_current_state(TASK_UNINTERRUPTIBLE);
>  			add_wait_queue(&chip->wq, &wait);
>  
>  			spin_unlock(chip->mutex);
> diff --git a/drivers/mtd/chips/cfi_cmdset_0020.c b/drivers/mtd/chips/cfi_cmdset_0020.c
> index b344ff8..492e2ab 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0020.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0020.c
> @@ -1015,6 +1015,7 @@ static void cfi_staa_sync (struct mtd_info *mtd)
>  
>  		default:
>  			/* Not an idle state */
> +			set_current_state(TASK_UNINTERRUPTIBLE);
>  			add_wait_queue(&chip->wq, &wait);
>  
>  			spin_unlock_bh(chip->mutex);

The change certainly looks correct.  Has it been runtime tested?

Thanks.
--
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