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 EC0F442AA5 for ; Thu, 18 Sep 2025 13:34:11 +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=1758202452; cv=none; b=hOzdqfWWrj/4EW4ymNnQJgjcNotGJA9Q+rPzoCxMAiqYI4zaBGR2/htxkGUgJOv88KO+uWCBrn06zaazuGer0deGEU4MsGcibQ5Gln9qmugj5mla1SvlJL/YXYfgGFhz3O852GgO48rR6l6ngPksMNIWb62xYaQKxmDiUD3wk18= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758202452; c=relaxed/simple; bh=66Y7hBhPZzZ5ZnkBwJf1bDFMfv2uZ/VV+rL1n7sEdXo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=d+jaSYJfbXYoTR0AhGR0TR2d9riHefdnAgKEyUFHurdIsF8ZLNv9F0oss6Tir6xcuwNerivuJHahxHbaollovZptEa1T4YVx6tPBHeiSKUWhYXBD4VZaHyu8Gem7kPldnqMNRuskO/AqCQkoDypLVHF2SWvycpJN+xli3KXP8CI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Hdtz99qM; 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="Hdtz99qM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7669C4CEE7; Thu, 18 Sep 2025 13:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758202451; bh=66Y7hBhPZzZ5ZnkBwJf1bDFMfv2uZ/VV+rL1n7sEdXo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Hdtz99qMhg5GzV4sIR9GTrxqLPVUyOdrroYcgU10A8EePC0It2y/9bkxeKrL46fC5 ujzD89Jw7IARZku39MTWTkiAgmee/gY9H3vbal59ZKsqmE2JpLV9mSbyguWW3NwljU JA4Bn4zKAEoh3QrY4yjaOFjWzX1YdNv+LDAKBCKw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50375: tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown Date: Thu, 18 Sep 2025 15:33:49 +0200 Message-ID: <2025091848-CVE-2022-50375-2409@gregkh> X-Mailer: git-send-email 2.51.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=5804; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ihwVjDQzdP2CPQiIliwCC4YmMUmTg15eYCxidfGAWbY=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlnuGxMXotrbrx6iWX39aDztdHyrDEuf3k+cFms//O2f a6rnNDTjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI2gWGeRrKQtvlbubXNn4I +XZr2ul3f0NdcxnmJ9t8n8Gk6hUvGGBinyu4ovjB3b97AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: tty: serial: fsl_lpuart: disable dma rx/tx use flags in lpuart_dma_shutdown lpuart_dma_shutdown tears down lpuart dma, but lpuart_flush_buffer can still occur which in turn tries to access dma apis if lpuart_dma_tx_use flag is true. At this point since dma is torn down, these dma apis can abort. Set lpuart_dma_tx_use and the corresponding rx flag lpuart_dma_rx_use to false in lpuart_dma_shutdown so that dmas are not accessed after they are relinquished. Otherwise, when try to kill btattach, kernel may panic. This patch may fix this issue. root@imx8ulpevk:~# btattach -B /dev/ttyLP2 -S 115200 ^C[ 90.182296] Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP [ 90.189806] Modules linked in: moal(O) mlan(O) [ 90.194258] CPU: 0 PID: 503 Comm: btattach Tainted: G O 5.15.32-06136-g34eecdf2f9e4 #37 [ 90.203554] Hardware name: NXP i.MX8ULP 9X9 EVK (DT) [ 90.208513] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 90.215470] pc : fsl_edma3_disable_request+0x8/0x60 [ 90.220358] lr : fsl_edma3_terminate_all+0x34/0x20c [ 90.225237] sp : ffff800013f0bac0 [ 90.228548] x29: ffff800013f0bac0 x28: 0000000000000001 x27: ffff000008404800 [ 90.235681] x26: ffff000008404960 x25: ffff000008404a08 x24: ffff000008404a00 [ 90.242813] x23: ffff000008404a60 x22: 0000000000000002 x21: 0000000000000000 [ 90.249946] x20: ffff800013f0baf8 x19: ffff00000559c800 x18: 0000000000000000 [ 90.257078] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 90.264211] x14: 0000000000000003 x13: 0000000000000000 x12: 0000000000000040 [ 90.271344] x11: ffff00000600c248 x10: ffff800013f0bb10 x9 : ffff000057bcb090 [ 90.278477] x8 : fffffc0000241a08 x7 : ffff00000534ee00 x6 : ffff000008404804 [ 90.285609] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff0000055b3480 [ 90.292742] x2 : ffff8000135c0000 x1 : ffff00000534ee00 x0 : ffff00000559c800 [ 90.299876] Call trace: [ 90.302321] fsl_edma3_disable_request+0x8/0x60 [ 90.306851] lpuart_flush_buffer+0x40/0x160 [ 90.311037] uart_flush_buffer+0x88/0x120 [ 90.315050] tty_driver_flush_buffer+0x20/0x30 [ 90.319496] hci_uart_flush+0x44/0x90 [ 90.323162] +0x34/0x12c [ 90.327253] tty_ldisc_close+0x38/0x70 [ 90.331005] tty_ldisc_release+0xa8/0x190 [ 90.335018] tty_release_struct+0x24/0x8c [ 90.339022] tty_release+0x3ec/0x4c0 [ 90.342593] __fput+0x70/0x234 [ 90.345652] ____fput+0x14/0x20 [ 90.348790] task_work_run+0x84/0x17c [ 90.352455] do_exit+0x310/0x96c [ 90.355688] do_group_exit+0x3c/0xa0 [ 90.359259] __arm64_sys_exit_group+0x1c/0x20 [ 90.363609] invoke_syscall+0x48/0x114 [ 90.367362] el0_svc_common.constprop.0+0xd4/0xfc [ 90.372068] do_el0_svc+0x2c/0x94 [ 90.375379] el0_svc+0x28/0x80 [ 90.378438] el0t_64_sync_handler+0xa8/0x130 [ 90.382711] el0t_64_sync+0x1a0/0x1a4 [ 90.386376] Code: 17ffffda d503201f d503233f f9409802 (b9400041) [ 90.392467] ---[ end trace 2f60524b4a43f1f6 ]--- [ 90.397073] note: btattach[503] exited with preempt_count 1 [ 90.402636] Fixing recursive fault but reboot is needed! The Linux kernel CVE team has assigned CVE-2022-50375 to this issue. Affected and fixed versions =========================== Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 5.4.220 with commit 29b897ac7b990882c74bd08605692214e7e58b83 Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 5.10.150 with commit 9a56ade124d4891a31ab1300c57665f07f5b24d5 Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 5.15.75 with commit c4293def8860fd587a84400ccba5b49cec56e2c3 Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 5.19.17 with commit d554c14eb73ee91d76fc9aece4616f0b687c295d Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 6.0.3 with commit 3953e7f261e2f4d9c35f0c025df9f166f46aa626 Issue introduced in 4.9 with commit 6250cc30c4c4e25393ba247f71bdc04b6af3191b and fixed in 6.1 with commit 316ae95c175a7d770d1bfe4c011192712f57aa4a 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-50375 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/tty/serial/fsl_lpuart.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/29b897ac7b990882c74bd08605692214e7e58b83 https://git.kernel.org/stable/c/9a56ade124d4891a31ab1300c57665f07f5b24d5 https://git.kernel.org/stable/c/c4293def8860fd587a84400ccba5b49cec56e2c3 https://git.kernel.org/stable/c/d554c14eb73ee91d76fc9aece4616f0b687c295d https://git.kernel.org/stable/c/3953e7f261e2f4d9c35f0c025df9f166f46aa626 https://git.kernel.org/stable/c/316ae95c175a7d770d1bfe4c011192712f57aa4a