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

Enable memory protection on DataSharing readers [13457] #2405

Merged
merged 5 commits into from
Feb 8, 2022

Conversation

MiguelCompany
Copy link
Member

@MiguelCompany MiguelCompany commented Jan 12, 2022

This PR adds several safety protection mechanisms on DataReader entities using data-sharing.

First, the readers will open the shared history on read-only mode.
Second, a new FASTDDS_CONST_SEQUENCE macro to define a sequence that only has the const version of the [] operator.

Should fix #2385

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany MiguelCompany added this to the v2.6.0 milestone Jan 12, 2022
Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
@MiguelCompany MiguelCompany modified the milestones: v2.6.0, v2.5.1 Jan 14, 2022
@MiguelCompany MiguelCompany changed the title Enable memory protection on DataSharing readers Enable memory protection on DataSharing readers [13457] Feb 8, 2022
Copy link
Contributor

@JLBuenoLopez JLBuenoLopez left a comment

Choose a reason for hiding this comment

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

LGTM!

CI failures seem unrelated.

@JLBuenoLopez JLBuenoLopez added the ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. label Feb 8, 2022
@MiguelCompany MiguelCompany merged commit 6505a51 into master Feb 8, 2022
@MiguelCompany MiguelCompany deleted the bugfix/13457 branch February 8, 2022 10:33
@MiguelCompany
Copy link
Member Author

@Mergifyio backport 2.4.x 2.3.x

mergify bot pushed a commit that referenced this pull request Feb 9, 2022
* Refs 13457. DataSharing reader map memory as read only.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Allow disabling non-const accessor on LoanableSequence.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. New macro FASTDDS_CONST_SEQUENCE.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Use FASTDDS_CONST_SEQUENCE on zero copy example.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Linters.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit 6505a51)
mergify bot pushed a commit that referenced this pull request Feb 9, 2022
* Refs 13457. DataSharing reader map memory as read only.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Allow disabling non-const accessor on LoanableSequence.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. New macro FASTDDS_CONST_SEQUENCE.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Use FASTDDS_CONST_SEQUENCE on zero copy example.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Linters.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit 6505a51)

# Conflicts:
#	src/cpp/rtps/DataSharing/ReaderPool.hpp
#	src/cpp/utils/shared_memory/SharedMemSegment.hpp
@mergify
Copy link
Contributor

mergify bot commented Feb 9, 2022

backport 2.4.x 2.3.x

✅ Backports have been created

MiguelCompany added a commit that referenced this pull request Feb 9, 2022
* Enable memory protection on DataSharing readers (#2405)

* Refs 13457. DataSharing reader map memory as read only.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Allow disabling non-const accessor on LoanableSequence.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. New macro FASTDDS_CONST_SEQUENCE.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Use FASTDDS_CONST_SEQUENCE on zero copy example.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

* Refs 13457. Linters.

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>
(cherry picked from commit 6505a51)

# Conflicts:
#	src/cpp/rtps/DataSharing/ReaderPool.hpp
#	src/cpp/utils/shared_memory/SharedMemSegment.hpp

* Fix conflicts

Signed-off-by: Miguel Company <MiguelCompany@eprosima.com>

Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
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.

Shared Memory data protection [13457]
2 participants