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
  • mod
  • modpost.c
Find file BlameHistoryPermalink
  • Omar Sandoval's avatar
    x86/unwind/orc: Add ELF section with ORC version identifier · b9f174c8
    Omar Sandoval authored Jun 13, 2023
    Commits ffb1b4a4 ("x86/unwind/orc: Add 'signal' field to ORC
    metadata") and fb799447 ("x86,objtool: Split UNWIND_HINT_EMPTY in
    two") changed the ORC format. Although ORC is internal to the kernel,
    it's the only way for external tools to get reliable kernel stack traces
    on x86-64. In particular, the drgn debugger [1] uses ORC for stack
    unwinding, and these format changes broke it [2]. As the drgn
    maintainer, I don't care how often or how much the kernel changes the
    ORC format as long as I have a way to detect the change.
    
    It suffices to store a version identifier in the vmlinux and kernel
    module ELF files (to use when parsing ORC sections from ELF), and in
    kernel memory (to use when parsing ORC from a core dump+symbol table).
    Rather than hard-coding a version number that needs to be manually
    bumped, Peterz suggested hashing the definitions from orc_types.h. If
    there is a format change that isn't caught by this, the hashing script
    can be updated.
    
    This patch adds an .orc_header allocated ELF section containing the
    20-byte hash to vmlinux and kernel modules, along with the corresponding
    __start_orc_header and __stop_orc_header symbols in vmlinux.
    
    1: https://github.com/osandov/drgn
    2: https://github.com/osandov/drgn/issues/303
    
    Fixes: ffb1b4a4 ("x86/unwind/orc: Add 'signal' field to ORC metadata")
    Fixes: fb799447
    
     ("x86,objtool: Split UNWIND_HINT_EMPTY in two")
    Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
    Link: https://lkml.kernel.org/r/aef9c8dc43915b886a8c48509a12ec1b006ca1ca.1686690801.git.osandov@osandov.com
    b9f174c8
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7