Skip to content

Reject mprotect ranges beyond guest address space - #1703

Open
carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:issue-1685-mprotect-range
Open

carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:issue-1685-mprotect-range

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

Summary

Reject positive, page-aligned Linux mprotect requests that extend beyond the
guest address space. Return -ENOMEM before calling the memory manager, while
preserving valid ranges and other OS personalities.

Fixes #1685.

Validation

From the tests/ directory:

  • PYTHONPATH=.. python3 -m unittest test_syscall_mman -v (7 tests)
  • PYTHONPATH=.. python3 test_posix.py MprotectRangeOverflowTests -v (7 tests
    through the POSIX test runner)
  • RV64 Linux guest under Qiling: the SIZE_MAX request returns -1 with
    errno=ENOMEM; a one-page control returns 0.

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

Extra tests?

  • I have added enough tests for this PR.

Changelog?

  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing

  • I have read the contribution guide.

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.

1 participant