containerd/pkg/cri/streaming/remotecommand
Danny Canter f012617edf CRI stream server: Fix goroutine leak in Exec
In the CRI streaming server, a goroutine (`handleResizeEvents`) is launched
to handle terminal resize events if a TTY is asked for with an exec; this
is the sender of terminal resize events. Another goroutine is launched
shortly after successful process startup to actually do something with
these events, however the issue arises if the exec process fails to start
for any reason that would have `process.Start` return non-nil. The receiver
goroutine never gets launched so the sender is stuck blocked on a channel send
infinitely.

This could be used in a malicious manner by repeatedly launching execs
with a command that doesn't exist in the image, as a single goroutine
will get leaked on every invocation which will slowly grow containerd's
memory usage.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2022-11-29 06:31:38 -08:00
..
attach.go Refactor CRI packages 2020-10-07 14:45:57 -07:00
doc.go Refactor CRI packages 2020-10-07 14:45:57 -07:00
exec.go Refactor CRI packages 2020-10-07 14:45:57 -07:00
httpstream.go CRI stream server: Fix goroutine leak in Exec 2022-11-29 06:31:38 -08:00
websocket.go Refactor CRI packages 2020-10-07 14:45:57 -07:00