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
  • bpf
  • devmap.c
Find file BlameHistoryPermalink
  • Toke Høiland-Jørgensen's avatar
    xdp: Fix race in dev_map_hash_update_elem() when replacing element · af58e7ee
    Toke Høiland-Jørgensen authored Sep 08, 2019
    syzbot found a crash in dev_map_hash_update_elem(), when replacing an
    element with a new one. Jesper correctly identified the cause of the crash
    as a race condition between the initial lookup in the map (which is done
    before taking the lock), and the removal of the old element.
    
    Rather than just add a second lookup into the hashmap after taking the
    lock, fix this by reworking the function logic to take the lock before the
    initial lookup.
    
    Fixes: 6f9d451a
    
     ("xdp: Add devmap_hash map type for looking up devices by hashed index")
    Reported-and-tested-by: default avatar <syzbot+4e7a85b1432052e8d6f8@syzkaller.appspotmail.com>
    Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
    Acked-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    af58e7ee
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7