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, 11 Dec 2018 15:16:13 -0800
From:   Bart Van Assche <bvanassche@....org>
To:     Dennis Zhou <dennis@...nel.org>, Jens Axboe <axboe@...nel.dk>,
        Tejun Heo <tj@...nel.org>, Josef Bacik <josef@...icpanda.com>
Cc:     kernel-team@...com, linux-block@...r.kernel.org,
        cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
        Ming Lei <ming.lei@...hat.com>
Subject: Re: [PATCH] blkcg: handle dying request_queue when associating a
 blkg

On Tue, 2018-12-11 at 18:03 -0500, Dennis Zhou wrote:
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 6bd0619a7d6e..c30661ddc873 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -202,6 +202,12 @@ static struct blkcg_gq *blkg_create(struct blkcg *blkcg,
>  	WARN_ON_ONCE(!rcu_read_lock_held());
>  	lockdep_assert_held(&q->queue_lock);
>  
> +	/* request_queue is dying, do not create/recreate a blkg */
> +	if (blk_queue_dying(q)) {
> +		ret = -ENODEV;
> +		goto err_free_blkg;
> +	}
> +
>  	/* blkg holds a reference to blkcg */
>  	if (!css_tryget_online(&blkcg->css)) {
>  		ret = -ENODEV;

What prevents that the queue state changes after blk_queue_dying() has returned
and before blkg_create() returns? Are you sure you don't need to protect this
code with a blk_queue_enter() / blk_queue_exit() pair?

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ