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
  • Petr Pavlu's avatar
    ring-buffer: Fix reader locking when changing the sub buffer order · 09661f75
    Petr Pavlu authored Oct 15, 2024
    The function ring_buffer_subbuf_order_set() updates each
    ring_buffer_per_cpu and installs new sub buffers that match the requested
    page order. This operation may be invoked concurrently with readers that
    rely on some of the modified data, such as the head bit (RB_PAGE_HEAD), or
    the ring_buffer_per_cpu.pages and reader_page pointers. However, no
    exclusive access is acquired by ring_buffer_subbuf_order_set(). Modifying
    the mentioned data while a reader also operates on them can then result in
    incorrect memory access and various crashes.
    
    Fix the problem by taking the reader_lock when updating a specific
    ring_buffer_per_cpu in ring_buffer_subbuf_order_set().
    
    Link: https://lore.kernel.org/linux-trace-kernel/20240715145141.5528-1-petr.pavlu@suse.com/
    Link: https://lore.kernel.org/linux-trace-kernel/20241010195849.2f77cc3f@gandalf.local.home/
    Link: https://lore.kernel.org/linux-trace-kernel/20241011112850.17212b25@gandalf.local.home/
    
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Link: https://lore.kernel.org/20241015112440.26987-1-petr.pavlu@suse.com
    Fixes: 8e7b58c2
    
     ("ring-buffer: Just update the subbuffers when changing their allocation order")
    Signed-off-by: default avatarPetr Pavlu <petr.pavlu@suse.com>
    Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    09661f75
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7