Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793187740; b=X6gO6OBqekJNQ7PusgEc46MOQYmr3CtdgDIv/UUz8MxUIBk+pdytcFzC197LOqUxavOY mU1Jg3dtQxci+kVvDOA2qjW68OUCLsRPhK0MEiR4HqrEyBKccQiXKvoT3eoKb+l8Nz5Zw k71hcILsyM9fxf0liCruzwABNoqj0LNvjapK43vSHsQ5d9C0TWRUBsf1TljegwBb9sEPw wGpGlBxUcV8+Vtban2E9UF8L9Y3vSxrgcQWYnc9eT+m/k510A0A8ik63PcQbVrZNPSieS zD5A+BskMwb/z9HrN0CIB7MLTgAdPMlCTnVea5c87BbOyxTHw7zENFCPn7xQV/Em5lg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793187740; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: Reply-To:MIME-Version:Lines:X-Developer-Signature:X-Developer-Key: Content-Type:Content-Transfer-Encoding; bh=JaX5H+f7wMs/9rd1mBqEkSo0KfaYWyzk/Pw6eA7/Fms=; b=4lsr062llYfU5b9tj78gRcwFE9/vUiIAX+CnNaAL2vwKX5G3VNrUn74n0E/Q07SOgyxs VlOE/hIItLHG+K60VeJx4flAwRSPElPcgY8x2s1phOlG9KL2gfWqnN5xufQkkjjEbxUAe 7AWGJFj8TpsMnZYB4HvbKWOeQGVrWxwgdBhxqTYUXQx1vIU0ZmZ7Imi520jDZfWCvk7Np lqjImd5AAqO7l9F7lNZKSNQ3FUHMks+U4rGSkcPNmOCbd9KPO+b9AFUQBXJncH0qOYgMf 7RrGN9LS+uNa+HUuS0bJSfHO0RZK84DXQXmUhgTXP7/C9ZCNrpMzlnHQm6vW2UCYu+Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=GXMORnMS; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80305606A31D for ; Wed, 28 Oct 2026 11:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=GXMORnMS Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB0B91F01828; Wed, 28 Oct 2026 11:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793187740; bh=JaX5H+f7wMs/9rd1mBqEkSo0KfaYWyzk/Pw6eA7/Fms=; h=From:To:Cc:Subject:Date:Reply-To; b=GXMORnMSi5aGz6jQInoTPa4SH2Co+0h3MEKkbitZ1TfhimqQYlBSVRl+P7y8s8mCf 4iUw+8G847MC12vZKxDjEZ4xJCt68w+vUb4KxIypDEBws6DCZ6/onwoboTemv+sR0K cHus/+l0InNzSEUs/Rut2wfU1CyKe2ZLj2s6NTMs= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-99164: spi: imx: fix slab corruption from undersized DMA bounce buffers Date: Wed, 28 Oct 2026 11:35:51 +0100 Message-ID: <2026102806-CVE-2026-99164-148e@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3377; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=T0FVKIExLL6X18hiF2txcsaCMG+PGR2d2u257xZSEeA=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkPz996sTH6V0Zf8q0reyvU+f+pyxk2SuybukjU7uXyS +VPNfebdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBENBgZFnSevqD7qn7P1r35 HqZTjZ2fOT44K88wvyy/JnPbfNHtAoxxeocZ2eyPJXP5AAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: spi: imx: fix slab corruption from undersized DMA bounce buffers Since commit faa8e404ad8e ("spi: imx: support dynamic burst length for ECSPI DMA mode"), the driver allocates its private DMA TX/RX buffers with kzalloc(dma_len), where dma_len is only rounded up to 4 bytes, but maps, syncs and unmaps them with DMA_CACHE_ALIGNED_LEN(dma_len), i.e. rounded up to the cache line size. As a result, the DMA API operates on memory beyond the end of the allocation. This was observed on a custom i.MX8MP platform with an mcp251xfd CAN controller under heavy RPMSG load, as a series of refcount_t warnings triggered from rpmsg_recv_done() in virtio_rpmsg_bus: refcount_t: addition on 0; use-after-free. refcount_t: underflow; use-after-free. refcount_t: saturated; leaking memory. Leading finally to an "Unable to handle kernel paging request" oops. Reproducing this problem took between 30 minutes and roughly 30 hours under the same workload. Hardware watchpoints on the refcount of a struct rpmsg_endpoint showed it was overwritten from 2 to 1 by __pi_memcpy_generic() in the irq/155-spi2.0 thread. Additionally it was found that a "normal" rpmsg_recv_done() took 11µs +/-2µs from its kref_get to kref_put. In the error case the same sequence took about 215µs +/-10µs. Based on this, an LLM was used to identify the size mismatch fixed here. Allocate the buffers with DMA_CACHE_ALIGNED_LEN(dma_len) so they cover the full mapped length, and use the same length for dma_sync_single_for_cpu() to stay consistent with map and unmap. With this patch applied, the same workload ran for more than 200 hours without the problem reproducing. The Linux kernel CVE team has assigned CVE-2026-99164 to this issue. Affected and fixed versions =========================== Issue introduced in 7.0 with commit faa8e404ad8e686cb98c51dc507fdcacfb8020ce and fixed in 7.2.13 with commit 2777f6637da02da84c9c1ff92f413ce0f0995084 Issue introduced in 7.0 with commit faa8e404ad8e686cb98c51dc507fdcacfb8020ce and fixed in 7.3 with commit 59eb22641f0c526dd064390b11cff99ae87c2858 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-2026-99164 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/spi/spi-imx.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/2777f6637da02da84c9c1ff92f413ce0f0995084 https://git.kernel.org/stable/c/59eb22641f0c526dd064390b11cff99ae87c2858