-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-2…
…0210412' into staging target-arm queue: * hw/arm/virt-acpi-build: Fix GSIV values of the {GERR, Sync} interrupts * hw/arm/smmuv3: Emulate CFGI_STE_RANGE for an aligned range of StreamIDs * accel/tcg: Preserve PAGE_ANON when changing page permissions * target/arm: Check PAGE_WRITE_ORG for MTE writeability * exec: Fix overlap of PAGE_ANON and PAGE_TARGET_1 # gpg: Signature made Mon 12 Apr 2021 11:31:15 BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "[email protected]" # gpg: Good signature from "Peter Maydell <[email protected]>" [ultimate] # gpg: aka "Peter Maydell <[email protected]>" [ultimate] # gpg: aka "Peter Maydell <[email protected]>" [ultimate] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20210412: exec: Fix overlap of PAGE_ANON and PAGE_TARGET_1 target/arm: Check PAGE_WRITE_ORG for MTE writeability accel/tcg: Preserve PAGE_ANON when changing page permissions hw/arm/smmuv3: Emulate CFGI_STE_RANGE for an aligned range of StreamIDs hw/arm/virt-acpi-build: Fix GSIV values of the {GERR, Sync} interrupts Signed-off-by: Peter Maydell <[email protected]>
- Loading branch information
Showing
8 changed files
with
66 additions
and
13 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "mte.h" | ||
|
||
void pass(int sig, siginfo_t *info, void *uc) | ||
{ | ||
assert(info->si_code == SEGV_MTESERR); | ||
exit(0); | ||
} | ||
|
||
int main(void) | ||
{ | ||
enable_mte(PR_MTE_TCF_SYNC); | ||
|
||
void *brk = sbrk(16); | ||
if (brk == (void *)-1) { | ||
perror("sbrk"); | ||
return 2; | ||
} | ||
|
||
if (mprotect(brk, 16, PROT_READ | PROT_WRITE | PROT_MTE)) { | ||
perror("mprotect"); | ||
return 2; | ||
} | ||
|
||
int *p1, *p2; | ||
long excl = 1; | ||
|
||
asm("irg %0,%1,%2" : "=r"(p1) : "r"(brk), "r"(excl)); | ||
asm("gmi %0,%1,%0" : "+r"(excl) : "r"(p1)); | ||
asm("irg %0,%1,%2" : "=r"(p2) : "r"(brk), "r"(excl)); | ||
asm("stg %0,[%0]" : : "r"(p1)); | ||
|
||
*p1 = 0; | ||
|
||
struct sigaction sa; | ||
memset(&sa, 0, sizeof(sa)); | ||
sa.sa_sigaction = pass; | ||
sa.sa_flags = SA_SIGINFO; | ||
sigaction(SIGSEGV, &sa, NULL); | ||
|
||
*p2 = 0; | ||
|
||
abort(); | ||
} |
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