You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a tracking issue for the Kernel Control Flow Integrity (KCFI) Support for Rust project.
Steps
The Kernel Control Flow Integrity (KCFI) Support for Rust project shares most of its implementation with the LLVM Control Flow Integrity (CFI) Support for Rust project (see #89653), with some key differences:
KCFI perform type tests differently and are implemented as different LLVM passes than CFI to not require LTO.
KCFI has the limitation that a function or method may have one type id assigned only.
KCFI support for Rust work will be implemented in these steps:
Add support for emitting KCFI type metadata and checks to the Rust compiler code generation (i.e., add support for emitting KCFI operand bundles).
Fixing (or temporarily working around) the limitations listed above in KCFI.
Unresolved Questions
Because of limitation listed above (2), the current KCFI implementation (not CFI) does reifying of types (i.e., adds shims/trampolines for indirect calls in these cases1) for:
Supporting casting between function items, closures, and Fn trait objects
Supporting methods being cast as function pointers.
There may be possible costs of these added levels of indirections for KCFI for cache coherence/locality and performance, possible introduction of gadgets or KCFI bypasses, and increased artifact/binary sizes, which haven't been looked at yet.
Implementation history
These are the most relevant PRs for Kernel Control Flow Integrity (KCFI) Support for Rust project:
This is a tracking issue for the Kernel Control Flow Integrity (KCFI) Support for Rust project.
Steps
The Kernel Control Flow Integrity (KCFI) Support for Rust project shares most of its implementation with the LLVM Control Flow Integrity (CFI) Support for Rust project (see #89653), with some key differences:
KCFI support for Rust work will be implemented in these steps:
Unresolved Questions
Because of limitation listed above (2), the current KCFI implementation (not CFI) does reifying of types (i.e., adds shims/trampolines for indirect calls in these cases1) for:
There may be possible costs of these added levels of indirections for KCFI for cache coherence/locality and performance, possible introduction of gadgets or KCFI bypasses, and increased artifact/binary sizes, which haven't been looked at yet.
Implementation history
These are the most relevant PRs for Kernel Control Flow Integrity (KCFI) Support for Rust project:
Footnotes
It also unnecessarily adds shims/trampolines to indirect calls to methods that are cast into function pointers from traits that are not object safe. ↩