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 ADA9C18952C for ; Fri, 27 Dec 2024 14:24:36 +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=1735309476; cv=none; b=KPv+Wvmbvap3HpBtGsvOQENPBmd0pkl01m/qbCc5InqaKjjOnjqKRqPpKbM3mTAIlqlZy+4tE5ofBiAimfU77OT4doGVluF6W/McEN8YJsNV7Asgv3JDS8EfYmu/54vau8TUz/RF4zOycyDUk1JVddt3EXvTGp1QVSGVEk8TcM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735309476; c=relaxed/simple; bh=IGTUnN4gIIelX4yz68lqr0qa3U4Xy17V6dsBA6ByPJs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gYYJxtHjaXizCofHDpzf9+koUoFj3gu+jX1LjaEzUXC7Sp4wjKTCkKtUGsFG05tDu8VhlqN+mfE9Jne7g8GQ27l+Se3WVBZico+TY8qgCxS6tNAV9phHwdcS0d8/JGQavGHE37jBSEtmapiYP8pxI+2lkiHPMu1IBJfXh37YZvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UcaXd7ck; 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="UcaXd7ck" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB968C4CED0; Fri, 27 Dec 2024 14:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735309476; bh=IGTUnN4gIIelX4yz68lqr0qa3U4Xy17V6dsBA6ByPJs=; h=From:To:Cc:Subject:Date:Reply-to:From; b=UcaXd7ckE4/4V/F94SLZvwz7Ma0Mgus+OOkJZHxX8GepAwxzpEyXCkZE/am7P2O8+ pQTTiyjcOSTxT1ngp7eUBsRQdhhgO3WAdf8Wf03aIuirtUlWfQmpjwnxkdQrKcwHOs S0g1j0xHgHFcIBb6KHwa1RxZJQ0su3DTsNClujTk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56577: media: mtk-jpeg: Fix null-ptr-deref during unload module Date: Fri, 27 Dec 2024 15:23:28 +0100 Message-ID: <2024122718-CVE-2024-56577-42c4@gregkh> X-Mailer: git-send-email 2.47.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=4045; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=IGTUnN4gIIelX4yz68lqr0qa3U4Xy17V6dsBA6ByPJs=; b=kA0DAAIRMUfUDdst+ykByyZiAGduuFeillkIlfOk7+Uas5JGYWbr7B/wgsEu8Q9Mb3Riz8zmW ohdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmduuFcACgkQMUfUDdst+ynmAQCglqx7 V7U73gmw8e7L+YMpC/xlcDMAnRQw58xu2fdBgjs6WIdkYR/h7jm5 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: mtk-jpeg: Fix null-ptr-deref during unload module The workqueue should be destroyed in mtk_jpeg_core.c since commit 09aea13ecf6f ("media: mtk-jpeg: refactor some variables"), otherwise the below calltrace can be easily triggered. [ 677.862514] Unable to handle kernel paging request at virtual address dfff800000000023 [ 677.863633] KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f] ... [ 677.879654] CPU: 6 PID: 1071 Comm: modprobe Tainted: G O 6.8.12-mtk+gfa1a78e5d24b+ #17 ... [ 677.882838] pc : destroy_workqueue+0x3c/0x770 [ 677.883413] lr : mtk_jpegdec_destroy_workqueue+0x70/0x88 [mtk_jpeg_dec_hw] [ 677.884314] sp : ffff80008ad974f0 [ 677.884744] x29: ffff80008ad974f0 x28: ffff0000d7115580 x27: ffff0000dd691070 [ 677.885669] x26: ffff0000dd691408 x25: ffff8000844af3e0 x24: ffff80008ad97690 [ 677.886592] x23: ffff0000e051d400 x22: ffff0000dd691010 x21: dfff800000000000 [ 677.887515] x20: 0000000000000000 x19: 0000000000000000 x18: ffff800085397ac0 [ 677.888438] x17: 0000000000000000 x16: ffff8000801b87c8 x15: 1ffff000115b2e10 [ 677.889361] x14: 00000000f1f1f1f1 x13: 0000000000000000 x12: ffff7000115b2e4d [ 677.890285] x11: 1ffff000115b2e4c x10: ffff7000115b2e4c x9 : ffff80000aa43e90 [ 677.891208] x8 : 00008fffeea4d1b4 x7 : ffff80008ad97267 x6 : 0000000000000001 [ 677.892131] x5 : ffff80008ad97260 x4 : ffff7000115b2e4d x3 : 0000000000000000 [ 677.893054] x2 : 0000000000000023 x1 : dfff800000000000 x0 : 0000000000000118 [ 677.893977] Call trace: [ 677.894297] destroy_workqueue+0x3c/0x770 [ 677.894826] mtk_jpegdec_destroy_workqueue+0x70/0x88 [mtk_jpeg_dec_hw] [ 677.895677] devm_action_release+0x50/0x90 [ 677.896211] release_nodes+0xe8/0x170 [ 677.896688] devres_release_all+0xf8/0x178 [ 677.897219] device_unbind_cleanup+0x24/0x170 [ 677.897785] device_release_driver_internal+0x35c/0x480 [ 677.898461] device_release_driver+0x20/0x38 ... [ 677.912665] ---[ end trace 0000000000000000 ]--- The Linux kernel CVE team has assigned CVE-2024-56577 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 09aea13ecf6f89ed7f18114953695563f64f461c and fixed in 6.6.64 with commit 0ba08c21c6a92e6512e73644555120427c9a49d4 Issue introduced in 6.4 with commit 09aea13ecf6f89ed7f18114953695563f64f461c and fixed in 6.12.4 with commit bc3889a39baf783c64c6d628bbb74d76ce164bb1 Issue introduced in 6.4 with commit 09aea13ecf6f89ed7f18114953695563f64f461c and fixed in 6.13-rc1 with commit 17af2b39daf12870cac61ffc360e62bc35798afb 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-56577 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/mediatek/jpeg/mtk_jpeg_core.c drivers/media/platform/mediatek/jpeg/mtk_jpeg_dec_hw.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/0ba08c21c6a92e6512e73644555120427c9a49d4 https://git.kernel.org/stable/c/bc3889a39baf783c64c6d628bbb74d76ce164bb1 https://git.kernel.org/stable/c/17af2b39daf12870cac61ffc360e62bc35798afb