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
  • ptr_ring.h
Find file BlameHistoryPermalink
  • Michael S. Tsirkin's avatar
    ptr_ring: add barriers · a8ceb5db
    Michael S. Tsirkin authored Dec 05, 2017
    
    
    Users of ptr_ring expect that it's safe to give the
    data structure a pointer and have it be available
    to consumers, but that actually requires an smb_wmb
    or a stronger barrier.
    
    In absence of such barriers and on architectures that reorder writes,
    consumer might read an un=initialized value from an skb pointer stored
    in the skb array.  This was observed causing crashes.
    
    To fix, add memory barriers.  The barrier we use is a wmb, the
    assumption being that producers do not need to read the value so we do
    not need to order these reads.
    
    Reported-by: default avatarGeorge Cherian <george.cherian@cavium.com>
    Suggested-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a8ceb5db
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7