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-next>] [day] [month] [year] [list]
Date:   Tue, 25 Apr 2023 15:59:11 +0800
From:   Tao Su <tao1.su@...ux.intel.com>
To:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     tj@...nel.org, josef@...icpanda.com, axboe@...nel.dk,
        tao1.su@...ux.intel.com
Subject: [PATCH] Remove blkg node after destroying blkg

Kernel hang when poweroff or reboot, due to infinite restart in function
blkg_destroy_all. It will goto restart label when a batch of blkgs are
destroyed, but not remove blkg node in blkg_list. So the blkg_list is
same in every 'restart' and result in kernel hang.

By adding list_del to remove blkg node after destroying, can solve this
kernel hang issue and satisfy the previous will to 'restart'.

Reported-by: Xiangfei Ma <xiangfeix.ma@...el.com>
Tested-by: Xiangfei Ma <xiangfeix.ma@...el.com>
Tested-by: Farrah Chen <farrah.chen@...el.com>
Signed-off-by: Tao Su <tao1.su@...ux.intel.com>
---
 block/blk-cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index bd50b55bdb61..960eb538a704 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -530,6 +530,7 @@ static void blkg_destroy_all(struct gendisk *disk)
 
 		spin_lock(&blkcg->lock);
 		blkg_destroy(blkg);
+		list_del(&blkg->q_node);
 		spin_unlock(&blkcg->lock);
 
 		/*
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ