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
  • taskstats.c
Find file BlameHistoryPermalink
  • WANG Cong's avatar
    taskstats: fix the length of cgroupstats_cmd_get_policy · 243d5212
    WANG Cong authored Nov 03, 2016
    
    
    cgroupstats_cmd_get_policy is [CGROUPSTATS_CMD_ATTR_MAX+1],
    taskstats_cmd_get_policy[TASKSTATS_CMD_ATTR_MAX+1],
    but their family.maxattr is TASKSTATS_CMD_ATTR_MAX.
    CGROUPSTATS_CMD_ATTR_MAX is less than TASKSTATS_CMD_ATTR_MAX,
    so we could end up accessing out-of-bound.
    
    Change cgroupstats_cmd_get_policy to TASKSTATS_CMD_ATTR_MAX+1,
    this is safe because the rest are initialized to 0's.
    
    Reported-by: default avatarAndrey Konovalov <andreyknvl@google.com>
    Tested-by: default avatarAndrey Konovalov <andreyknvl@google.com>
    Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    243d5212
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7