В ядре Linux устранена следующая уязвимость: трассировка: исправлено столкновение объединения модуля и ссылки для динамических событий. В структуре «trace_event_call» указатель «модуля» и «refcnt». Атомная переменная разделяет одно и то же пространство памяти в объединении.
Для динамичного
событий, членом союза является 'refcnt', который действует как активный
счетчик ссылок. Когда динамическое событие (например, kprobe, uprobe, fprobe, eprobe или
wprobe) имеет ненулевой счетчик ссылок (например, из-за активного события
триггеры или вложения perf), его 'call->module' оценивается как
небольшое ненулевое целое число вместо NULL. При фильтрации или настройке событий для конкретного модуля (например, запись
':mod:<module>' на 'set_event'), код в
'__ftrace_set_clr_event_nolock()' и 'update_event_fields()' читают
«вызов->модуль» напрямую, не проверяя, является ли событие динамическим.
Это заставляет ядро рассматривать маленькое целое число (refcnt) как
Указатель 'struct modul', приводящий к разыменованию NULL/недопустимого указателя
(Упс) при разыменовании имени модуля. Исправьте это, проверив флаг TRACE_EVENT_FL_DYNAMIC.
прежде чем рассматривать «вызов->модуль» как действительный указатель в этих путях кода.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: tracing: Fix union collision of module and refcnt for dynamic events In 'struct trace_event_call', the 'module' pointer and the 'refcnt' atomic variable share the same memory space in a union. For dynamic events, the union member is 'refcnt', which acts as an active reference counter. When a dynamic event (such as kprobe, uprobe, fprobe, eprobe, or wprobe) has a non-zero reference count (e.g. due to active event triggers or perf attachments), its 'call->module' evaluates to a small non-zero integer instead of NULL. When filtering or setting events for a specific module (e.g., writing ':mod:<module>' to 'set_event'), the code in '__ftrace_set_clr_event_nolock()' and 'update_event_fields()' reads 'call->module' directly without checking whether the event is dynamic. This causes the kernel to treat the small integer (refcnt) as a 'struct module' pointer, leading to a NULL/invalid pointer dereference (Oops) when dereferencing the module name. Fix this by ensuring that the 'TRACE_EVENT_FL_DYNAMIC' flag is checked before treating 'call->module' as a valid pointer in these code paths.