В ядре Linux была устранена следующая уязвимость: blk-cgroup: исправлены утечки и онлайн-флаг на отказе radix_tree_insert When radix_tree_insert(), в blkg_create() путь ошибки имеет две проблемы: 1. blkg->online установлен на истинность безоговорочно, даже когда blkg никогда не был полностью вставлен. Переместите задание внутрь блока успеха. 2. Путь ошибки вызывает blkg_put() без предварительного вызова percpu_ref_kill().
Поскольку пересчет все еще находится в режиме percpu, percpu_ref_put() делает только this_cpu_sub() без проверки на ноль, поэтому blkg_release() никогда не запускается. Это постоянно приводит к утечке памяти blkg, ее percpu iostat, данных политики, исходной ссылки blkg и ссылки cgroup css - последняя предотвращает уничтожение cgroup. Исправить путем замены blkg_put() на percpu_ref_kill(), соответствуя шаблону, используемому в blkg_destroy().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: blk-cgroup: fix leaks and online flag on radix_tree_insert failure When radix_tree_insert() fails in blkg_create(), the error path has two issues: 1. blkg->online is set to true unconditionally, even when the blkg was never fully inserted. Move the assignment inside the success block. 2. The error path calls blkg_put() without first calling percpu_ref_kill(). Because the refcount is still in percpu mode, percpu_ref_put() only does this_cpu_sub() without checking for zero, so blkg_release() is never triggered. This permanently leaks the blkg memory, its percpu iostat, policy data, the parent blkg reference, and the cgroup css reference — the latter preventing the cgroup from ever being destroyed. Fix by replacing blkg_put() with percpu_ref_kill(), matching the pattern used in blkg_destroy().