PT-2026-121977
CVE-2026-99000
·
Publicado
2026-10-23
·
Atualizado
2026-10-23
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
In the Linux kernel, the following vulnerability has been resolved:
drm/xe: Fix shrinker accounting double-subtraction on nested external pins
xe bo pin external() and xe bo unpin external() support nested pins,
since the underlying ttm bo pin()/ttm bo unpin() maintain a pin count
refcount rather than a boolean. However, the shrinker accounting calls
xe ttm tt account subtract() and xe ttm tt account add() are invoked
unconditionally on every pin external()/unpin external() call, instead
of only on the transition into and out of the pinned state.
An external BO (dma-buf) can be pinned more than once while already
pinned, for example when it has multiple attachments/importers, each
independently calling xe bo pin external(). Each such nested pin
subtracts the BO's pages from the shrinker's accounting again, even
though the BO's pages were already removed from consideration by the
first pin. Symmetrically, each nested unpin adds them back again
before the BO is actually unpinned. This desynchronizes the
shrinker's page and object counts from reality, and since they are
declared as signed long but interpreted as unsigned long in
xe shrinker count(), the underflow can turn into an enormous
shrinkable/purgeable page count, causing the shrinker to be invoked
excessively under memory pressure.
Guard the accounting calls with the same pin-count transition checks
already used to guard the pinned link list maintenance, so accounting
is only updated on the outermost pin and the final unpin.
While centralizing this logic into xe bo account pin()/
xe bo account unpin(), also close a second, related accounting gap
affecting imported dma-bufs. For an imported bo's ttm tt, xe's
ttm tt populate hook (xe ttm tt populate()) early-returns without
calling xe ttm tt account add(), since TTM TT FLAG EXTERNAL is set
without TTM TT FLAG EXTERNAL MAPPABLE. However, TTM core's
ttm tt populate() wrapper unconditionally marks the tt as populated
on driver-hook success, so ttm tt is populated() still reports true
for it. xe bo account pin()/xe bo account unpin() trusted
ttm tt is populated() as a proxy for "these pages are accounted for
by the shrinker", and would subtract/add pages for such a tt that
were never added in the first place, again underflowing the
shrinker's counts. This is reachable today via xe bo pin external(),
and would have become newly reachable via the fb-pin path once this
patch routes xe pin fb vma() through xe bo pin account() below, so
fix it here rather than in a later patch, to avoid a commit in this
series that introduces the regression before fixing it. Skip the
accounting for imported bos, using the same EXTERNAL &&
!EXTERNAL MAPPABLE test xe ttm tt populate()/xe ttm tt unpopulate()
use to decide whether to act, via a new xe ttm bo is imported()
helper (hoisted up from its only prior use site).
v2:
- Fix the critical issue caught by Sashiko AI review: the pin-count transition check introduced here was still bypassed by the fb-pin path ( xe pin fb vma()/ xe unpin fb vma()), which could leave a stale pinned link entry and a permanent shrinker accounting leak when the fb-unpin performed the true last unpin. Addressed in a separate follow-up patch in this series rather than folded in here, since it is a distinct bug with its own Fixes: tag.
- Drop the unneeded local "last unpin" variable in xe bo unpin external(), restoring the original inline bo->ttm.pin count == 1 check; it was a no-op rename not used by any of the new accounting helpers, and was going to be deleted again by the follow-up patch anyway.
v3:
- Exclude imported dma-bufs from the pin/unpin shrinker accounting, fixing another underflow caught by Sashiko AI review.
- Add a short comment on the backup-object pin site noting it's already populated/accounted at pin time, addressing (as a false-positive clarification, no code fix needed) a separate Medium-severity accounting-leak concern also caught by Sashiko AI
---truncated---
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾