Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read after free on security code when remote participant is gone before an endpoint is matched [13035] #2328

Merged
merged 2 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/cpp/rtps/security/SecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,40 @@ void SecurityManager::remove_participant(
{
SecurityException exception;

for (auto& local_reader : reader_handles_)
{
for (auto wit = local_reader.second.associated_writers.begin();
local_reader.second.associated_writers.end() != wit;
)
{
if (wit->first.guidPrefix == participant_data.m_guid.guidPrefix)
{
wit = local_reader.second.associated_writers.erase(wit);
}
else
{
++wit;
}
}
}

for (auto& local_writer : writer_handles_)
{
for (auto rit = local_writer.second.associated_readers.begin();
local_writer.second.associated_readers.end() != rit;
)
{
if (rit->first.guidPrefix == participant_data.m_guid.guidPrefix)
{
rit = local_writer.second.associated_readers.erase(rit);
}
else
{
++rit;
}
}
}

ParticipantCryptoHandle* participant_crypto_handle =
dp_it->second.get_participant_crypto();
if (participant_crypto_handle != nullptr)
Expand Down
25 changes: 0 additions & 25 deletions test/blackbox/XFAIL_DDS_PIM_SECURITY.list
Original file line number Diff line number Diff line change
@@ -1,25 +0,0 @@
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_governance_rule_order.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_governance_rule_order.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_fail_on_partition_wildcards.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_fail_on_partition_wildcards.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_fail_on_topic_wildcards.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_fail_on_topic_wildcards.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsDisableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_disable_access_none.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryDisableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_disable_access_encrypt.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_disable_discovery_enable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessEncrypt_validation_ok_enable_discovery_enable_access_none.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_disable_discovery_disable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Intraprocess
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_encrypt.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndAccessAndCryptoPlugin_PermissionsEnableDiscoveryEnableAccessNone_validation_ok_enable_discovery_enable_access_none.Transport
BlackboxTests_DDS_PIM.Security.BuiltinAuthenticationAndCryptoPlugin_reliable_all_ok.Transport