Skip to content

[20166] Fix data race in PDPListener and SecurityManager #4188

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

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

Mario-DL
Copy link
Member

@Mario-DL Mario-DL commented Dec 21, 2023

Description

This PR fixes a data race occurring in PDPListenerSecurityInitiator affecting SecurityManager. The temp_participant_data_ was being overwritten as discovered_participant() was being called without the PDP mutex taken. This causes a corruption when the secure participant was in the middle of matching to a previous secure participant.

This PR also ensures that the discovered_participant() method is using the ParticipantProxyData from the discovered_participants collection.

Note: openning as draft as proper test needs to be added

@Mergifyio backport 2.12.x 2.11.x 2.10.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • N/A New feature has been added to the versions.md file (if applicable).
  • N/A New feature has been documented/Current behavior is correctly described in the documentation.
  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@Mario-DL Mario-DL added this to the v2.13.1 milestone Dec 21, 2023
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my NIT below, a regression test should be added

@Mario-DL
Copy link
Member Author

@richiprosima please test this

@Mario-DL
Copy link
Member Author

@richiprosima please test this

Signed-off-by: Mario Dominguez <[email protected]>
…SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>
Signed-off-by: Mario Dominguez <[email protected]>
@Mario-DL Mario-DL marked this pull request as ready for review December 22, 2023 08:39
@Mario-DL
Copy link
Member Author

@richiprosima please test this

Signed-off-by: Mario Dominguez <[email protected]>
Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with green CI

@MiguelCompany MiguelCompany reopened this Dec 22, 2023
@MiguelCompany MiguelCompany added the ci-pending PR which CI is running label Dec 22, 2023
@MiguelCompany
Copy link
Member

@richiprosima Please test mac

1 similar comment
@MiguelCompany
Copy link
Member

@richiprosima Please test mac

@JesusPoderoso JesusPoderoso added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Dec 24, 2023
@EduPonz EduPonz merged commit 84334da into master Jan 8, 2024
@EduPonz EduPonz deleted the hotfix/20166 branch January 8, 2024 13:05
@EduPonz
Copy link

EduPonz commented Jan 8, 2024

@Mergifyio backport 2.12.x 2.11.x 2.10.x

Copy link
Contributor

mergify bot commented Jan 8, 2024

backport 2.12.x 2.11.x 2.10.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 8, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)
mergify bot pushed a commit that referenced this pull request Jan 8, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)
EduPonz pushed a commit that referenced this pull request Jan 10, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)

Co-authored-by: Mario Domínguez López <[email protected]>
MiguelCompany pushed a commit that referenced this pull request Jan 11, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)
MiguelCompany pushed a commit that referenced this pull request Jan 16, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)

Co-authored-by: Mario Domínguez López <[email protected]>
MiguelCompany pushed a commit that referenced this pull request Jan 16, 2024
* Refs #20166: Regression Test

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Use the participant proxy data stored the collection in SecurityManager::discovered_participant()

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #20166: Test Rev suggestion

Signed-off-by: Mario Dominguez <[email protected]>

---------

Signed-off-by: Mario Dominguez <[email protected]>
(cherry picked from commit 84334da)

Co-authored-by: Mario Domínguez López <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants