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 A561A1114 for ; Wed, 21 Aug 2024 06:12:17 +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=1724220737; cv=none; b=agPDNVc7c16KrXDpnnxSqGXUVOA8xNL8hrCEaUDAmPSwX/RZFbykZKFnN2dgq9OurCDYO4jqKcssrAs6q8vXZ7pcq2We+rIoUFEC6Rrdo9xszn3Cd51ZyYqeurPjauOHkBhIVUDpKbMcfel87Wp+0I6E71us+P2A5jNsDwOyiAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724220737; c=relaxed/simple; bh=3qDC/d/iIOcc2PQcV3/0EYrFFdBiyZmjpjKvqBx2BaQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Abc8jTX0I2bvJMSQQ2Ktw58Ix4XxuO2bPQVTxTA0XUj71+6ou4cTSYYOwvYxVuMo2Vk3XaYJGVLE2qrWdgCcBwIcpurJrqwmaBKVpg4D9GsXc6IKkTpRmWahFF4r/9sgSmTWu8O2XYH6kJkGcdmj+d6VXucuxy1bqj6qhxPvU6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=p8PAMEeM; 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="p8PAMEeM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7555C32782; Wed, 21 Aug 2024 06:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724220737; bh=3qDC/d/iIOcc2PQcV3/0EYrFFdBiyZmjpjKvqBx2BaQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=p8PAMEeMoApR/nNR1Ubg0QKabI+EO+ctJW+YgfrCvBFXuqdd9PhXwUgXIGQZj5NNB hW00jabOe7cyp05nZrV8GuSMIVKxkTb5hKT5F0m19BpuRlZUczrw42qT4UGKEIKNX6 7Nz5r3Q0DwEVZ7V0/srgsyPEbSOVETSEttV8zowY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48870: tty: fix possible null-ptr-defer in spk_ttyio_release Date: Wed, 21 Aug 2024 14:11:04 +0800 Message-ID: <2024082105-CVE-2022-48870-3fcb@gregkh> X-Mailer: git-send-email 2.46.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=3136; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3qDC/d/iIOcc2PQcV3/0EYrFFdBiyZmjpjKvqBx2BaQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlHW37u09u06KG759sPhrarSgJ/mEuraIVGPXFqXnLV4 FdJqptORywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzkTy/DgsZdvA/fTJ+suzKl rfx/aG7rCYk7JgwLdqe1mufar1r15/b7Tb9SbidKC/BbAAA= 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: tty: fix possible null-ptr-defer in spk_ttyio_release Run the following tests on the qemu platform: syzkaller:~# modprobe speakup_audptr input: Speakup as /devices/virtual/input/input4 initialized device: /dev/synth, node (MAJOR 10, MINOR 125) speakup 3.1.6: initialized synth name on entry is: (null) synth probe spk_ttyio_initialise_ldisc failed because tty_kopen_exclusive returned failed (errno -16), then remove the module, we will get a null-ptr-defer problem, as follow: syzkaller:~# modprobe -r speakup_audptr releasing synth audptr BUG: kernel NULL pointer dereference, address: 0000000000000080 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP PTI CPU: 2 PID: 204 Comm: modprobe Not tainted 6.1.0-rc6-dirty #1 RIP: 0010:mutex_lock+0x14/0x30 Call Trace: spk_ttyio_release+0x19/0x70 [speakup] synth_release.part.6+0xac/0xc0 [speakup] synth_remove+0x56/0x60 [speakup] __x64_sys_delete_module+0x156/0x250 ? fpregs_assert_state_consistent+0x1d/0x50 do_syscall_64+0x37/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd Modules linked in: speakup_audptr(-) speakup Dumping ftrace buffer: in_synth->dev was not initialized during modprobe, so we add check for in_synth->dev to fix this bug. The Linux kernel CVE team has assigned CVE-2022-48870 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 4f2a81f3a882 and fixed in 5.15.90 with commit 2da67bff29ab Issue introduced in 5.12 with commit 4f2a81f3a882 and fixed in 6.1.8 with commit 64152e05a4de Issue introduced in 5.12 with commit 4f2a81f3a882 and fixed in 6.2 with commit 5abbeebd8296 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-2022-48870 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/accessibility/speakup/spk_ttyio.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/2da67bff29ab49caafb0766e8b8383b735ff796f https://git.kernel.org/stable/c/64152e05a4de3ebf59f1740a0985a6d5fba0c77b https://git.kernel.org/stable/c/5abbeebd8296c2301023b8dc4b5a6c0d5229b4f5