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

map: fix mprotected pages not being copied #608

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

badochov
Copy link
Contributor

@badochov badochov commented Oct 16, 2024

JIRA: RTOS-953

Description

When a memory region with prot read-write got changed to read, then the
memory would not be copied on fork. This result in child and parent
sharing this page that can be changed back to being writeable.

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?

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

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

_map_force may return a value above 0 on error, when prot mismatch is
encountered.

JIRA: RTOS-953
@badochov
Copy link
Contributor Author

badochov commented Oct 16, 2024

@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 removed the request for review from agkaminski October 16, 2024 18:28
vm/map.c Outdated Show resolved Hide resolved
vm/map.c Outdated Show resolved Hide resolved
When a memory region with prot read-write got changed to read, then the
memory would not be copied on fork. This result in child and parent
sharing this page that can be changed back to being writeable.

JIRA: RTOS-953
Copy link

Unit Test Results

7 741 tests  +16   7 026 ✅ +16   41m 33s ⏱️ + 4m 21s
  461 suites +16     715 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit 2319a7a. ± Comparison against base commit 8a3ee95.

@badochov badochov marked this pull request as ready for review October 17, 2024 10:29
@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

Resolved, exception on ia32 were messed up, however, they should not occur as ia32 is non lazy system.
Nevertheless, PR fixing them:
#609

@badochov badochov merged commit 84b66c2 into master Oct 17, 2024
36 checks passed
@badochov badochov deleted the badochov/mprotect-fakeshare branch October 17, 2024 10:54
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