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
  • include
  • linux
  • string.h
Find file BlameHistoryPermalink
  • Daniel Micay's avatar
    replace incorrect strscpy use in FORTIFY_SOURCE · 077d2ba5
    Daniel Micay authored Jul 14, 2017
    
    
    Using strscpy was wrong because FORTIFY_SOURCE is passing the maximum
    possible size of the outermost object, but strscpy defines the count
    parameter as the exact buffer size, so this could copy past the end of
    the source.  This would still be wrong with the planned usage of
    __builtin_object_size(p, 1) for intra-object overflow checks since it's
    the maximum possible size of the specified object with no guarantee of
    it being that large.
    
    Reuse of the fortified functions like this currently makes the runtime
    error reporting less precise but that can be improved later on.
    
    Noticed by Dave Jones and KASAN.
    
    Signed-off-by: default avatarDaniel Micay <danielmicay@gmail.com>
    Acked-by: default avatarKees Cook <keescook@chromium.org>
    Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    077d2ba5
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7