-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xsave/cet: add author at the head of code file
Signed-off-by: Pengfei Xu <[email protected]>
- Loading branch information
Showing
14 changed files
with
36 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
cet_app | ||
glibc_shstk_test | ||
glibc_supported_shstk_test | ||
quick_test | ||
shstk_alloc | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
/* | ||
* cet_app.c | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* This file will test cet driver with parameters | ||
* - Test CET driver app | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
/* | ||
* cet_ioctl.c | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* This file simulated stack changed by hack, CET should block hack func | ||
* - For cet hack simulation driver | ||
*/ | ||
|
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/bin/bash | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (c) 2022 Intel Corporation | ||
# Author: Pengfei Xu <[email protected]> | ||
# @Desc Test script to verify Intel CET functionality | ||
|
||
cd "$(dirname "$0")" 2>/dev/null && source ../.env | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
// Copyright (c) 2022 Intel Corporation. | ||
/* | ||
* glibc_shstk_test.c: | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* - Test CET shadow stack function, should trigger #CP protection. | ||
* - Some stack changes that don't affect sp should not trigger #CP. | ||
* - Add more print to show stack address and content before and after | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
/* | ||
* shstk_alloc.c - allocate a new shadow stack buffer aligenment by instructions | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* 1. Test shstk buffer allocation for one new shstk buffer | ||
* 2. Test rstorssp, saveprevssp, rdsspq to load new shstk buffer | ||
* 3. Test rstorssp, saveprevssp to restore the previous shstk buffer | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
/* | ||
* shstk_cp.c: enable shstk and then do shstk violation | ||
* expected #CP should be triggered | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
*/ | ||
|
||
#include <sys/syscall.h> | ||
|
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// Copyright (c) 2022 Intel Corporation. | ||
|
||
/* shstk_huge_page.c - allocate a 4M shadow stack buffer and works well. */ | ||
/* | ||
* shstk_huge_page.c - allocate a 4M shadow stack buffer and works well. | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
// Copyright (c) 2022 Intel Corporation. | ||
|
||
/* | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* shstk_unlock_test.c: unlock child process shstk by ptrace and then tests | ||
* get/set shstk regsets and shstk status syscalls | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
/* | ||
* wrss.c: enable writable shadow stack and write value into shadow stack. | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* 1. Enable writable shadow stack via syscall "ARCH_CET_ENABLE and ARCH_SHSTK_WRSS" | ||
* 2. Write one incorrect value into shadow stack | ||
* 3. The expected SISEGV should be received after ret instruction | ||
|
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 @@ | ||
cpuid_check |
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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
// Copyright (c) 2022 Intel Corporation. | ||
/* | ||
* cpuid_check.c: one CPU ID check tool for script usage | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
/* | ||
* xstate.c - tests XSAVE feature with fork and signal handling. | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* The XSAVE feature set supports the saving and restoring of state components. | ||
* It tests "FP, SSE(XMM), AVX2(YMM), AVX512_OPMASK/AVX512_ZMM_Hi256/ | ||
* AVX512_Hi16_ZMM and PKRU parts" xstates with the following cases: | ||
|
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
/* | ||
* xstate_helpers.c - xstate helpers to prevent GCC from generating any FP code. | ||
* | ||
* Author: Pengfei Xu <[email protected]> | ||
* | ||
* Because xstate like XMM will not be preserved across function calls, it uses | ||
* assembly instruction to call a system call of fork or raise signal, and uses | ||
* the "inline" keyword in test functions in this file. | ||
|