English version →
カテゴリ
CVE-2022-50838

net: stream: purge sk_error_queue in sk_stream_kill_queues()

概要

net: stream: purge sk_error_queue in sk_stream_kill_queues()

原文の説明

取得元が公開している説明をそのまま載せています (多くは英語)。

In the Linux kernel, the following vulnerability has been resolved:

net: stream: purge sk_error_queue in sk_stream_kill_queues()

Changheon Lee reported TCP socket leaks, with a nice repro.

It seems we leak TCP sockets with the following sequence:

  1. SOF_TIMESTAMPING_TX_ACK is enabled on the socket.

    Each ACK will cook an skb put in error queue, from __skb_tstamp_tx().
    __skb_tstamp_tx() is using skb_clone(), unless
    SOF_TIMESTAMPING_OPT_TSONLY was also requested.

  2. If the application is also using MSG_ZEROCOPY, then we put in the
    error queue cloned skbs that had a struct ubuf_info attached to them.

    Whenever an struct ubuf_info is allocated, sock_zerocopy_alloc()
    does a sock_hold().

    As long as the cloned skbs are still in sk_error_queue,
    socket refcount is kept elevated.

  3. Application closes the socket, while error queue is not empty.

Since tcp_close() no longer purges the socket error queue,
we might end up with a TCP socket with at least one skb in
error queue keeping the socket alive forever.

This bug can be (ab)used to consume all kernel memory
and freeze the host.

We need to purge the error queue, with proper synchronization
against concurrent writers.

出典: OSV.dev (Open Source Vulnerabilities) NVD OSV

影響パッケージ

Linux Kernel
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.9.337"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.10.0"},{"fixed":"4.14.303"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.15.0"},{"fixed":"4.19.270"}]},{"type":"ECOSYSTEM","events":[{"introduced":"4.20.0"},{"fixed":"5.4.229"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.5.0"},{"fixed":"5.10.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.86"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.0.16"},{"fixed":"6.1.2"}]}]

ディストリビューション別の修正状況

各ディストリビューションが公開している、この CVE の修正パッケージ

参照URL

当サイトでは、アクセス解析と広告の効果測定のために Cookie を使います。株式会社Game のサイト共通の設定です。 詳しく