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] [day] [month] [year] [list]
Date:	Fri, 10 Jul 2015 16:08:07 +0800
From:	Ming Lei <tom.leiming@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Akinobu Mita <akinobu.mita@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v2 5/6] blk-mq: fix freeze queue race

On Fri, Jul 10, 2015 at 5:37 AM, Tejun Heo <tj@...nel.org> wrote:
> On Thu, Jul 09, 2015 at 02:55:10PM +0800, Ming Lei wrote:
>> This patch looks fine since at least changing DEAD state of percpu ref
>> state should have been synchronized by caller.
>>
>> Also looks __percpu_ref_switch_to_percpu() need to check if the refcount
>> becomes dead after current switching, and seems something like following
>> is needed:
>
> Hmmm... but the caller is responsible for synchronization for these
> operations.  If the state changes while waiting, it indicates a
> synchronization bug and testing it one more time is kinda weird.  What
> if it changes right after that test?

OK.

Also looks it is helpful to detect the bug early by adding
WARN_ON(ref->percpu_count_ptr & __PERCPU_REF_DEAD)
after wait_event().

--
Ming Lei
--
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