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
  • kernel
  • sys.c
Find file BlameHistoryPermalink
  • Cyrill Gorcunov's avatar
    kernel/sys.c: prctl: fix false positive in validate_prctl_map() · c50c4fb0
    Cyrill Gorcunov authored May 13, 2019
    [ Upstream commit a9e73998 ]
    
    While validating new map we require the @start_data to be strictly less
    than @end_data, which is fine for regular applications (this is why this
    nit didn't trigger for that long).  These members are set from executable
    loaders such as elf handers, still it is pretty valid to have a loadable
    data section with zero size in file, in such case the start_data is equal
    to end_data once kernel loader finishes.
    
    As a result when we're trying to restore such programs the procedure fails
    and the kernel returns -EINVAL.  From the image dump of a program:
    
     | "mm_start_code": "0x400000",
     | "mm_end_code": "0x8f5fb4",
     | "mm_start_data": "0xf1bfb0",
     | "mm_end_data": "0xf1bfb0",
    
    Thus we need to change validate_prctl_map from strictly less to less or
    equal operator use.
    
    Link: http://lkml.kernel.org/r/20190408143554.GY1421@uranus.lan
    Fixes: f606b77f
    
     ("prctl: PR_SET_MM -- introduce PR_SET_MM_MAP operation")
    Signed-off-by: default avatarCyrill Gorcunov <gorcunov@gmail.com>
    Cc: Andrey Vagin <avagin@gmail.com>
    Cc: Dmitry Safonov <0x7f454c46@gmail.com>
    Cc: Pavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    c50c4fb0
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7