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:	Fri, 1 Jun 2012 14:06:01 +0900
From:	Tejun Heo <tj@...nel.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Jens Axboe <jaxboe@...ionio.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Alan Cox <alan@...ux.intel.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] block: avoid infinite loop in get_task_io_context()

Hello, Eric, Jens.

On Thu, May 31, 2012 at 12:38:26PM +0200, Eric Dumazet wrote:
> [PATCH] block: avoid infinite loop in get_task_io_context()
> 
> Calling get_task_io_context() on a exiting task which isn't %current can
> loop forever. This triggers at boot time on my dev machine.
> 
> BUG: soft lockup - CPU#3 stuck for 22s ! [mountall.1603]
> 
> Fix this by making create_task_io_context() returns -EBUSY in this case
> to break the loop.
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Alan Cox <alan@...ux.intel.com>
> ---
>  block/blk-ioc.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-ioc.c b/block/blk-ioc.c
> index 1e2d53b..893b800 100644
> --- a/block/blk-ioc.c
> +++ b/block/blk-ioc.c
> @@ -235,6 +235,7 @@ void ioc_clear_queue(struct request_queue *q)
>  int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node)
>  {
>  	struct io_context *ioc;
> +	int ret;
>  
>  	ioc = kmem_cache_alloc_node(iocontext_cachep, gfp_flags | __GFP_ZERO,
>  				    node);
> @@ -262,9 +263,12 @@ int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node)
>  		task->io_context = ioc;
>  	else
>  		kmem_cache_free(iocontext_cachep, ioc);
> +
> +	ret = task->io_context ? 0 : -EBUSY;
> +
>  	task_unlock(task);
>  
> -	return 0;
> +	return ret;

Ah, right.  This seems correct to me.

FWIW-late-Acked-by: Tejun Heo <tj@...nel.org>

Thanks. :)

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