В ядре Linux устранена следующая уязвимость:
bpf: отклонить регистрацию struct_ops, которая использует модуль ptr, а модуль btf_id отсутствует. В bpf_struct_ops есть отчет UAF, когда CONFIG_MODULES=n.
В частности, отчет касается tcp_congestion_ops, который имеет
член «struct Module *owner». Для struct_ops, у которого есть член «struct Module *owner»,
его можно расширить либо обычным модулем ядра, либо
с помощью bpf_struct_ops. будет использоваться bpf_try_module_get()
выполнить пересчет и выполнить другой пересчет
на основе указателя владельца.
Когда CONFIG_MODULES=n,
btf_id «структурного модуля» отсутствует:
ВНИМАНИЕ:solve_btfids: неразрешенный символьный модуль
Таким образом, bpf_try_module_get() не может выполнить правильный подсчет ссылок. Не для всех struct_ops подсистемы требуется член «struct Module *owner».
например недавний sched_ext_ops. Этот патч предназначен для отключения регистрации bpf_struct_ops, если
struct_ops имеет член «struct Module *» и
«Модуль структуры» btf_id отсутствует.
Помощник btf_type_is_fwd()
для этого теста перемещается в заголовочный файл btf.h. Это произошло с момента запуска bpf_struct_ops, который уже ушел.
через множество изменений. Тег Fixes установлен на недавнюю фиксацию, которую это
патч может применяться чисто.
Учитывая CONFIG_MODULES=n, это не так.
распространенность и возраст проблемы, а также таргетинг на bpf-next.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: bpf: Reject struct_ops registration that uses module ptr and the module btf_id is missing There is a UAF report in the bpf_struct_ops when CONFIG_MODULES=n. In particular, the report is on tcp_congestion_ops that has a "struct module *owner" member. For struct_ops that has a "struct module *owner" member, it can be extended either by the regular kernel module or by the bpf_struct_ops. bpf_try_module_get() will be used to do the refcounting and different refcount is done based on the owner pointer. When CONFIG_MODULES=n, the btf_id of the "struct module" is missing: WARN: resolve_btfids: unresolved symbol module Thus, the bpf_try_module_get() cannot do the correct refcounting. Not all subsystem's struct_ops requires the "struct module *owner" member. e.g. the recent sched_ext_ops. This patch is to disable bpf_struct_ops registration if the struct_ops has the "struct module *" member and the "struct module" btf_id is missing. The btf_type_is_fwd() helper is moved to the btf.h header file for this test. This has happened since the beginning of bpf_struct_ops which has gone through many changes. The Fixes tag is set to a recent commit that this patch can apply cleanly. Considering CONFIG_MODULES=n is not common and the age of the issue, targeting for bpf-next also.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.9
|
6.12.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.13.2
|