Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • linux-vf linux-vf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-vflinux-vf
  • Repository
Switch branch/tag
  • linux-vf
  • arch
  • x86
  • boot
  • compressed
  • misc.h
Find file BlameHistoryPermalink
  • Baoquan He's avatar
    x86/boot/KASLR: Fix kexec crash due to 'virt_addr' calculation bug · 8eabf42a
    Baoquan He authored Jun 27, 2017
    
    
    Kernel text KASLR is separated into physical address and virtual
    address randomization. And for virtual address randomization, we
    only randomiza to get an offset between 16M and KERNEL_IMAGE_SIZE.
    So the initial value of 'virt_addr' should be LOAD_PHYSICAL_ADDR,
    but not the original kernel loading address 'output'.
    
    The bug will cause kernel boot failure if kernel is loaded at a different
    position than the address, 16M, which is decided at compiled time.
    Kexec/kdump is such practical case.
    
    To fix it, just assign LOAD_PHYSICAL_ADDR to virt_addr as initial
    value.
    
    Tested-by: default avatarDave Young <dyoung@redhat.com>
    Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Fixes: 8391c73c ("x86/KASLR: Randomize virtual address separately")
    Link: http://lkml.kernel.org/r/1498567146-11990-3-git-send-email-bhe@redhat.com
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
    8eabf42a