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

test_mprotect: test if mprotected pages are copied #381

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Oct 16, 2024

pages_in_child_copied test checks if pages with protection changed to read from read-write by mprotect are copied by child.

JIRA: RTOS-953

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

mem/test_mprotect.c Outdated Show resolved Hide resolved
@badochov
Copy link
Contributor Author

@badochov badochov marked this pull request as draft October 16, 2024 18:27
@badochov
Copy link
Contributor Author

DRAFTING: as demo showed issue on ia32, weird that only on one platform there's an issue with this change

@badochov badochov requested review from agkaminski and removed request for agkaminski October 16, 2024 18:27
@badochov badochov marked this pull request as ready for review October 17, 2024 10:30
Comment on lines +85 to +88
sleep(1);
if (area[0] != 0x42) {
exit(1);
}
Copy link
Member

@agkaminski agkaminski Oct 17, 2024

Choose a reason for hiding this comment

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

Perhaps it might be easier to do this test in reverse - modify the memory in child instead. This would be nicer, as it would only require waitpid sync point, without sleep. But I'm not 100% sure that such approach would test exactly the same thing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add separate test case for that

pages_in_child_copied test checks if pages with protection changed to read from read-write by mprotect are copied by child.
pages_in_parent_copied test checks if pages with protection changed to read from read-write by mprotect are copied by parent.

JIRA: RTOS-953
@badochov badochov changed the title test_mprotect: add pages_in_child_copied test test_mprotect: test if mprotected pages are copied Oct 17, 2024
@badochov badochov merged commit a36cfd9 into master Oct 17, 2024
28 of 33 checks passed
@badochov badochov deleted the badochov/mprotect-shared branch October 17, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants