MIOBufferAccessor::reader_for(IOBufferReader *) dereferences a null reader and leaves VIOs pointing at freed readers
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start with IOBuffer.cc around MIOBufferAccessor::reader_for(IOBufferReader *), then trace MIOBuffer::dealloc_reader() and the VIO get_reader()/get_writer() accessors. Check the cited CacheVC.cc call and the related guards in UnixNetVConnection::do_io_write() and PluginVC::do_io_write(). Done means null readers are handled safely and the reader lifetime and accessor ownership behavior are defined and covered.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
VIO::set_reader() is buffer.reader_for(reader), which is implemented at IOBuffer.cc#L1089-L1097:
if (entry == areader) {
return;
}
mbuf = areader->mbuf;
entry = areader;
There are two problems:
- Null reader.
reader_for(nullptr)dereferences null unless the accessor's current reader is already null. Callers have to know this.UnixNetVConnection::do_io_write()andPluginVC::do_io_write()guard the call, andINKVConnInternal::do_io_write()crashed this way in #13395.CacheVC::do_io_write()still callsvio.set_reader(abuf)without a check (CacheVC.cc#L209), so ado_io_write(c, 0, nullptr)on a cache write VC that already has a reader would crash the same way. - No back-pointer. Unlike
reader_for(MIOBuffer *), which allocates the reader throughalloc_accessor(this), this overload never setsareader->accessor.MIOBuffer::dealloc_reader()clears the accessor that a reader points back to (IOBuffer.cc#L1047-L1050). Without the back-pointer, freeing the reader or its buffer leaves the VIO holding danglingmbuf/entrypointers, which are reachable viaVIO::get_reader()/get_writer()andTSVIOReaderGet()/TSVIOBufferGet(). This is harmless as long as nothing touches the VIO after its operation ends, but it is not enforced anywhere.
Suggested fix: make reader_for(nullptr) clear the accessor rather than dereference null. For the second problem, either register the accessor on the reader (the reader belongs to the VIO's producer, so this needs a defined owner) or document that the reader must outlive any use of the VIO.
generated with Claude Opus 5.5 by Josiah VanderZee
- Lenguaje dominante
- C++
- Estrellas
- 2k
- Forks
- 903
- Merge medio
- 4 d 4 h
- PR fusionados (30 d)
- 135
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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.
Más de apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOPosiblemente ocupada @NginxL la tomó hoy. AbiertoBug Good First Issue IOBuffer Network
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/trafficserver#14220 ·
Los mantenedores suelen responder en 2 días
-
MallocAllocator does not check for allocation failurePosiblemente ocupada @umrndem la tomó hoy. AbiertoBug Core Good First Issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/trafficserver#14218 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
THREAD_ALLOC dereferences a null thread while THREAD_FREE falls back to the global allocatorAbiertoBug Event System Threads
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/trafficserver#14217 ·
Los mantenedores suelen responder en 2 días
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodPosiblemente ocupada @rajeetvk la tomó hace 1 día. AbiertoBug Event System Good First Issue TS API
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/trafficserver#14214 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
HostDBContinuation::init memsets a polymorphic ActionPosiblemente ocupada @ANMOLSCRIPT la tomó hoy. AbiertoBug Good First Issue HostDB
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
apache/trafficserver#14204 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/trafficserver
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 2 días
-
bug data-types
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ClickHouse/clickhouse-cpp#645 ·
Los mantenedores suelen responder en 1 día
-
bug compatibility difficulty:easy prio:normal
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NatronGitHub/openfx-misc#524 ·
Los mantenedores suelen responder en 1 día
-
[内容提案] 现在C++模块的CMake支持有更新,需要进行同步Abiertodocumentation enhancement help wanted P0
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Los mantenedores suelen responder en 1 día
-
Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
openscad/openscad#7360 · 2 comentarios ·
Los mantenedores suelen responder en 1 día