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
  • kernel
  • sysctl.c
Find file BlameHistoryPermalink
  • Kees Cook's avatar
    sysctl: refactor sysctl string writing logic · 2ca9bb45
    Kees Cook authored Jun 06, 2014
    
    
    Consolidate buffer length checking with new-line/end-of-line checking.
    Additionally, instead of reading user memory twice, just do the
    assignment during the loop.
    
    This change doesn't affect the potential races here.  It was already
    possible to read a sysctl that was in the middle of a write.  In both
    cases, the string will always be NULL terminated.  The pre-existing race
    remains a problem to be solved.
    
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Cc: Randy Dunlap <rdunlap@infradead.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    2ca9bb45
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7