* Add CET module
Reports CET settings if supported on the platform
```
[*] Running module: chipsec.modules.common.cet
[x][ =======================================================================
[x][ Module: Checking CET Settings
[x][ =======================================================================
CET Shadow Stack is supported
CET Indirect Branch Tracking is unsupported
IA32_U_CET Settings:
SH_STK_EN: Enable shadow stacks at CPL3 is NOT ENABLED
WR_SHSTK_EN: Enables the WRSSD/WRSSQ instructions is NOT ENABLED
ENDBR_EN: Enable indirect branch tracking is NOT ENABLED
LEG_IW_EN: Enable legacy compatibility treatment for indirect branch tracking is NOT ENABLED
NO_TRACK_EN: Enables use of no track prefix for indirect branch tracking is NOT ENABLED
SUPPRESS_DIS: Disables suppression of CET indirect branch tracking on legacy compatibility is NOT ENABLED
SUPPRESS: Indirect branch tracking is suppressed is NOT ENABLED
IA32_S_CET Settings:
SH_STK_EN: Enable shadow stacks at CPL3 is NOT ENABLED
WR_SHSTK_EN: Enables the WRSSD/WRSSQ instructions is NOT ENABLED
ENDBR_EN: Enable indirect branch tracking is NOT ENABLED
LEG_IW_EN: Enable legacy compatibility treatment for indirect branch tracking is NOT ENABLED
NO_TRACK_EN: Enables use of no track prefix for indirect branch tracking is NOT ENABLED
SUPPRESS_DIS: Disables suppression of CET indirect branch tracking on legacy compatibility is NOT ENABLED
SUPPRESS: Indirect branch tracking is suppressed is NOT ENABLED```
Signed-off-by: brentholtsclaw <brent.holtsclaw@intel.com>
`print_buffer_bytes` can directly handle bytes, instead of converting
them to a string.
While at it, replace buggy calls to `print_buffer(buffer)` (when
`buffer` uses type `bytes`) with `print_buffer_bytes(buffer)`.
This fixes `./chipsec_util.py idt 0`. Before it failed with:
[CHIPSEC] Dumping IDT of 8 CPU threads
[cpu0] Physical Address: 0x000000036639E000
[cpu0] # of entries : 256
[cpu0] Contents (4 entries):
Traceback (most recent call last):
File "./chipsec_util.py", line 210, in <module>
sys.exit(main())
File "./chipsec_util.py", line 205, in main
return chipsecMain.main()
File "./chipsec_util.py", line 190, in main
comm.run()
File "chipsec/utilcmd/desc_cmd.py", line 84, in run
self.cs.msr.IDT_all(4)
File "chipsec/hal/msr.py", line 166, in IDT_all
self.IDT(tid, num_entries)
File "chipsec/hal/msr.py", line 158, in IDT
return self.dump_Descriptor_Table(cpu_thread_id, DESCRIPTOR_TABLE_CODE_IDTR, num_entries)
File "chipsec/hal/msr.py", line 144, in dump_Descriptor_Table
print_buffer(dt)
File "chipsec/logger.py", line 493, in print_buffer
prt_str = bytes2string(arr, length)
File "chipsec/logger.py", line 466, in bytes2string
num_string += [f'{ord(c):02X} ']
TypeError: ord() expected string of length 1, but int found
There was another bug in `hal/msr.py` where `ord(dt[...])` was used
instead of `dt`.
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>