В ядре Linux устранена следующая уязвимость:
futex: избегать использования частного хэша после освобождения при окончательном размещении
futex_private_hash_put() удаляет ссылку на fph перед оценкой
fph->mm для Wake_up_var(). futex_ref_put() снова включает приоритет перед
возвращаясь. Если этот метод put отбрасывает последнюю ссылку и задача вытесняется,
другая задача может перейти к заменяющему хэшу и освободить старый хеш после
льготный период RCU. Затем первая задача считывает fph->mm из освобожденного
распределение, когда оно возобновится.
KASAN сообщает о slab-use-after-free в futex_private_hash_put() с
прочитайте по смещению 24 в освобожденном выделении kmalloc-512.
Распределение и
свободные стеки указывают на futex_hash_allocate() и свободный путь RCU,
соответственно. Загрузите указатель мм, пока удерживается ссылка fph, и передайте
сохраненное значение в Wake_up_var(). Wake_up_var() использует указатель как очередь ожидания
ключ и не разыменовывает мм через него.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: futex: Avoid private hash use-after-free on final put futex_private_hash_put() drops the reference to fph before evaluating fph->mm for wake_up_var(). futex_ref_put() enables preemption again before returning. If that put drops the final reference and the task is preempted, another task can pivot to the replacement hash and free the old hash after an RCU grace period. The first task then reads fph->mm from the freed allocation when it resumes. KASAN reports a slab-use-after-free in futex_private_hash_put(), with the read at offset 24 in a freed kmalloc-512 allocation. The allocation and free stacks point to futex_hash_allocate() and the RCU free path, respectively. Load the mm pointer while the fph reference is still held and pass the saved value to wake_up_var(). wake_up_var() uses the pointer as a waitqueue key and does not dereference the mm through it.