-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Description
Intel CET
Intel CET is a security technology developed to fight memory-corruption based attacks.
Description of the issue
According to guides I was able to find online (intel presentation, annocheck), this feature should be enabled with the compilation flag -fcf-protection
or -fcf-protection=full
.
Trying to compile nodejs (using steps from the docs) with these flags I wasn't able to pass the before mentioned annocheck test for this feature on binary node, even if other binaries such as node_j2c contained the required .note.gnu.property that being SHSTK (Shadow Stack) and IBT (Branch Tracking).
Examples from my testing:
readelf -n node
Displaying notes found in: .note.gnu.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: ceaab14cf7bb408dd175fb713cb50a75f0ab11f0
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000030 NT_GNU_PROPERTY_TYPE_0
Properties: x86 ISA needed: x86-64-baseline
x86 feature used: x86, XMM, YMM, ZMM, XSAVE, MASK
x86 ISA used: x86-64-baseline, x86-64-v2, x86-64-v3, x86-64-v4
readelf -n node_js2c
Displaying notes found in: .note.gnu.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: c90bacc1964b4cf0b281541f93427a6c0080a219
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000040 NT_GNU_PROPERTY_TYPE_0
Properties: x86 feature: IBT, SHSTK
x86 ISA needed: x86-64-baseline
x86 feature used: x86, XMM, YMM, ZMM, XSAVE, MASK
x86 ISA used: x86-64-baseline, x86-64-v2, x86-64-v3, x86-64-v4
Desired state
I think it would be beneficial to enable this feature.
I sadly struggle to understand what could be the issue, or how could it be fixed. My guess is that it could be connected to this description from the annocheck page:
The feature is also an all-or-nothing type proposition for any process. Either all of the code in the process must have been built to support CET - in which case the feature can be enabled - or if even a single component does not support CET then it must be disabled for the entire process.
If anyone could provide any guidance or information about the issue I would really appreciate it.