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 7957F2C1AD for ; Wed, 28 Feb 2024 08:18:14 +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=1709108294; cv=none; b=AhqKr9IURCatLEuJUOTYnx6ly5XrBuKvh4VVl8X1plBB/2B3r6KWOhuGh6G3qG5dzIJbZyrgqxa0OEofsfdlthOQzyShhU0YYiDGMbJT03gTWDh2/Uu4d7DYNJWcoBP8tQuLKSXTX7WXHV0XpkrN40Gr3Vmy5YLy+nhRknVazkc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709108294; c=relaxed/simple; bh=96II5SOv3BLYEbUlQaD+siINq3dolRVDPQN2p/aJkxY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uBrqjINmC41vaxUxqvs9GNvWhWfykFNJy9qeSPOsvrgwUrunKMs7gnV131rJQZBvZxf70gy1QnBtuuatVsVlpW8AW/DrKTchnC1Ymf+XDIsERVNqbpr2KiPwXJwhQW5YvLeAFlrajhqDZ87w5KFvZdqgfOvsC8VCibpOLW9E3bs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VBjytoCF; 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="VBjytoCF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3862C433C7; Wed, 28 Feb 2024 08:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709108294; bh=96II5SOv3BLYEbUlQaD+siINq3dolRVDPQN2p/aJkxY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VBjytoCFt7BVQrRm56JMWDkfJhANm+V7LEYbuHVIzI4waogkcw2MIbywfVq64hmQR 85jbTzqvFsXxmW18abqUpeF0tyHNqzXk5dYVfuNuOKPybq9EmiyMju2VVNhkl3nW9X t+JLWNcCwhvBFV9GivE1i9jpApmGE0Lux8R1PTso= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: gregkh@kernel.org Subject: CVE-2021-47013: net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send Date: Wed, 28 Feb 2024 09:15:03 +0100 Message-ID: <2024022831-CVE-2021-47013-034a@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=3180; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=SXf4GSMepNOuhkvnUV4YxhDv5hdo9Fpt/DcnaLog23U=; b=owGbwMvMwCRo6H6F97bub03G02pJDKn3Xqcv8ylOV7v1i+O14/HLU76y/1g3vyLXPGrG+lmnz m1uPt8r2hHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATOarJsODUX9U5LWn+Up+r 3GMdJSsOzbJjfcAwP005JnTWXPmHzLpqzxN2l0ZyK29LAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: gregkh@kernel.org Description =========== In the Linux kernel, the following vulnerability has been resolved: net:emac/emac-mac: Fix a use after free in emac_mac_tx_buf_send In emac_mac_tx_buf_send, it calls emac_tx_fill_tpd(..,skb,..). If some error happens in emac_tx_fill_tpd(), the skb will be freed via dev_kfree_skb(skb) in error branch of emac_tx_fill_tpd(). But the freed skb is still used via skb->len by netdev_sent_queue(,skb->len). As i observed that emac_tx_fill_tpd() haven't modified the value of skb->len, thus my patch assigns skb->len to 'len' before the possible free and use 'len' instead of skb->len later. The Linux kernel CVE team has assigned CVE-2021-47013 to this issue. Affected and fixed versions =========================== Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 4.9.269 with commit c7f75d11fe72 Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 4.14.233 with commit dc1b438a3577 Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 4.19.191 with commit 16d8c44be52e Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 5.4.119 with commit 55fcdd1258fa Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 5.10.37 with commit 9dc373f74097 Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 5.11.21 with commit 8c06f3478506 Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 5.12.4 with commit e407495ba678 Issue introduced in 4.9 with commit b9b17debc69d2 and fixed in 5.13 with commit 6d72e7c767ac 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-47013 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: drivers/net/ethernet/qualcomm/emac/emac-mac.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/c7f75d11fe72913d2619f97b2334b083cd7bb955 https://git.kernel.org/stable/c/dc1b438a35773d030be0ee80d9c635c3e558a322 https://git.kernel.org/stable/c/16d8c44be52e3650917736d45f5904384a9da834 https://git.kernel.org/stable/c/55fcdd1258faaecca74b91b88cc0921f9edd775d https://git.kernel.org/stable/c/9dc373f74097edd0e35f3393d6248eda8d1ba99d https://git.kernel.org/stable/c/8c06f34785068b87e2b560534c77c163d6c6dca7 https://git.kernel.org/stable/c/e407495ba6788a67d1bd41714158c079e340879b https://git.kernel.org/stable/c/6d72e7c767acbbdd44ebc7d89c6690b405b32b57