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
  • drivers
  • android
  • binder_alloc.c
Find file BlameHistoryPermalink
  • Jann Horn's avatar
    binder: Handle start==NULL in binder_update_page_range() · 2a9edd05
    Jann Horn authored Oct 18, 2019
    The old loop wouldn't stop when reaching `start` if `start==NULL`, instead
    continuing backwards to index -1 and crashing.
    
    Luckily you need to be highly privileged to map things at NULL, so it's not
    a big problem.
    
    Fix it by adjusting the loop so that the loop variable is always in bounds.
    
    This patch is deliberately minimal to simplify backporting, but IMO this
    function could use a refactor. The jump labels in the second loop body are
    horrible (the error gotos should be jumping to free_range instead), and
    both loops would look nicer if they just iterated upwards through indices.
    And the up_read()+mmput() shouldn't be duplicated like that.
    
    Cc: stable@vger.kernel.org
    Fixes: 457b9a6f
    
     ("Staging: android: add binder driver")
    Signed-off-by: default avatarJann Horn <jannh@google.com>
    Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
    Link: https://lore.kernel.org/r/20191018205631.248274-3-jannh@google.com
    
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    2a9edd05
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7