В ядре Linux устранена следующая уязвимость:
sched_ext: сначала используйте cgroup_lock() в scx_cgroup_lock().
scx_cgroup_lock() блокирует запись scx_cgroup_ops_rwsem, а затем принимает
cgroup_lock(), который может блокироваться через kernfs:
scx включить/отключить запись cgroup rmdir cpu.weight
------------------ ------------ ----------------
cgroup_lock()
percpu_down_write (rwsem)
cgroup_lock()
kernfs_get_active()
percpu_down_read (rwsem)
kernfs_drain()
Путь включения ожидает, пока rmdir освободит cgroup_mutex. РМдир,
деактивируя файлы контроллера процессора, ожидает в kernfs_drain()
активная ссылка записи. Запись в scx_group_set_weight() ожидает
rwsem позади ожидающего записи.
Сначала возьмите cgroup_lock(). Пути set_* не требуют блокировок cgroup внутри
сторона чтения, поэтому ожидающая блокировка записи ожидает только тех разделов чтения, которые
всегда выполняется до завершения, и нет зависимости от rwsem обратно к
cgroup_mutex остается.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: sched_ext: Take cgroup_lock() first in scx_cgroup_lock() scx_cgroup_lock() write-locks scx_cgroup_ops_rwsem and then takes cgroup_lock(), which can deadlock through kernfs: scx enable/disable cgroup rmdir cpu.weight write ------------------ ------------ ---------------- cgroup_lock() percpu_down_write(rwsem) cgroup_lock() kernfs_get_active() percpu_down_read(rwsem) kernfs_drain() The enable path waits for the rmdir to release cgroup_mutex. The rmdir, deactivating the cpu controller's files, waits in kernfs_drain() for the write's active reference. The write, in scx_group_set_weight(), waits for the rwsem behind the pending writer. Take cgroup_lock() first. The set_* paths take no cgroup locks inside the read side, so a pending write-lock then only waits for read sections that always run to completion, and no dependency from the rwsem back to cgroup_mutex remains.
Уязвимые продукты 3
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
6.18.46
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
7.1.9
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
7.2
|