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: <20121129001759.GH18574@lenny.home.zabbo.net>
Date:	Wed, 28 Nov 2012 16:17:59 -0800
From:	Zach Brown <zab@...hat.com>
To:	Kent Overstreet <koverstreet@...gle.com>
Cc:	linux-kernel@...r.kernel.org, linux-aio@...ck.org,
	linux-fsdevel@...r.kernel.org, bcrl@...ck.org, jmoyer@...hat.com,
	axboe@...nel.dk, viro@...iv.linux.org.uk
Subject: Re: [PATCH 12/25] aio: Refcounting cleanup


>  struct kioctx {
>  	atomic_t		users;
> -	int			dead;
> +	atomic_t		dead;

Do we want to be paranoid and atomic_set() that to 0 when the ioctx is
allocated?

> +	while (!list_empty(&ctx->active_reqs)) {
> +		struct list_head *pos = ctx->active_reqs.next;
> +		struct kiocb *iocb = list_kiocb(pos);

I'd use list_first_entry() and ignore the list_kiocb() wrapper, I think.

> +	if (!atomic_xchg(&ctx->dead, 1)) {
> +		hlist_del_rcu(&ctx->list);
> +		synchronize_rcu();

> +	hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list)
> +		if (ctx->user_id == ctx_id){
> +			BUG_ON(atomic_read(&ctx->dead));

Hmm.  Won't it be possible to race lookup and io_destroy() to hit this
BUG?

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