From mboxrd@z Thu Jan 1 00:00:00 1970 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 A8F18537F8 for ; Fri, 15 Mar 2024 20:16:16 +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=1710533776; cv=none; b=jGNLAWBAkbfLR+To9yLUfTt13KMS2JH4ExauFtdTU1lC06g+bl0xR3fIcwJ0AYU7zh8uN5V6C54TUO3xwd0+InHQYogZSFw1qbB/I2iX9bW4+dryMeXO/ML/ZmnSptn5oSCiGyLVN/waSsUzyaAhUrTfbPQCersGvHkq8CIbktM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710533776; c=relaxed/simple; bh=lRE9FY1/aY+uI6PA6612qnHUm5vKf1dngbTwEcb71Pc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iQZD6aSACJQ4Ijp+HFLS3XWTPLiw2gD7Yocw46qf3hLnSBJsY3y3hhC8HbPCo3L869eq6dqr1MrzixRfjwDZpklYPqs6c6mwFk99+c2Gdx/oXc8UuzJcPPT+xRKyharjQFqgOoN2O06aTTk9qZwKzlnmUTQ3k7i0oDnm0DR62Ms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=awX1Ar7Y; 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="awX1Ar7Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3C56C433F1; Fri, 15 Mar 2024 20:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1710533776; bh=lRE9FY1/aY+uI6PA6612qnHUm5vKf1dngbTwEcb71Pc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=awX1Ar7Y+btRU9OaZfOwAq9Q5gSWHHmNphH+yoNYI03ycfOF9EHqqxVVtJW87Udpy tnptyKGRh3lRTO1mPlc1v5SGXxqSRL4KydxGvCx3lHD9o2TtPLlrhfVkoKYqZhSUw3 sVdSZONjkk0h7bs/ukHQVdTNC7ZVoaGQL1LEW2A0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47125: sch_htb: fix refcount leak in htb_parent_to_leaf_offload Date: Fri, 15 Mar 2024 21:15:15 +0100 Message-ID: <2024031511-CVE-2021-47125-9c33@gregkh> X-Mailer: git-send-email 2.44.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=2331; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lRE9FY1/aY+uI6PA6612qnHUm5vKf1dngbTwEcb71Pc=; b=owGbwMvMwCRo6H6F97bub03G02pJDKlf1vg3sa2yfuXm+Xzqyw0PlrJMqp4gku7nGLyH3+j9h RNGmjuZOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiUW4M8/Tjrj3vMapIfZKW /XNeA9c3/zMXuBkWbDhyiOHI7Pg2zefdks/iFlcUPeZUAgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: sch_htb: fix refcount leak in htb_parent_to_leaf_offload The commit ae81feb7338c ("sch_htb: fix null pointer dereference on a null new_q") fixes a NULL pointer dereference bug, but it is not correct. Because htb_graft_helper properly handles the case when new_q is NULL, and after the previous patch by skipping this call which creates an inconsistency : dev_queue->qdisc will still point to the old qdisc, but cl->parent->leaf.q will point to the new one (which will be noop_qdisc, because new_q was NULL). The code is based on an assumption that these two pointers are the same, so it can lead to refcount leaks. The correct fix is to add a NULL pointer check to protect qdisc_refcount_inc inside htb_parent_to_leaf_offload. The Linux kernel CVE team has assigned CVE-2021-47125 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit ae81feb7338c and fixed in 5.12.10 with commit 2411c02d0389 Issue introduced in 5.12 with commit ae81feb7338c and fixed in 5.13 with commit 944d671d5faa Please see https://www.kernel.org or 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-2021-47125 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: net/sched/sch_htb.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/2411c02d03892a5057499f8102d0cc1e0f852416 https://git.kernel.org/stable/c/944d671d5faa0d78980a3da5c0f04960ef1ad893