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
  • arch
  • x86
  • kernel
  • cpu
  • microcode
  • intel.c
Find file BlameHistoryPermalink
  • Jann Horn's avatar
    x86/microcode/intel: Refactor Intel microcode blob loading · 7e94a7b6
    Jann Horn authored Apr 04, 2019
    
    
    Change generic_load_microcode() to use the iov_iter API instead of a
    clumsy open-coded version which has to pay attention to __user data
    or kernel data, depending on the loading method. This allows to avoid
    explicit casting between user and kernel pointers.
    
    Because the iov_iter API makes it hard to read the same location twice,
    as a side effect, also fix a double-read of the microcode header (which
    could e.g. lead to out-of-bounds reads in microcode_sanity_check()).
    
    Not that it matters much, only root is allowed to load microcode
    anyway...
    
     [ bp: Massage a bit, sort function-local variables. ]
    
    Signed-off-by: default avatarJann Horn <jannh@google.com>
    Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
    Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: x86-ml <x86@kernel.org>
    Link: https://lkml.kernel.org/r/20190404111128.131157-1-jannh@google.com
    7e94a7b6
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7