From 0b8f3abe299b50e2453c0df4820936a67d6b6b8b Mon Sep 17 00:00:00 2001 From: Pengfei Xu Date: Wed, 3 Jan 2024 10:56:52 +0800 Subject: [PATCH] xsave/cet: add author at the head of code file Signed-off-by: Pengfei Xu --- cet/.gitignore | 1 + cet/cet_driver/cet_app.c | 2 ++ cet/cet_driver/cet_ioctl.c | 2 ++ cet/cet_tests.sh | 1 + cet/glibc_shstk_test.c | 3 +++ cet/shstk_alloc.c | 2 ++ cet/shstk_cp.c | 3 +++ cet/shstk_huge_page.c | 7 ++++++- cet/shstk_unlock_test.c | 3 +++ cet/wrss.c | 2 ++ tools/cpuid_check/.gitignore | 1 + tools/cpuid_check/cpuid_check.c | 6 ++++++ xsave/xstate.c | 2 ++ xsave/xstate_helpers.c | 2 ++ 14 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 tools/cpuid_check/.gitignore diff --git a/cet/.gitignore b/cet/.gitignore index e9aeb735..2d44e090 100644 --- a/cet/.gitignore +++ b/cet/.gitignore @@ -1,4 +1,5 @@ cet_app +glibc_shstk_test glibc_supported_shstk_test quick_test shstk_alloc diff --git a/cet/cet_driver/cet_app.c b/cet/cet_driver/cet_app.c index ab18174a..1be0ee7d 100644 --- a/cet/cet_driver/cet_app.c +++ b/cet/cet_driver/cet_app.c @@ -4,6 +4,8 @@ /* * cet_app.c * + * Author: Pengfei Xu + * * This file will test cet driver with parameters * - Test CET driver app */ diff --git a/cet/cet_driver/cet_ioctl.c b/cet/cet_driver/cet_ioctl.c index fb8badba..a6fa3721 100644 --- a/cet/cet_driver/cet_ioctl.c +++ b/cet/cet_driver/cet_ioctl.c @@ -4,6 +4,8 @@ /* * cet_ioctl.c * + * Author: Pengfei Xu + * * This file simulated stack changed by hack, CET should block hack func * - For cet hack simulation driver */ diff --git a/cet/cet_tests.sh b/cet/cet_tests.sh index fe747570..b5533efe 100755 --- a/cet/cet_tests.sh +++ b/cet/cet_tests.sh @@ -1,6 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0-only # Copyright (c) 2022 Intel Corporation +# Author: Pengfei Xu # @Desc Test script to verify Intel CET functionality cd "$(dirname "$0")" 2>/dev/null && source ../.env diff --git a/cet/glibc_shstk_test.c b/cet/glibc_shstk_test.c index 0d2495d1..75760561 100644 --- a/cet/glibc_shstk_test.c +++ b/cet/glibc_shstk_test.c @@ -2,6 +2,9 @@ // Copyright (c) 2022 Intel Corporation. /* * glibc_shstk_test.c: + * + * Author: Pengfei Xu + * * - 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 diff --git a/cet/shstk_alloc.c b/cet/shstk_alloc.c index 510bdd20..8ccb335d 100644 --- a/cet/shstk_alloc.c +++ b/cet/shstk_alloc.c @@ -2,6 +2,8 @@ /* * shstk_alloc.c - allocate a new shadow stack buffer aligenment by instructions * + * Author: Pengfei Xu + * * 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 diff --git a/cet/shstk_cp.c b/cet/shstk_cp.c index 02b8d39b..a9f00ea3 100644 --- a/cet/shstk_cp.c +++ b/cet/shstk_cp.c @@ -4,6 +4,9 @@ /* * shstk_cp.c: enable shstk and then do shstk violation * expected #CP should be triggered + * + * Author: Pengfei Xu + * */ #include diff --git a/cet/shstk_huge_page.c b/cet/shstk_huge_page.c index 8c2822bd..1a5bb3bd 100644 --- a/cet/shstk_huge_page.c +++ b/cet/shstk_huge_page.c @@ -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 + * + */ #include #include diff --git a/cet/shstk_unlock_test.c b/cet/shstk_unlock_test.c index 9c035606..8b74388e 100644 --- a/cet/shstk_unlock_test.c +++ b/cet/shstk_unlock_test.c @@ -2,6 +2,9 @@ // Copyright (c) 2022 Intel Corporation. /* + * + * Author: Pengfei Xu + * * shstk_unlock_test.c: unlock child process shstk by ptrace and then tests * get/set shstk regsets and shstk status syscalls */ diff --git a/cet/wrss.c b/cet/wrss.c index 71e91192..906ce037 100644 --- a/cet/wrss.c +++ b/cet/wrss.c @@ -4,6 +4,8 @@ /* * wrss.c: enable writable shadow stack and write value into shadow stack. * + * Author: Pengfei Xu + * * 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 diff --git a/tools/cpuid_check/.gitignore b/tools/cpuid_check/.gitignore new file mode 100644 index 00000000..bb33efbb --- /dev/null +++ b/tools/cpuid_check/.gitignore @@ -0,0 +1 @@ +cpuid_check diff --git a/tools/cpuid_check/cpuid_check.c b/tools/cpuid_check/cpuid_check.c index 2af06a2b..e87f8226 100644 --- a/tools/cpuid_check/cpuid_check.c +++ b/tools/cpuid_check/cpuid_check.c @@ -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 + * + */ #include #include diff --git a/xsave/xstate.c b/xsave/xstate.c index 8da301cc..ef304e09 100644 --- a/xsave/xstate.c +++ b/xsave/xstate.c @@ -4,6 +4,8 @@ /* * xstate.c - tests XSAVE feature with fork and signal handling. * + * Author: Pengfei Xu + * * 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: diff --git a/xsave/xstate_helpers.c b/xsave/xstate_helpers.c index 36862a25..2a0b6007 100644 --- a/xsave/xstate_helpers.c +++ b/xsave/xstate_helpers.c @@ -4,6 +4,8 @@ /* * xstate_helpers.c - xstate helpers to prevent GCC from generating any FP code. * + * Author: Pengfei Xu + * * 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.