Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • scripts
  • Makefile.modfinal
Find file BlameHistoryPermalink
  • Sami Tolvanen's avatar
    kbuild: Disable GCOV for *.mod.o · 25a21fbb
    Sami Tolvanen authored Jun 23, 2023
    With GCOV_PROFILE_ALL, Clang injects __llvm_gcov_* functions to each
    object file, including the *.mod.o. As we filter out CC_FLAGS_CFI
    for *.mod.o, the compiler won't generate type hashes for the
    injected functions, and therefore indirectly calling them during
    module loading trips indirect call checking.
    
    Enabling CFI for *.mod.o isn't sufficient to fix this issue after
    commit 0c3e806e ("x86/cfi: Add boot time hash randomization"),
    as *.mod.o aren't processed by objtool, which means any hashes
    emitted there won't be randomized. Therefore, in addition to
    disabling CFI for *.mod.o, also disable GCOV, as the object files
    don't otherwise contain any executable code.
    
    Fixes: cf68fffb
    
     ("add support for Clang CFI")
    Reported-by: default avatarJoe Fradley <joefradley@google.com>
    Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
    Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: default avatarKees Cook <keescook@chromium.org>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
    25a21fbb
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7