Repository navigation
[components][lwp] fix signal ordering and ELF segment protection #11895
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
Open
BernardXiong
wants to merge
3
commits into
RT-Thread:master
Choose a base branch
from
BernardXiong:pr/lwp-signal-elf
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+41
−5
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个在后续的:
rt-thread/components/lwp/lwp_user_mm.h
Lines 213 to 232 in ff82e23
不开启 LWP_USING_MPROTECT 会默认设置为 MMU_MAP_U_RWCB,此处是否需要添加 LWP_USING_MPROTECT 控制比较好一些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
并且原本 elf_file_mmap 的注释放到了elf_prot_from_pflags 前面了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的
prot只有在开启LWP_USING_MPROTECT时才真正生效:lwp_user_mm_attr_to_kernel()在未开启 MPROTECT 时(lwp_user_mm.h的#else分支)会忽略入参并统一返回MMU_MAP_U_RWCB,所以映射行为和修改前完全一致,这里不需要再额外加#ifdef控制。已在 commit 7fae086 的调用点补充注释说明这一点,避免后续读者误以为未开启 MPROTECT 时会被映射成只读/可执行。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修正(commit 7fae086):把
elf_prot_from_pflags()移到elf_file_mmap()的 kernel-doc 注释之前,并给这个 helper 单独补了简短注释,elf_file_mmap()的文档重新紧挨着函数。