]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
blkcg: init root blkcg_gq under lock
authorJiang Biao <jiang.biao2@zte.com.cn>
Thu, 19 Apr 2018 04:06:09 +0000 (12:06 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:55:23 +0000 (14:55 +0200)
commitd8cf6310ec42a2ec3de8dd5a02eaf388b28d0439
treeb96bd1cc6a489aefcfbb11082f49384c26dff986
parentc9543e2ba5b7d019420eec06975326ded04cca9e
blkcg: init root blkcg_gq under lock

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit 901932a3f9b2b80352896be946c6d577c0a9652c ]

The initializing of q->root_blkg is currently outside of queue lock
and rcu, so the blkg may be destroied before the initializing, which
may cause dangling/null references. On the other side, the destroys
of blkg are protected by queue lock or rcu. Put the initializing
inside the queue lock and rcu to make it safer.

Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
CC: Tejun Heo <tj@kernel.org>
CC: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
block/blk-cgroup.c