fhandler/proc.cc: use wincap.has_user_shstk

In test for AMD/Intel Control flow Enforcement Technology user mode
shadow stack support replace Windows version tests with test of wincap
member addition has_user_shstk with Windows version dependent value

Fixes: 41fdb869f9 ("fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo")
Signed-off-by: Brian Inglis <Brian.Inglis@Shaw.ca>
This commit is contained in:
Brian Inglis 2023-06-19 12:15:19 -06:00 committed by Corinna Vinschen
parent 1c4a00962f
commit 6604db8b80
1 changed files with 4 additions and 4 deletions

View File

@ -1486,12 +1486,12 @@ format_proc_cpuinfo (void *, char *&destbuf)
/* ftcprint (features1, 6, "split_lock_detect");*//* MSR_TEST_CTRL split lock */
/* cpuid 0x00000007 ecx & Windows [20]20H1/[20]2004+ */
if (maxf >= 0x00000007 && wincap.osname () >= "10.0"
&& wincap.build_number () >= 19041)
/* Windows [20]20H1/[20]2004/19041 user shadow stack */
if (maxf >= 0x00000007 && wincap.has_user_shstk ())
{
/* cpuid 0x00000007 ecx CET shadow stack */
cpuid (&unused, &unused, &features1, &unused, 0x00000007, 0);
ftcprint (features1, 7, "user_shstk"); /* "user shadow stack" */
ftcprint (features1, 7, "user_shstk"); /* user shadow stack */
}
/* cpuid 0x00000007:1 eax */