Back-end ARM64 MMU выделяет идентификаторы адресного пространства (ASIDs) для доменов памяти с голым счетчиком округления в arch_mem_domain_init() (arch/arm64/core/mmu.c). VM_ASID_BITS — это 8, поэтому существует только 255 ASIDs; как только счетчик обернут, arch_mem_domain_init () может передать ASID в новый домен, в то время как еще живой домен содержит тот же самый. Domain-private отображения установлены неглобально (MT_NG), поэтому ASID является единственным тегом, отделяющим кэшированные переводы одного домена от других в TLB. Путь переключения контекста в z_arm64_swap_ptables() смывает TLB только тогда, когда исходящие и входящие домены несут тот же ASID, который не покрывает дубликат, достигнутый через третий домен: для доменов A и C, разделяющих ASID и не связанный домен B, расписание A -> B -> C никогда не принимает ветку флеша, поэтому записи с тегами ASID В SMP два живых домена, разделяющих ASID, могут быть резидентами сразу двух CPUs, что архитектура не допускает различных наборов таблиц перевода.
Для запуска обмотки требуется приложение CONFIG_USERSPACE на ARM64, которое создает более 255 доменов памяти в течение своего срока службы; k_mem_domain_init() и k_mem_domain_deinit() являются супервизором только APIs и не отображаются как syscalls, поэтому непривилегированный поток не может управлять счетчиком напрямую. Однако, как только два живых домена псевдонима, поток пользовательского режима в одном домене может читать и записывать память, принадлежащую разделам и стекам потоков другого домена, с разрешениями этого домена, побеждая границу изоляции памяти домена. Исправление сканирует живой domain_list перед назначением ASID, продвигает счетчик кругового обзора за ASIDs, уже используемый, и возвращает -ENOMEM, когда все взяты, поэтому создание домена не закрывается вместо молчаливого псевдонима.
Показать оригинальное описание (EN)
The ARM64 MMU back-end allocated address space identifiers (ASIDs) for memory domains with a bare round-robin counter in arch_mem_domain_init() (arch/arm64/core/mmu.c). VM_ASID_BITS is 8, so only 255 ASIDs exist; once the counter wrapped, arch_mem_domain_init() could hand an ASID to a new domain while a still-live domain held the same one. Domain-private mappings are installed non-global (MT_NG), so the ASID is the only tag separating one domain's cached translations from another's in the TLB. The context-switch path in z_arm64_swap_ptables() only flushes the TLB when the outgoing and incoming domains carry the same ASID, which does not cover a duplicate reached through a third domain: for domains A and C sharing an ASID and an unrelated domain B, the schedule A -> B -> C never takes the flush branch, so the ASID-tagged entries A populated remain resident while C runs. Under SMP two live domains sharing an ASID can additionally be resident on two CPUs at once, which the architecture does not allow for distinct translation-table sets. Triggering the wrap requires a CONFIG_USERSPACE application on ARM64 that creates more than 255 memory domains over its lifetime; k_mem_domain_init() and k_mem_domain_deinit() are supervisor-only APIs and are not exposed as syscalls, so an unprivileged thread cannot drive the counter directly. Once two live domains alias, however, a user-mode thread in one domain can read and write memory belonging to the other domain's partitions and thread stacks with that domain's permissions, defeating the memory-domain isolation boundary. The fix scans the live domain_list before assigning an ASID, advances the round-robin counter past ASIDs already in use, and returns -ENOMEM when all are taken, so domain creation fails closed instead of silently aliasing.
Характеристики атаки
Последствия
Строка CVSS v3.1