Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77C051E4BE for ; Tue, 7 Oct 2025 15:24:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850650; cv=none; b=kX1tiOMiDrZrskQvdD8S4MFImS0h0Y+ypr+XrhMOF3+loOdBeE8ZmAyO7zm6f9BXylN/LxbwpUsFuqVJHc4d3KUw52GZEVa1I+P1fFsYHVjGS9e00s5ZSqN31J/KvahWH6N+VZK7JtHXvAZCm0js9NzHCqUOIqLM7KpRY0aT298= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850650; c=relaxed/simple; bh=Fbc4gMviCu3AAhDyazqTeopVq6Mj3XC6kXFg3xIL+4c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=q/J3qtaJZr5qCpTJVB/GgOEw49KwKkHyUnautLxz2J0zF8ceYTUfrTHQYNl3aUmgxCXyP150mMf7C/Y1cklGAa7/lQ/NF9YHxn6sm0C7yQkZEw68Vkmp2Huq3SkkEXrs3Tnsl4nsZpDSFXW0UfD0EUkEXLdp82e4PV1+US2FeIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sR8hl8hT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="sR8hl8hT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0316DC4CEF1; Tue, 7 Oct 2025 15:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850650; bh=Fbc4gMviCu3AAhDyazqTeopVq6Mj3XC6kXFg3xIL+4c=; h=From:To:Cc:Subject:Date:Reply-to:From; b=sR8hl8hTThNGsxRsJfFsDvk00vDvLE7xH2gbendVGxAImFrfIFimbssAoKReKYP3j yUgO5YfLkDET/fN8L/iCX3uq4MHCwshf7a4RPgDgSh7JVZY72IGHdnGn2ZGoKehJxH RP4lLAKgVSURIP5VK8pGx6FzmkEYgGtG8PCbNTwg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50550: blk-iolatency: Fix memory leak on add_disk() failures Date: Tue, 7 Oct 2025 17:21:08 +0200 Message-ID: <2025100759-CVE-2022-50550-7147@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3136; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=t9jEUiuAyyrrzTvK6Zn2+110uufMJcxwZhXbdKCCQWM=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9W9fvB3X5mdW633W77rdyr8mfN5f38+pX/L6QUl/9 +Zfvt23O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi0XkM81317EWPh01KDNx1 eV0q+wKVX1dWtDEsOGutH6PY+ffqa0mXLdKF50JrM5tdAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: blk-iolatency: Fix memory leak on add_disk() failures 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. The Linux kernel CVE team has assigned CVE-2022-50550 to this issue. Affected and fixed versions =========================== Issue introduced in 4.19 with commit d70675121546c35feaceebf7ed9caed8716640f3 and fixed in 6.0.17 with commit 2a126e1db5553ce4498290df019866952f858954 Issue introduced in 4.19 with commit d70675121546c35feaceebf7ed9caed8716640f3 and fixed in 6.1.2 with commit 215f9437dda09531bcb80605298a24219f01cec5 Issue introduced in 4.19 with commit d70675121546c35feaceebf7ed9caed8716640f3 and fixed in 6.2 with commit 813e693023ba10da9e75067780f8378465bf27cc Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50550 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: block/blk-cgroup.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/2a126e1db5553ce4498290df019866952f858954 https://git.kernel.org/stable/c/215f9437dda09531bcb80605298a24219f01cec5 https://git.kernel.org/stable/c/813e693023ba10da9e75067780f8378465bf27cc