CVE-2024-43887

In the Linux kernel, the following vulnerability has been resolved: net/tcp: Disable TCP-AO static key after RCU grace period The lifetime of TCP-AO static_key is the same as the last tcp_ao_info. On the socket destruction tcp_ao_info ceases to be with RCU grace period, while tcp-ao static branch is currently deferred destructed. The static key definition is : DEFINE_STATIC_KEY_DEFERRED_FALSE(tcp_ao_needed, HZ); which means that if RCU grace period is delayed by more than a second and tcp_ao_needed is in the process of disablement, other CPUs may yet see tcp_ao_info which atent dead, but soon-to-be. And that breaks the assumption of static_key_fast_inc_not_disabled(). See the comment near the definition: > * The caller must make sure that the static key can't get disabled while > * in this function. It doesn't patch jump labels, only adds a user to > * an already enabled static key. Originally it was introduced in commit eb8c507296f6 ("jump_label: Prevent key->enabled int overflow"), which is needed for the atomic contexts, one of which would be the creation of a full socket from a request socket. In that atomic context, it's known by the presence of the key (md5/ao) that the static branch is already enabled. So, the ref counter for that static branch is just incremented instead of holding the proper mutex. static_key_fast_inc_not_disabled() is just a helper for such usage case. But it must not be used if the static branch could get disabled in parallel as it's not protected by jump_label_mutex and as a result, races with jump_label_update() implementation details. Happened on netdev test-bot[1], so not a theoretical issue: [] jump_label: Fatal kernel bug, unexpected op at tcp_inbound_hash+0x1a7/0x870 [ffffffffa8c4e9b7] (eb 50 0f 1f 44 != 66 90 0f 1f 00)) size:2 type:1 [] ------------[ cut here ]------------ [] kernel BUG at arch/x86/kernel/jump_label.c:73! [] Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI [] CPU: 3 PID: 243 Comm: kworker/3:3 Not tainted 6.10.0-virtme #1 [] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 [] Workqueue: events jump_label_update_timeout [] RIP: 0010:__jump_label_patch+0x2f6/0x350 ... [] Call Trace: [] <TASK> [] arch_jump_label_transform_queue+0x6c/0x110 [] __jump_label_update+0xef/0x350 [] __static_key_slow_dec_cpuslocked.part.0+0x3c/0x60 [] jump_label_update_timeout+0x2c/0x40 [] process_one_work+0xe3b/0x1670 [] worker_thread+0x587/0xce0 [] kthread+0x28a/0x350 [] ret_from_fork+0x31/0x70 [] ret_from_fork_asm+0x1a/0x30 [] </TASK> [] Modules linked in: veth [] ---[ end trace 0000000000000000 ]--- [] RIP: 0010:__jump_label_patch+0x2f6/0x350 [1]: https://netdev-3.bots.linux.dev/vmksft-tcp-ao-dbg/results/696681/5-connect-deny-ipv6/stderr
Configurations

Configuration 1 (hide)

OR cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc2:*:*:*:*:*:*

History

05 Sep 2024, 19:43

Type Values Removed Values Added
CVSS v2 : unknown
v3 : 5.5
v2 : unknown
v3 : 4.7

05 Sep 2024, 19:29

Type Values Removed Values Added
First Time Linux
Linux linux Kernel
CPE cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:6.11:rc2:*:*:*:*:*:*
CVSS v2 : unknown
v3 : unknown
v2 : unknown
v3 : 5.5
CWE NVD-CWE-noinfo
Summary
  • (es) En el kernel de Linux, se resolvió la siguiente vulnerabilidad: net/tcp: deshabilite la clave estática TCP-AO después del período de gracia de RCU. La vida útil de TCP-AO static_key es la misma que la del último tcp_ao_info. En la destrucción del socket, tcp_ao_info deja de tener un período de gracia de RCU, mientras que la rama estática tcp-ao actualmente se retrasa su destrucción. La definición de clave estática es: DEFINE_STATIC_KEY_DEFERRED_FALSE(tcp_ao_needed, HZ); lo que significa que si el período de gracia de la RCU se retrasa más de un segundo y tcp_ao_needed está en proceso de deshabilitación, es posible que otras CPU aún vean tcp_ao_info, que está muerto, pero pronto lo estará. Y eso rompe la suposición de static_key_fast_inc_not_disabled(). Vea el comentario cerca de la definición: &gt; * El que llama debe asegurarse de que la clave estática no puede conseguir desactivada mientras &gt; * está en esta función. No parchea etiquetas de salto, sólo agrega un usuario a &gt; * una clave estática ya habilitada. Originalmente se introdujo en el commit eb8c507296f6 ("jump_label: Prevent key-&gt;enabled int overflow"), que es necesaria para los contextos atómicos, uno de los cuales sería la creación de un socket completo a partir de un socket de solicitud. En ese contexto atómico, se sabe por la presencia de la clave (md5/ao) que la rama estática ya está habilitada. Entonces, el contador de referencia para esa rama estática simplemente se incrementa en lugar de mantener el mutex adecuado. static_key_fast_inc_not_disabled() es solo una ayuda para tal caso de uso. Pero no debe usarse si la rama estática podría deshabilitarse en paralelo ya que no está protegida por jump_label_mutex y, como resultado, corre con los detalles de implementación de jump_label_update(). Sucedió en netdev test-bot[1], por lo que no es un problema teórico: [] jump_label: error fatal del kernel, operación inesperada en tcp_inbound_hash+0x1a7/0x870 [ffffffffa8c4e9b7] (eb 50 0f 1f 44 != 66 90 0f 1f 00)) tamaño:2 tipo:1 [] ------------[ cortar aquí ]------------ [] ERROR del kernel en arch/x86/kernel/jump_label.c :73! [] Ups: código de operación no válido: 0000 [#1] PREEMPT SMP KASAN NOPTI [] CPU: 3 PID: 243 Comm: kworker/3:3 Not tainted 6.10.0-virtme #1 [] Nombre del hardware: PC estándar QEMU (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 01/04/2014 [] Cola de trabajo: eventos jump_label_update_timeout [] RIP: 0010:__jump_label_patch+0x2f6/0x350... [] Llamada Seguimiento: [] [] arch_jump_label_transform_queue+0x6c/0x110 [] __jump_label_update+0xef/0x350 [] __static_key_slow_dec_cpuslocked.part.0+0x3c/0x60 [] jump_label_update_timeout+0x2c/0x40 [] 0x1670 [] hilo_trabajador+ 0x587/0xce0 [] kthread+0x28a/0x350 [] ret_from_fork+0x31/0x70 [] ret_from_fork_asm+0x1a/0x30 [] [] Módulos vinculados en: veth [] ---[ end trace 0000000000000000 ]--- [] RIP: 0010:__jump_label_patch+0x2f6/0x350 [1]: https://netdev-3.bots.linux.dev/vmksft-tcp-ao-dbg/results/696681/5-connect-deny-ipv6/stderr
References () https://git.kernel.org/stable/c/14ab4792ee120c022f276a7e4768f4dcb08f0cdd - () https://git.kernel.org/stable/c/14ab4792ee120c022f276a7e4768f4dcb08f0cdd - Patch
References () https://git.kernel.org/stable/c/954d55a59b2501f4a9bd693b40ce45a1c46cb2b3 - () https://git.kernel.org/stable/c/954d55a59b2501f4a9bd693b40ce45a1c46cb2b3 - Patch

26 Aug 2024, 11:15

Type Values Removed Values Added
New CVE

Information

Published : 2024-08-26 11:15

Updated : 2024-09-05 19:43


NVD link : CVE-2024-43887

Mitre link : CVE-2024-43887

CVE.ORG link : CVE-2024-43887


JSON object : View

Products Affected

linux

  • linux_kernel