Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 6604db8

Browse files
Brian Inglisgithub-cygwin
authored andcommitted
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: 41fdb86 ("fhandler/proc.cc(format_proc_cpuinfo): Add Linux 6.3 cpuinfo") Signed-off-by: Brian Inglis <[email protected]>
1 parent 1c4a009 commit 6604db8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

winsup/cygwin/fhandler/proc.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,12 +1486,12 @@ format_proc_cpuinfo (void *, char *&destbuf)
14861486

14871487
/* ftcprint (features1, 6, "split_lock_detect");*//* MSR_TEST_CTRL split lock */
14881488

1489-
/* cpuid 0x00000007 ecx & Windows [20]20H1/[20]2004+ */
1490-
if (maxf >= 0x00000007 && wincap.osname () >= "10.0"
1491-
&& wincap.build_number () >= 19041)
1489+
/* Windows [20]20H1/[20]2004/19041 user shadow stack */
1490+
if (maxf >= 0x00000007 && wincap.has_user_shstk ())
14921491
{
1492+
/* cpuid 0x00000007 ecx CET shadow stack */
14931493
cpuid (&unused, &unused, &features1, &unused, 0x00000007, 0);
1494-
ftcprint (features1, 7, "user_shstk"); /* "user shadow stack" */
1494+
ftcprint (features1, 7, "user_shstk"); /* user shadow stack */
14951495
}
14961496

14971497
/* cpuid 0x00000007:1 eax */

0 commit comments

Comments
 (0)