1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Files
libssh2/src
syed abdul khaliq ff501d6346 packet: keep new channel across EAGAIN in x11 and tcpip forward opens
When sending the open confirmation in `packet_x11_open()` or
`packet_queue_listener()` returns EAGAIN, the resumed call loses the
channel it just allocated: the x11 path never saves it in
`x11open_state->channel`, so it links a NULL channel and crashes, and
the listener path clears `listen_state->channel` on every pass, so the
server gets a confirmation for a channel that is never queued and leaks.
This keeps the pointer in the state struct the same way
`packet_authagent_open()` already does, which I checked with a send
callback that returns EAGAIN once (ASan SEGV in `ssh2_list_add()`
before, and the channel reaches the x11 callback and the accept queue
after). I also looked at #1427, which touched the same EAGAIN return,
and this is the gap behind the question raised there about the channel
still being usable when the function is re-entered.

Reported-by: Yin Luming
Ref: https://github.com/LuMingYinDetect/libssh_defects/blob/main/libssh_1.png
Fixes #1427

Closes #2656
2026-10-07 12:48:49 +02:00
..
2026-06-30 00:12:47 +02:00
2026-06-21 23:15:10 +02:00
2026-09-13 16:12:32 +02:00
2026-08-14 02:07:18 +02:00
2026-06-05 18:12:37 +02:00
2026-08-14 01:58:59 +02:00
2026-10-06 10:30:17 +02:00
2026-09-13 16:12:32 +02:00
2026-08-28 13:46:01 +02:00
2023-08-18 11:20:58 +00:00
2026-07-29 02:53:01 +02:00
2026-10-04 20:33:12 +02:00
2026-05-13 12:00:36 +02:00
2026-07-28 03:20:30 +02:00
2026-07-22 01:40:19 +02:00