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
You need to sign in or sign up before continuing.
  • linux
  • arch
  • arm
  • include
  • asm
  • elf.h
Find file BlameHistoryPermalink
  • Andrey Ryabinin's avatar
    ARM: 8320/1: fix integer overflow in ELF_ET_DYN_BASE · 4dcafe78
    Andrey Ryabinin authored Mar 20, 2015
    commit 8defb336 upstream.
    
    Usually ELF_ET_DYN_BASE is 2/3 of TASK_SIZE. With 3G/1G user/kernel
    split this is not so, because 2*TASK_SIZE overflows 32 bits,
    so the actual value of ELF_ET_DYN_BASE is:
    	(2 * TASK_SIZE / 3) = 0x2a000000
    
    When ASLR is disabled PIE binaries will load at ELF_ET_DYN_BASE address.
    On 32bit platforms AddressSanitzer uses addresses [0x20000000 - 0x40000000]
    for shadow memory [1]. So ASan doesn't work for PIE binaries when ASLR disabled
    as it fails to map shadow memory.
    Also after Kees's 'split ET_DYN ASLR from mmap ASLR' patchset PIE binaries
    has a high chance of loading somewhere in between [0x2a000000 - 0x40000000]
    even if ASLR enabled. This makes ASan with PIE absolutely incompatible.
    
    Fix overflow by dividing TASK_SIZE prior to multiplying.
    After this patch ELF_ET_DYN_BASE equals to (for CONFIG_VMSPLIT_3G=y):
    	(TASK_SIZE / 3 * 2) = 0x7f555554
    
    [1] https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Mapping
    
    
    
    Signed-off-by: default avatarAndrey Ryabinin <a.ryabinin@samsung.com>
    Reported-by: default avatarMaria Guseva <m.guseva@samsung.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4dcafe78
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7