Podatność use-after-free w jądrze Linux dotyczy mechanizmu składania fragmentów pakietów IP (inet frags) i jest wyzwalana podczas niszczenia przestrzeni nazw sieciowych (netns teardown). Błąd umożliwia atakującemu sieciowemu zdalne wywołanie uszkodzenia pamięci jądra bez jakiegokolwiek uwierzytelnienia.
▸ Pokaż oryginał (EN)
In the Linux kernel, the following vulnerability has been resolved: inet: frags: fix use-after-free caused by the fqdir_pre_exit() flush On netns teardown, fqdir_pre_exit() walks the fqdir rhashtable and flushes every fragment queue that is not yet complete using inet_frag_queue_flush(). That helper frees all the skbs queued on the fragment queue but does not set INET_FRAG_COMPLETE, and leaves q->fragments_tail and q->last_run_head pointing at the freed skbs. The queue itself stays in the rhashtable. fqdir_pre_exit() first lowers high_thresh to 0 to stop new queue lookups, but it cannot stop a fragment that already obtained the queue through inet_frag_find() earlier and stalled just before taking the queue lock. Once that fragment resumes after the flush and takes the queue lock, it passes the INET_FRAG_COMPLETE check and then dereferences the freed fragments_tail. inet_frag_queue_insert() reads FRAG_CB() and ->len of that pointer and, on the append path, writes ->next_frag, causing a slab use-after-free. IPv6, nf_conntrack_reasm6 and 6lowpan reassembly share the same flush path and are affected as well. Reset rb_fragments, fragments_tail and last_run_head in inet_frag_queue_flush() so a flushed queue no longer points at the freed skbs. A fragment that resumes after the flush and takes the queue lock then finds an empty queue and starts a new run instead of dereferencing the freed fragments_tail. ip_frag_reinit() already performed this reset after its own flush, so drop the now duplicate code there.
Podczas niszczenia przestrzeni nazw sieciowych funkcja fqdir_pre_exit() zwalnia wszystkie bufory skb kolejki fragmentów za pomocą inet_frag_queue_flush(), jednak nie ustawia flagi INET_FRAG_COMPLETE i pozostawia wskaźniki q->fragments_tail oraz q->last_run_head wskazujące na już zwolnioną pamięć. Jeśli wątek obsługi fragmentów zdążył pobrać kolejkę przez inet_frag_find() przed obniżeniem progu high_thresh do zera, po wznowieniu pracy przejdzie pomyślnie weryfikację INET_FRAG_COMPLETE i wyłuska zwolniony fragments_tail. Funkcja inet_frag_queue_insert() odczytuje wówczas metadane FRAG_CB() ze zwolnionego obiektu, a na ścieżce dołączania zapisuje do pola ->next_frag, powodując klasyczny slab use-after-free. Ten sam kod flush jest współdzielony przez IPv6, nf_conntrack_reasm6 oraz mechanizm reassemblacji 6lowpan, więc wszystkie te podsystemy są podatne.
Atakujący może doprowadzić do uszkodzenia pamięci jądra (heap use-after-free), co w praktyce otwiera drogę do eskalacji uprawnień lokalnie lub destabilizacji systemu (kernel panic). Ze względu na sieciowy charakter wektora (AV:N, PR:N, UI:N) możliwe jest również zdalne wywołanie podatności poprzez przesyłanie odpowiednio spreparowanych fragmentów pakietów IP.
Należy zastosować patche dostępne u producenta zgodnie z referencjami (commity: 010c3313a4d1, 0e823ca0e739, 32594b098549, 89b909e97045, c22599cc90e1 w repozytorium kernel.org stable). Zaleca się aktualizację jądra do wersji zawierającej powyższe poprawki lub ręczne zastosowanie łatek. Jako tymczasowe obejście można rozważyć ograniczenie możliwości tworzenia przestrzeni nazw sieciowych przez nieuprzywilejowanych użytkowników.
Jądro Linux — wersje wskazane w referencjach producenta (commity naprawcze dostępne w repozytorium stable kernel.org). Dotknięte podsystemy: inet frags (IPv4), IPv6 fragment reassembly, nf_conntrack_reasm6 oraz 6lowpan reassembly.
Poprawka polega na zresetowaniu wskaźników rb_fragments, fragments_tail i last_run_head wewnątrz inet_frag_queue_flush(), tak aby opróżniona kolejka nie wskazywała na zwolnione skb. Kod resetu był już obecny w ip_frag_reinit() — poprawka ujednolica zachowanie i usuwa zduplikowaną logikę.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HLinux Kernel
OSLinux6.12.936.197.16.18.3 – 6.18.36 (bez)6.19.1 – 7.0.13 (bez)
Powiązane podatności
Type confusion w V8 (Google Chrome) — zdalne uszkodzenie sterty
Commvault Command Center – nieuwierzytelniony RCE przez path traversal w ZIP
RCE przez YAML deserialization w IBM Aspera Faspex
RCE w VMware Workspace ONE Access i Identity Manager poprzez server-side template injection
Command Injection w VMware Workspace One Access i Identity Manager