В ядре Linux устранена следующая уязвимость:
ipv6: запретить in6_dev_get() воскрешать inet6_dev
in6_dev_get() читает dev->ip6_ptr под RCU, а затем безоговорочно
увеличивает свой счетчик ссылок. Разрушение устройства может очистить указатель и удалить его.
последняя ссылка между этими операциями. Тогда приращение
воскрешает объект, чей RCU free уже поставлен в очередь, поэтому вызывающие
можно использовать его после того, как он будет освобожден.
Используйте refcount_inc_not_zero() и возвращайте NULL, когда объект уже
достиг нуля. RCU сохраняет доступ к памяти при попытке
получение эталона, и успешное приращение закрепляет объект для
звонивший. Самостоятельный запуск на точной непропатченной 6f5156d7a31a (v7.2-rc3)
ядро воспроизвело недопустимое получение ссылки как UID 1000:
refcount_t: добавление по 0; использовать после бесплатно.
ip6_mc_source+0xef4/0x17e0
За этим последовало соответствующее опустошение ссылки в
ip6_mc_source().
Предоставленная трассировка из той же неисправленной версии.
дополнительно показывает доступ после завершения секции чтения RCU:
ОШИБКА: KASAN: slab-use-after-free в mutex_lock+0x76/0xe0
Запись размера 8 по адресу ffff888015b50240 с помощью задачи poc/1219. Ошибка обнаружена и устранена OpenAI Security Research и
подтверждено Trail of Bits.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ipv6: prevent in6_dev_get() from resurrecting inet6_dev in6_dev_get() reads dev->ip6_ptr under RCU and then unconditionally increments its refcount. Device teardown can clear the pointer and drop the last reference between these operations. The increment then resurrects an object whose RCU free has already been queued, so callers can use it after it is freed. Use refcount_inc_not_zero() and return NULL when the object has already reached zero. RCU keeps the memory accessible through the attempted reference acquisition, and a successful increment pins the object for the caller. An independent run on the exact unpatched 6f5156d7a31a (v7.2-rc3) kernel reproduced the invalid reference acquisition as UID 1000: refcount_t: addition on 0; use-after-free. ip6_mc_source+0xef4/0x17e0 It was followed by the corresponding reference underflow in ip6_mc_source(). The supplied trace from the same unpatched revision additionally shows the access after the RCU read-side section ends: BUG: KASAN: slab-use-after-free in mutex_lock+0x76/0xe0 Write of size 8 at addr ffff888015b50240 by task poc/1219 Bug found and triaged by OpenAI Security Research and validated by Trail of Bits.
Характеристики атаки
Последствия
Строка CVSS v3.1