Skip to content

Commit

Permalink
xsave/cet: add author at the head of code file
Browse files Browse the repository at this point in the history
Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe authored and ysun committed Jan 3, 2024
1 parent 6923c9d commit 0b8f3ab
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions cet/.gitignore
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
Expand Down
2 changes: 2 additions & 0 deletions cet/cet_driver/cet_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
/*
* cet_app.c
*
* Author: Pengfei Xu <[email protected]>
*
* This file will test cet driver with parameters
* - Test CET driver app
*/
Expand Down
2 changes: 2 additions & 0 deletions cet/cet_driver/cet_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions cet/cet_tests.sh
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
Expand Down
3 changes: 3 additions & 0 deletions cet/glibc_shstk_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cet/shstk_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions cet/shstk_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion cet/shstk_huge_page.c
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>
Expand Down
3 changes: 3 additions & 0 deletions cet/shstk_unlock_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 2 additions & 0 deletions cet/wrss.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tools/cpuid_check/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cpuid_check
6 changes: 6 additions & 0 deletions tools/cpuid_check/cpuid_check.c
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>
Expand Down
2 changes: 2 additions & 0 deletions xsave/xstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions xsave/xstate_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0b8f3ab

Please sign in to comment.