From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 82D6F22A4EE for ; Tue, 6 Oct 2026 08:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791276359; cv=none; b=YIp+WEIGmh190wd1xVeP1FU6EmmGxI/FGOvGAaEiyMsde+uWRkG81XkbWq8H9CLtf4qjSUUmsz38kDih6D8Vc23gtTfcrRsXbdMigjqvt7SC0Yy9PjF7OpIgAtTCizrhLgF9wGg5RTKcEHn9lAWoGNLJnyEjujc/H8/m8qN68io= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791276359; c=relaxed/simple; bh=sFFHEP3hmS1G1kRnJkiJMe0fnd0q9XlhY/2PJ6bORCU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YnqDqMBFzZQOLGaQs0hg8nBe7VrAhc5JdwwAzGPTAXOKvujJolqS14whHOpJ1AvQDXg6Uw9mLQtUrKeVkD+CxM6DHlW/2910qMFq9UmB89+GO1Itr4nDvTKS1ggtaljKdux81C3F6sZwB5pJY5d1EdKkY42QC/F0lJk2XgnIJV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qy0DWlgs; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qy0DWlgs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0D891F000FF; Tue, 6 Oct 2026 08:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791276358; bh=tmSKp4DIkqKcCHAC693k9y3LHLnLVY0CK7ooMCYJ+dY=; h=From:To:Cc:Subject:Date:Reply-To; b=qy0DWlgsAUuGomCUX/F/6yh7GX6uYuLEs+hQI5D/IDg1uk8FeyOMXLvrqrdU95mfn 8yunubvbS5jueqhmeh6CCod2AE66HdBXokwkpj6V+m54Fe2vSw89xXxkltIl46QlDu xVjyS5MmIE4OmAnOaRJKfHQfRHpT1vYhfhB1ps4E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-98166: drm/ttm: fix swapped-out resources never leaving their bulk_move range Date: Tue, 6 Oct 2026 10:44:27 +0200 Message-ID: <2026100629-CVE-2026-98166-db99@gregkh> X-Mailer: git-send-email 2.56.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4008; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=vIXjyNAcLnkO7CX7egBenRZT0ppMQhBbEzHHEQjjE1M=; b=owGbwMvMwCRo6H6F97bub03G02pJDFlHtrz9JNOnlyTH/YvhQvyEI6pT5Y47izEeLOK9OJn56 oOlSz/YdsSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBE5sgxzGbtrTF8LuqWum1u UsHdI/Kldae5zzEsmPlq+2rGTIFEkaPfX2zquqUwjSecCQA= 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: drm/ttm: fix swapped-out resources never leaving their bulk_move range ttm_tt_swapout() returns the number of pages swapped out on success and a negative error code on failure; for a populated ttm it never returns zero. Commit b2ed01e7ad3d ("drm/ttm: Fix ttm_bo_swapout() infinite LRU walk on swapout failure") moved the bulk_move bookkeeping in ttm_bo_swapout_cb() under "if (!ret)", so the ttm_resource_del_bulk_move_unevictable() / ttm_resource_move_to_lru_tail() pair is now skipped on every successful swapout. The equivalent change for the shrinker in commit 1d59f36e95f7 ("drm/ttm: Fix ttm_bo_shrink() infinite LRU walk on backup failure") tests "lret > 0", which is what was intended here as well. Before b2ed01e7ad3d the resource was taken off the bulk_move before the swapout; since then a swapped-out resource stays inside its BO's bulk_move range (and on the manager LRU) although it is unevictable. When it is later freed or the BO leaves the bulk_move (ttm_resource_free(), ttm_bo_set_bulk_move() via amdgpu_vm_bo_del()), ttm_resource_del_bulk_move() skips it because of its !ttm_resource_unevictable() guard, so a range endpoint in pos->first / pos->last is left pointing at freed memory. The next ttm_lru_bulk_move_tail() or ttm_resource_add_bulk_move() on that cursor is a use-after-free, seen as the resv WARN in ttm_lru_bulk_move_add(), "list_del corruption" in ttm_resource_move_to_lru_tail() or a NULL dereference in ttm_resource_manager_next() -- minutes to hours after a hibernation, or at process exit / reboot following one. Samuel Ainsworth's analysis of drm/amd issue 5387 (see Link) identified the dangling cursor; the missing removal at swapout time is the reason it dangles. Testing the condition for success restores the removal. On an AMD Phoenix APU (ASUS UM3406GA, gfx1103) running suspend-then-hibernate on a 7.0.y stable kernel carrying the backport (Ubuntu 7.0.0-31) the bug crashed 5 of 18 hibernation cycles; a function profile of one hibernation showed 336 ttm_tt_swapout() calls and zero ttm_resource_del_bulk_move_unevictable() calls. With this change the removal happens for every swapped-out resource and 12 further cycles were clean. The Linux kernel CVE team has assigned CVE-2026-98166 to this issue. Affected and fixed versions =========================== Issue introduced in 7.1 with commit b2ed01e7ad3de80333e9b962a44024b094bc0b2b and fixed in 7.2.8 with commit 1169fe8c11ca45e3f91d59a73eb271d0ca8a7fb0 Issue introduced in 7.1 with commit b2ed01e7ad3de80333e9b962a44024b094bc0b2b and fixed in 7.3-rc4 with commit 3db7d7d583419f7b1f2e141e36418802dbb25cf8 Issue introduced in 7.0.10 with commit 0124a09e3e5f5f6080efe9663b27af27933f8382 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-98166 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/gpu/drm/ttm/ttm_bo.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/1169fe8c11ca45e3f91d59a73eb271d0ca8a7fb0 https://git.kernel.org/stable/c/3db7d7d583419f7b1f2e141e36418802dbb25cf8