shadowaead_2022: data race between clientConn.writeRequest and Close
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- go
- Área
- networking
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 23
- Forks
- 37
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
good first issue tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
Edwin-metcalf/MetCode#76 ·
Los mantenedores suelen responder en 1 día
-
-diff's removed-name budget ignores the names the -ptr pass testedPosiblemente ocupada @nova-loop la tomó hoy. Abiertoarea: cli bug good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TMHSDigital/subenum#495 ·
Los mantenedores suelen responder en 1 día
-
deskclose human-decided leaves the legacy decision-needed label and applies no human-decidedAbiertobug effort:s impact:med raised-by:worker risk:low to:worker
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
medici-finance/assay#8120 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory:subtask
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
reportedBy/community
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openchoreo/openchoreo#5751 ·
Los mantenedores suelen responder en 1 día