diff options
author | Eugene Syromyatnikov <evgsyr@gmail.com> | 2023-04-28 18:24:59 +0200 |
---|---|---|
committer | Eugene Syromyatnikov <evgsyr@gmail.com> | 2023-04-28 18:27:45 +0200 |
commit | 45cae1542f07deb04dc90e4186d3bb7b61a5b516 (patch) | |
tree | d3590d99c2eda48117ac9c93c10f6c9d3fd1a2fa /src/prctl.c | |
parent | 65ecda71587add30414c373f6f3716461aeaaf2c (diff) | |
download | strace-45cae1542f07deb04dc90e4186d3bb7b61a5b516.tar.gz |
prctl: implement PR_[GS]ET_MDWE decodingesyr/prctl-mdwe
Introduced by Linux commit v6.3-rc1~113^2~215.
* src/xlat/pr_mdwe_flags.in: New file.
* src/prctl.c: Include "xlat/pr_mdwe_flags.h".
(SYS_FUNC(prctl)) <case PR_SET_MDWE, case PR_GET_MDWE>: Implement
command decoders.
* tests/.gitignore: Add prctl-mdwe.
* tests/Makefile.am (check_PROGRAMS): Add prctl-mdwe.
* tests/gen_tests.in (prctl-mdwe): New test.
* tests/prctl-mdwe.c: New file.
* NEWS: Mention it.
Diffstat (limited to 'src/prctl.c')
-rw-r--r-- | src/prctl.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/prctl.c b/src/prctl.c index 6c1776522..2396c6bc6 100644 --- a/src/prctl.c +++ b/src/prctl.c @@ -20,6 +20,7 @@ #include "xlat/pr_fp_mode.h" #include "xlat/pr_mce_kill.h" #include "xlat/pr_mce_kill_policy.h" +#include "xlat/pr_mdwe_flags.h" #include "xlat/pr_pac_enabled_keys.h" #include "xlat/pr_pac_keys.h" #include "xlat/pr_sched_core_cmds.h" @@ -360,6 +361,18 @@ SYS_FUNC(prctl) return RVAL_HEX | RVAL_STR; + case PR_GET_MDWE: + if (entering(tcp)) { + print_prctl_args(tcp, 1); + break; + } + if (syserror(tcp)) + return 0; + tcp->auxstr = sprintflags_ex("", pr_mdwe_flags, + (kernel_ulong_t) tcp->u_rval, '\0', + XLAT_STYLE_DEFAULT | SPFF_AUXSTR_MODE); + return RVAL_HEX | RVAL_STR; + /* PR_TASK_PERF_EVENTS_* take no arguments. */ case PR_TASK_PERF_EVENTS_DISABLE: case PR_TASK_PERF_EVENTS_ENABLE: @@ -497,10 +510,15 @@ SYS_FUNC(prctl) printflags(pr_unalign_flags, arg2, "PR_UNALIGN_???"); return RVAL_DECODED; + case PR_SET_MDWE: + tprint_arg_next(); + printflags(pr_mdwe_flags, arg2, "PR_MDWE_???"); + print_prctl_args(tcp, 2); + return RVAL_DECODED; + case PR_SET_NO_NEW_PRIVS: case PR_SET_THP_DISABLE: case PR_SET_IO_FLUSHER: - case PR_SET_MDWE: tprint_arg_next(); PRINT_VAL_U(arg2); print_prctl_args(tcp, 2); @@ -629,7 +647,6 @@ SYS_FUNC(prctl) case PR_MPX_DISABLE_MANAGEMENT: case PR_MPX_ENABLE_MANAGEMENT: case PR_GET_IO_FLUSHER: - case PR_GET_MDWE: default: print_prctl_args(tcp, 1); return RVAL_DECODED; |