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
| ||
|
Date: Mon, 12 Dec 2022 00:47:57 -0800 From: Christoph Hellwig <hch@...radead.org> To: Tejun Heo <tj@...nel.org> Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org, linux-kernel@...r.kernel.org, darklight2357@...oud.com, Josef Bacik <josef@...icpanda.com>, Linus Torvalds <torvalds@...ux-foundation.org>, cgroups@...r.kernel.org Subject: Re: [PATCH 1/2 block/for-6.2] blk-iolatency: Fix memory leak on add_disk() failures On Sat, Dec 10, 2022 at 08:33:10AM -1000, Tejun Heo wrote: > When a gendisk is successfully initialized but add_disk() fails such as when > a loop device has invalid number of minor device numbers specified, > blkcg_init_disk() is called during init and then blkcg_exit_disk() during > error handling. Unfortunately, iolatency gets initialized in the former but > doesn't get cleaned up in the latter. > > This is because, in non-error cases, the cleanup is performed by > del_gendisk() calling rq_qos_exit(), the assumption being that rq_qos > policies, iolatency being one of them, can only be activated once the disk > is fully registered and visible. That assumption is true for wbt and iocost, > but not so for iolatency as it gets initialized before add_disk() is called. > > It is desirable to lazy-init rq_qos policies because they are optional > features and add to hot path overhead once initialized - each IO has to walk > all the registered rq_qos policies. So, we want to switch iolatency to lazy > init too. However, that's a bigger change. As a fix for the immediate > problem, let's just add an extra call to rq_qos_exit() in blkcg_exit_disk(). > This is safe because duplicate calls to rq_qos_exit() become noop's. > > Signed-off-by: Tejun Heo <tj@...nel.org> > Reported-by: darklight2357@...oud.com Looks good: Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists