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 557D112CDA8 for ; Fri, 24 May 2024 15:09:57 +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=1716563397; cv=none; b=jOdbWbj6X5KNZhGH3vRk5Qm6vxpNPkYfV/1MGVSpFfhYWZIt/SeOlgBkNbUjzUX01rHC4xDKrYsZ7cC1eNjs1ZjO17/CTIMYoqSxe3n7jlwlOs+YqhNFJCQqcwq2IJA8F5Q0UucB1k49tKgCfmu86Fsb/zMvi/NQ93GuqKNaOcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716563397; c=relaxed/simple; bh=Ckx4Va8NUW3FTFFhcbdXQZ1Bv/xZrhtm5AQnOpjlirk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ngyzPnsemCMB/g8cgflodryu9+golX3j0n4miAMu+IpdQ4f3h+ewMqcM1b7PcVdNSHv3B/lcQb8u6gw/JVyRcxb5pNZwLrbMW1Pq2E4WzGMerss2qnbmWASvF1G/yRhE2ng03bN4g/X96LYkoShuRHU8nDQ4/uOk4eAGENMiKZA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jolp1LFS; 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="jolp1LFS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85A42C2BBFC; Fri, 24 May 2024 15:09:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716563396; bh=Ckx4Va8NUW3FTFFhcbdXQZ1Bv/xZrhtm5AQnOpjlirk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jolp1LFSbfD0twGur0WaQJb5P2lV0RwuGdqaZpDHRapfoYwsenK1eJ9OlkCAcHdPz 0XDg70IdFCMbLC13MMN8plzIobglXMrA1Oh++YBKD/zMw07mQhZZid2n4yOuHxEVo/ NcHz6WW2OvaPLMhOkcqUpH04vbE65UzZDpRM+ALo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47519: can: m_can: m_can_read_fifo: fix memory leak in error branch Date: Fri, 24 May 2024 17:09:39 +0200 Message-ID: <2024052432-CVE-2021-47519-ed69@gregkh> X-Mailer: git-send-email 2.45.1 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=2092; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Ckx4Va8NUW3FTFFhcbdXQZ1Bv/xZrhtm5AQnOpjlirk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkBa9ec41uqcm12+b1H+q/VJwc7+rt7zrUvSNkxef6+b OvkRWbXOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAikyUY5infnHZ04zKjN9M5 3OuZjnbmWc15f5BhfpDrFpcjKU8VdnR/+9O4cVnCkuhrFQA= 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: can: m_can: m_can_read_fifo: fix memory leak in error branch In m_can_read_fifo(), if the second call to m_can_fifo_read() fails, the function jump to the out_fail label and returns without calling m_can_receive_skb(). This means that the skb previously allocated by alloc_can_skb() is not freed. In other terms, this is a memory leak. This patch adds a goto label to destroy the skb if an error occurs. Issue was found with GCC -fanalyzer, please follow the link below for details. The Linux kernel CVE team has assigned CVE-2021-47519 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit e39381770ec9 and fixed in 5.15.8 with commit 75a422165477 Issue introduced in 5.15 with commit e39381770ec9 and fixed in 5.16 with commit 31cb32a590d6 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-2021-47519 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/can/m_can/m_can.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/75a422165477dd12d2d20aa7c9ee7c9a281c9908 https://git.kernel.org/stable/c/31cb32a590d62b18f69a9a6d433f4e69c74fdd56