mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
uplink_client_base: no deref of invalid connection
Imagine receiving the signal for an available TX ack or an available RX packet at the Uplink connection but a later received signal for a link-state change (to link state "down") at the same connection is handled first and destructs the Uplink connection before the handling of the former signals. In this case, the methods 'Uplink_client_base::_conn_tx_handle_ack_avail' and 'Uplink_client_base::_conn_rx_handle_packet_avail' must be guarded against an unconstructed '_conn' member, but they weren't so far. Fixes #4384
This commit is contained in:
parent
83626b18f0
commit
94121e7cd7
@ -59,6 +59,9 @@ class Genode::Uplink_client_base : Noncopyable
|
||||
|
||||
void _conn_tx_handle_ack_avail()
|
||||
{
|
||||
if (!_conn.constructed()) {
|
||||
return;
|
||||
}
|
||||
while (_conn->tx()->ack_avail()) {
|
||||
|
||||
_conn->tx()->release_packet(_conn->tx()->get_acked_packet());
|
||||
@ -67,6 +70,9 @@ class Genode::Uplink_client_base : Noncopyable
|
||||
|
||||
void _conn_rx_handle_packet_avail()
|
||||
{
|
||||
if (!_conn.constructed()) {
|
||||
return;
|
||||
}
|
||||
bool drv_ready_to_transmit_pkt { _drv_link_state };
|
||||
bool pkts_transmitted { false };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user