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
  • trace
  • ring_buffer.c
Find file BlameHistoryPermalink
  • Steven Rostedt (VMware)'s avatar
    ring-buffer: Mask out the info bits when returning buffer page length · 86aa63ac
    Steven Rostedt (VMware) authored Dec 22, 2017
    BugLink: http://bugs.launchpad.net/bugs/1745069
    
    commit 45d8b80c upstream.
    
    Two info bits were added to the "commit" part of the ring buffer data page
    when returned to be consumed. This was to inform the user space readers that
    events have been missed, and that the count may be stored at the end of the
    page.
    
    What wasn't handled, was the splice code that actually called a function to
    return the length of the data in order to zero out the rest of the page
    before sending it up to user space. These data bits were returned with the
    length making the value negative, and that negative value was not checked.
    It was compared to PAGE_SIZE, and only used if the size was less than
    PAGE_SIZE. Luckily PAGE_SIZE is unsigned long which made the compare an
    unsigned compare, meaning the negative size value did not end up causing a
    large portion of memory to be randomly zeroed out.
    
    Fixes: 66a8cb95
    
     ("ring-buffer: Add place holder recording of dropped events")
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
    Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
    86aa63ac
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7