CVE-2022-50550: blk-iolatency: Fix memory leak on add_disk() failures
In the Linux kernel, the following vulnerability has been resolved:
blk-iolatency: Fix memory leak on adddisk() failures
When a gendisk is successfully initialized but adddisk() fails such as when a loop device has invalid number of minor device numbers specified, blkcginitdisk() is called during init and then blkcgexitdisk() 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 delgendisk() calling rqqosexit(), the assumption being that rqqos 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 adddisk() is called.
It is desirable to lazy-init rqqos policies because they are optional features and add to hot path overhead once initialized - each IO has to walk all the registered rqqos 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 rqqosexit() in blkcgexitdisk(). This is safe because duplicate calls to rqqosexit() become noop's.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50550?
CVE-2022-50550 is considered to be a low severity vulnerability due to its specific conditions for exploitation.
How do I fix CVE-2022-50550?
To resolve CVE-2022-50550, ensure that you update to the latest patched version of the Linux kernel that addresses this issue.
What component is affected by CVE-2022-50550?
CVE-2022-50550 affects the block layer's iolatency subsystem in the Linux kernel.
What versions of the Linux kernel are vulnerable to CVE-2022-50550?
The vulnerability CVE-2022-50550 affects certain versions of the Linux kernel prior to the fix being applied.
What type of vulnerability is CVE-2022-50550?
CVE-2022-50550 is a memory leak vulnerability that occurs during the initialization of block devices.