mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
VFS LwIP: do not free TCP PCBs on error
The VFS LwIP plugin is page-faulting on connect error because the LwIP library frees a failed TCP protocol control block before calling the error callback, and then the VFS plugin dereferences the PCB to free it a second time. This problem was caused by a failure to follow documentation during a transition from a C callback to a C++ method. Fix #2972
This commit is contained in:
parent
770fc77584
commit
98380cebda
@ -61,6 +61,7 @@ typedef uintptr_t mem_ptr_t;
|
||||
#ifndef LWIP_NO_INTTYPES_H
|
||||
#define LWIP_NO_INTTYPES_H 1
|
||||
/* Define (sn)printf formatters */
|
||||
#define X8_F "02x"
|
||||
#define U16_F "u" // we don't have hu
|
||||
#define S16_F "d" // we don't have hd
|
||||
#define X16_F "x" // we don't have hx
|
||||
|
@ -1092,17 +1092,13 @@ class Lwip::Tcp_socket_dir final :
|
||||
*
|
||||
* Triggered by error callback, usually
|
||||
* just by an aborted connection.
|
||||
* The corresponding pcb is already freed
|
||||
* when this callback is called!
|
||||
*/
|
||||
void error()
|
||||
{
|
||||
state = CLOSED;
|
||||
|
||||
/* the PCB is expired now */
|
||||
if (_pcb) {
|
||||
tcp_arg(_pcb, NULL);
|
||||
tcp_close(_pcb);
|
||||
_pcb = NULL;
|
||||
}
|
||||
_pcb = NULL;
|
||||
|
||||
/* churn the application */
|
||||
handle_io(~0U);
|
||||
|
Loading…
Reference in New Issue
Block a user