shadowaead_2022: data race between clientConn.writeRequest and Close
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- networking
調査の方向性
Start with shadowaead_2022.clientConn, especially writeRequest, Write, and Close, and reproduce the report using the described rejected-key client/server setup under Go's -race flag. Ensure the lazy request state is synchronized between the first Write and Close, then verify the reproduction no longer reports a race.
索引モデルが issue の本文から書いたものです。
説明
sing-shadowsocks2 (as used by sing-box v1.13.12), go 1.26, -race
shadowaead_2022.clientConn sends its request header lazily on the first Write (writeRequest), which initializes connection state. Close, typically called from the other copy direction when the server drops the connection, reads that state without synchronization:
WARNING: DATA RACE
Read by goroutine A:
github.com/sagernet/sing-shadowsocks2/shadowaead_2022.(*clientConn).Close()
github.com/sagernet/sing/common.Close()
github.com/sagernet/sing-box/route.(*ConnectionManager).connectionCopy()
Previous write by goroutine B:
github.com/sagernet/sing-shadowsocks2/shadowaead_2022.(*clientConn).writeRequest()
github.com/sagernet/sing-shadowsocks2/shadowaead_2022.(*clientConn).Write()
github.com/sagernet/sing/common/bufio.copyExtendedWithPool()
github.com/sagernet/sing-box/route.(*ConnectionManager).connectionCopy()
Reproduce: a Shadowsocks 2022 client whose key the server rejects. The server closes the connection right away, so the download direction ends and closes the conn while the upload direction is still in its first Write. It triggers reliably under -race with an in-process sing-box SS2022 inbound and a client configured with a different user key.
Suggested fix: guard the lazily initialized fields that writeRequest sets and Close reads (e.g. a mutex, or an atomic "request written" state checked by Close). Happy to send a PR.
- 主要言語
- Go
- スター
- 23
- フォーク
- 37
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
good first issue tools
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
Edwin-metcalf/MetCode#76 ·
メンテナーはふだん 1 日以内に返信
-
-diff's removed-name budget ignores the names the -ptr pass tested対応中かも @nova-loop が今日担当しました。 オープンarea: cli bug good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TMHSDigital/subenum#495 ·
メンテナーはふだん 1 日以内に返信
-
bug effort:s impact:med raised-by:worker risk:low to:worker
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
medici-finance/assay#8120 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
reportedBy/community
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openchoreo/openchoreo#5751 ·
メンテナーはふだん 1 日以内に返信