Skip to content

KCFI support in GCC #369

Open
Open

Description

@kees

GCC still needs support for KCFI, most especially for x86_64 and arm64.

Details on the Clang implementation were discussed in the 2022 Linux Plumbers Conference. PDF and video link at the end:
https://lpc.events/event/16/contributions/1315/

Prior draft (though without the needed specific binary output requirements) for arm64:
https://lore.kernel.org/lkml/20230325085416.95191-1-ashimida.1990@gmail.com/

Activity

  1. added
    [Compiler] GCCAn issue in GCC itself needs to be addressed
    [Feature] CFIInvolves Control Flow Integrity
    on Feb 26, 2025
  2. assigned and unassigned on Aug 21, 2025
  3. JustinStitt commented on Oct 20, 2026

    @JustinStitt
    Collaborator

    Keep open In progress

    Note

    Part of an October 2026 triage of every open KSPP issue. The research was AI-assisted (Claude Opus 5.5 investigated; Claude Sonnet searched the mailing lists; Claude Haiku 4.5 summarized), and I reviewed this summary before posting. Kernel state is as of mainline d24e8ac715de (v7.3-rc5+) and next-20261001.

    Status as of 2026-10-01: GCC KCFI support is actively under review (v16 series, 2026-09-02) and ready for GCC 17; the kernel side is prepared; keeping open until the series lands in GCC trunk.

    The issue asks for GCC support for the kernel's KCFI ABI, matching Clang's binary output: the preamble type-hash, the call-site check sequence, and the .kcfi_traps section. Kees Cook's series covers x86_64, AArch64, 32-bit ARM, and RISC-V. The kernel side is already prepared: https://lore.kernel.org/all/20250923213422.1105654-3-kees@kernel.org/ ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") and related cleanups ensure that CONFIG_CFI depends only on the compiler flag, not on CC_IS_CLANG, so GCC 17 kernels will enable it without further kernel changes.

    Evidence

    Mailing list

    Suggested next step

    • A GCC global reviewer or committer should review v16 and push to GCC trunk before stage 1 closes (mid-November 2026)
    • Once merged, close this issue with the GCC commit hash

    Full investigation: https://github.com/KSPP/bug-scrub-archaeology/tree/master/issues/issue-369

  4. added
    keep_openOct 2026 bug scrub: still valid and accurately described
    status_in_progressOct 2026 bug scrub: status: in progress
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Compiler] GCCAn issue in GCC itself needs to be addressed[Feature] CFIInvolves Control Flow Integrity[PATCH] SubmittedA patch has been submitted upstreamkeep_openOct 2026 bug scrub: still valid and accurately describedstatus_in_progressOct 2026 bug scrub: status: in progress

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions