-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 write-implies-execute-never when applicable #1550
Merged
Merged
Changes from all commits
Commits
Show all changes
2 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$(call force,CFG_ARM32_core,y) | ||
$(call force,CFG_ARM64_core,n) | ||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) | ||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) | ||
arm32-platform-cpuarch := cortex-a15 | ||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) | ||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$(call force,CFG_ARM32_core,y) | ||
$(call force,CFG_ARM64_core,n) | ||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) | ||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) | ||
arm32-platform-cpuarch := cortex-a7 | ||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) | ||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$(call force,CFG_ARM32_core,y) | ||
$(call force,CFG_ARM64_core,n) | ||
$(call force,CFG_WITH_LPAE,n) | ||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,n) | ||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,n) | ||
$(call force,CFG_SECURE_TIME_SOURCE_CNTPCT,n) | ||
arm32-platform-cpuarch := cortex-a9 | ||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) | ||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$(call force,CFG_HWSUPP_MEM_PERM_WXN,y) | ||
$(call force,CFG_HWSUPP_MEM_PERM_PXN,y) | ||
# cortex-a53 and cortex-a57 complies on arm32 architectures | ||
arm32-platform-cpuarch := cortex-a53 | ||
arm32-platform-cflags += -mcpu=$(arm32-platform-cpuarch) | ||
arm32-platform-aflags += -mcpu=$(arm32-platform-cpuarch) | ||
platform-flavor-armv8 := 1 |
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
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.
Better to test only
CFG_CORE_RWDATA_NOEXEC
here.Optionally, add a dependency check in a
core/arc/arm/arm.mk
(but see my other comment, I feel the HWSUPP config is useless):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.
Some HW (C-A5, C-A9) do not support WXN and UWXN in SCTLR.
So we need this
CFG_HWSUPP_MEM_PERM_WXN
.This is why the directive is not used in AARCH64, as all ARMv8-A do support SCTLR[WXN].
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.
I understand that. But we can simply assume that platforms that don't support CFG_CORE_RWDATA_NOEXEC simply don't enable it, no?
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.
No. At least for the few platforms lacking this hw hardening, op-tee core can still build a mmu that does rw-data-noexec. Weaker protection but at least optee legitimate mapping is clean.
The arm-tf does both: its mmu api never maps rwx memory and it sets STCRL[WXs], of course.
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.
Ah, now I get it. We really have two things to configure here. Sorry for the confusion.