In the Linux kernel, the following vulnerability has been resolved: pid_namespace: make zap_pid_ns_processes() freezable When the init of a pid namespace exits, zap_pid_ns_processes() waits until all other pids in the namespace are freed. Трейсер за пределами пространства имен, который не собирает своих отслеживаемых зомби, сохраняет выделенные пиды, поэтому это ожидание не имеет верхней границы, и, пока оно длится каждая попытка приостановки, терпит неудачу: процессы пользовательского пространства Freezing потерпели неудачу после 20.006 секунд (2 задачи, отказывающиеся зависать, wq_busy=0): ожидание Neither замораживается. Первый цикл спит в do_wait (), который возвращает -ERESTARTSYS по поддельному сигналу морозильника; затем цикл очищает TIF_SIGPENDING и ждет снова, не замерзая.
Последний цикл спит в TASK_INTERRUPTIBLE, и поскольку ничто не очищает TIF_SIGPENDING там, расписание () возвращается сразу после первой попытки зависания, и задача вращается, пока ожидание не закончится. Спите в TASK_INTERRUPTIBLE TASK_FREEZABLE в do_wait(), так что морозильник может заморозить задачи, ожидающие там непосредственно, а в TASK_IDLE TASK_FREEZABLE в заключительном цикле, как это делает coredump_task_exit(). Это произошло с браузерами Chromium-based: crashpad ptrace-привязывает потоки разбитого рендерера, который является pid namespace init, и не пожинает убитых во время дампа.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: pid_namespace: make zap_pid_ns_processes() freezable When the init of a pid namespace exits, zap_pid_ns_processes() waits until all other pids in the namespace are freed. A tracer outside the namespace that does not reap its traced zombies keeps those pids allocated, so this wait has no upper bound, and while it lasts every suspend attempt fails: Freezing user space processes failed after 20.006 seconds (2 tasks refusing to freeze, wq_busy=0): Neither wait is freezable. The first loop sleeps in do_wait(), which returns -ERESTARTSYS on the freezer's fake signal; the loop then clears TIF_SIGPENDING and waits again without ever freezing. The final loop sleeps in TASK_INTERRUPTIBLE, and since nothing clears TIF_SIGPENDING there, schedule() returns immediately after the first freeze attempt and the task spins until the wait ends. Sleep in TASK_INTERRUPTIBLE | TASK_FREEZABLE in do_wait(), so that the freezer can freeze tasks waiting there directly, and in TASK_IDLE | TASK_FREEZABLE in the final loop, like coredump_task_exit() does. This was hit with Chromium-based browsers: crashpad ptrace-attaches the threads of a crashed renderer, which is a pid namespace init, and does not reap those killed during the dump.