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 218141F819A for ; Mon, 21 Oct 2024 18:07:49 +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=1729534070; cv=none; b=uAWQ9IlpV1x4XltRQA3d3vWPY0lcY3rW3XFcaCvXYztCEtkugS7qg3iEJuhooUflT8WIe1QT7aTX8dPOHJju5XHN3AvdUmcz1szKmCyD/Q7z+tjTfyRTcgJANvmf9jSi54+Nee5Y3+gCrixrzVyx5mwSGi/em/yBelMCHtXVzI8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729534070; c=relaxed/simple; bh=2HNfEotNqdJHBH3mAodXl4O8+b3oon6jR4qRQrhp7EY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=H3raMuuBTlBAG8KGsjzxIl7L6ntPLiSq2ufwPvBSvsCjQYiVmyrc4k4++Kw90ebWdDOUgqr32MNbYnwl8rok3xpH/7nCYufBRfoEG8iN/yHBBGWhpTHMssbuDirRccfqKefMviDSNzwk6A8EdnxC+MtMZBBo9oW5yEAk0k+Da7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Lx/U6vuI; 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="Lx/U6vuI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B847C4CEE7; Mon, 21 Oct 2024 18:07:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729534069; bh=2HNfEotNqdJHBH3mAodXl4O8+b3oon6jR4qRQrhp7EY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Lx/U6vuIbD0zS4GD3Sd1I1WD2vcrLMNvK1bvvzMu1Slx0hBhHQVL5y8kNcm7qCyXJ hluU1BqlKljCX5GRx5x3Tk72iYQS27DGkMbgHTIBtTvrXsfyQS0RIlvlLAxMYzwBQL YCFdCYiHboVBgyuGrnw5Q09JTSXpN6D6Mqv4k8jA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-49981: media: venus: fix use after free bug in venus_remove due to race condition Date: Mon, 21 Oct 2024 20:03:09 +0200 Message-ID: <2024102135-CVE-2024-49981-0fb7@gregkh> X-Mailer: git-send-email 2.47.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=3167; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2HNfEotNqdJHBH3mAodXl4O8+b3oon6jR4qRQrhp7EY=; b=owGbwMvMwCRo6H6F97bub03G02pJDOli0/5PuDZ5u/3U0A9GTOJ2R0JnTb7wVuIiX1HEzru83 l3+f1rbOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi1VIM87O+TC9bzrPgxgkl Rkctgxms7I7FaQwLrimt9Q9YYvv2X7fyRDUP5ZgEoT/1AA== 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: media: venus: fix use after free bug in venus_remove due to race condition in venus_probe, core->work is bound with venus_sys_error_handler, which is used to handle error. The code use core->sys_err_done to make sync work. The core->work is started in venus_event_notify. If we call venus_remove, there might be an unfished work. The possible sequence is as follows: CPU0 CPU1 |venus_sys_error_handler venus_remove | hfi_destroy | venus_hfi_destroy | kfree(hdev); | |hfi_reinit |venus_hfi_queues_reinit |//use hdev Fix it by canceling the work in venus_remove. The Linux kernel CVE team has assigned CVE-2024-49981 to this issue. Affected and fixed versions =========================== Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 5.10.227 with commit 60b6968341a6 Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 5.15.168 with commit bf6be32e2d39 Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 6.1.113 with commit 2a541fcc0bd2 Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 6.6.55 with commit b0686aedc5f1 Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 6.10.14 with commit d925e9f7fb5a Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 6.11.3 with commit 10941d4f99a5 Issue introduced in 4.13 with commit af2c3834c8ca and fixed in 6.12-rc1 with commit c5a85ed88e04 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-2024-49981 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/media/platform/qcom/venus/core.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/60b6968341a6dd5353554f3e72db554693a128a5 https://git.kernel.org/stable/c/bf6be32e2d39f6301ff1831e249d32a8744ab28a https://git.kernel.org/stable/c/2a541fcc0bd2b05a458e9613376df1289ec11621 https://git.kernel.org/stable/c/b0686aedc5f1343442d044bd64eeac7e7a391f4e https://git.kernel.org/stable/c/d925e9f7fb5a2dbefd1a73fc01061f38c7becd4c https://git.kernel.org/stable/c/10941d4f99a5a34999121b314afcd9c0a1c14f15 https://git.kernel.org/stable/c/c5a85ed88e043474161bbfe54002c89c1cb50ee2