W jądrze Linux odkryto podatność typu race condition w module nvmet-tcp, dotyczącą obsługi żądania ICReq i jednoczesnego niszczenia kolejki połączeń NVMe/TCP. Błąd może prowadzić do podwójnego zwolnienia referencji do kolejki (double kref_put), co stanowi poważne zagrożenie dla stabilności i bezpieczeństwa systemu.
▸ Pokaż oryginał (EN)
In the Linux kernel, the following vulnerability has been resolved: nvmet-tcp: fix race between ICReq handling and queue teardown nvmet_tcp_handle_icreq() updates queue->state after sending an Initialization Connection Response (ICResp), but it does so without serializing against target-side queue teardown. If an NVMe/TCP host sends an Initialization Connection Request (ICReq) and immediately closes the connection, target-side teardown may start in softirq context before io_work drains the already buffered ICReq. In that case, nvmet_tcp_schedule_release_queue() sets queue->state to NVMET_TCP_Q_DISCONNECTING and drops the queue reference under state_lock. If io_work later processes that ICReq, nvmet_tcp_handle_icreq() can still overwrite the state back to NVMET_TCP_Q_LIVE. That defeats the DISCONNECTING-state guard in nvmet_tcp_schedule_release_queue() and allows a later socket state change to re-enter teardown and issue a second kref_put() on an already released queue. The ICResp send failure path has the same problem. If teardown has already moved the queue to DISCONNECTING, a send error can still overwrite the state with NVMET_TCP_Q_FAILED, again reopening the window for a second teardown path to drop the queue reference. Fix this by serializing both post-send state transitions with state_lock and bailing out if teardown has already started. Use -ESHUTDOWN as an internal sentinel for that bail-out path rather than propagating it as a transport error like -ECONNRESET. Keep nvmet_tcp_socket_error() setting rcv_state to NVMET_TCP_RECV_ERR before honoring that sentinel so receive-side parsing stays quiesced until the existing release path completes.
Gdy host NVMe/TCP wyśle żądanie inicjalizacji połączenia (ICReq) i natychmiast zamknie połączenie, po stronie serwera może rozpocząć się niszczenie kolejki w kontekście softirq, zanim io_work zdąży przetworzyć zbuforowane ICReq. Funkcja nvmet_tcp_schedule_release_queue() ustawia wtedy stan kolejki na NVMET_TCP_Q_DISCONNECTING i zwalnia referencję pod state_lock. Jeśli io_work następnie przetworzy ICReq, funkcja nvmet_tcp_handle_icreq() może nadpisać stan z powrotem na NVMET_TCP_Q_LIVE, omijając zabezpieczenie stanu DISCONNECTING. Podobny problem występuje w ścieżce błędu wysyłania ICResp — błąd wysyłki może nadpisać stan na NVMET_TCP_Q_FAILED, ponownie otwierając okno do wykonania drugiej ścieżki niszczenia kolejki i wywołania drugiego kref_put() na już zwolnionej kolejce. Poprawka serializuje obie zmiany stanu po wysłaniu za pomocą state_lock i przerywa operację, jeśli niszczenie już się rozpoczęło.
Atakujący lub złośliwy host NVMe/TCP może doprowadzić do podwójnego zwolnienia referencji do obiektu kolejki, co może skutkować uszkodzeniem pamięci jądra, niestabilnością systemu lub potencjalnym wykonaniem dowolnego kodu w kontekście jądra (privilege escalation lub RCE).
Należy zastosować patche dostępne w repozytorium kernel.org zgodnie z referencjami: commity 49891c8fe0cb, 5293a8882c54, 67e1aaf93b49, dcfe4d1f7960. Zaleca się aktualizację jądra Linux do wersji zawierającej wymienione poprawki.
Jądro Linux zawierające moduł nvmet-tcp — konkretne wersje wskazane w referencjach producenta (patche dostępne w repozytoriach stable kernel.org).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HLinux Kernel
OSLinux7.15.0 – 6.12.88 (bez)6.13 – 6.18.30 (bez)6.19 – 7.0.7 (bez)
Powiązane podatności
Type confusion w V8 (Google Chrome) — zdalne uszkodzenie sterty
Commvault Command Center – nieuwierzytelniony RCE przez path traversal w ZIP
IBM Aspera Faspex 4.4.2 Patch Level 1 and earlier could allow a remote attacker to execute arbitrary code on t...
VMware Workspace ONE Access and Identity Manager contain a remote code execution vulnerability due to server-s...
VMware Workspace One Access, Access Connector, Identity Manager, and Identity Manager Connector address have a...