Home
last modified time | relevance | path

Searched hist:"2112748284 f2249e5b811947e2fbdc4b95ea95d6" (Results 1 – 7 of 7) sorted by relevance

/haiku/src/tests/system/network/posixnet/
H A DSocketTests.cpp2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
H A DSocketTests.h2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
H A DPosixNetTestAddon.cpp2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
H A DJamfile2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
/haiku/src/tests/system/kernel/util/
H A DBOpenHashTableTest.h2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
H A DBOpenHashTableTest.cpp2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
/haiku/src/add-ons/kernel/network/protocols/tcp/
H A DEndpointManager.cpp2112748284f2249e5b811947e2fbdc4b95ea95d6 Wed Jan 29 00:16:08 UTC 2020 Kyle Ambroff-Kao <kyle@ambroffkao.com> tcp: Fix KDL when sockets are reused

This fixes a KDL that is triggered by the following scenario.

1. A socket is created, attempting to establish a session
between (loopback, ephemeral port) => (remote address, remote
port).
2. That socket ends up in the closed state because the remote is not
accepting connections.
3. The socket is re-used to connect to a different (remote address,
remote port).

The problem is that fConnectionHash is a BOpenHashTable<TCPEndpoint>,
and inserting endpoint multiple times can create a linked list
cycle (TCPEndpoint is an intrusive linked list node). That means that,
even though TCPEndpoint's destructor removes itself from
fConnectionHash, there will still be a pointer to it left behind,
which means that future accesses within that hash table bucket will
result in a segfault.

The added fConnectionHash.Remove(endpoint) here prevents the KDL, as
it ensures that socket reuse doesn't result in a cycle.

Fixes #13927, see that ticket for a detailed explanation of the
problem.

Also added some regression tests:
* Added SocketTests::ClientSocketReuseTest to PosixNetTest, which
reproduces this KDL.
* BOpenHashTable: Added tests to cover RemoveUnchecked and removal
of an object that isn't in the table.

Change-Id: If4bcc1e0d94350a5ad9ba8e7ae6f1b783b3f6d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2173
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>