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
You need to sign in or sign up before continuing.
  • linux
  • kernel
  • bpf
  • arraymap.c
Find file BlameHistoryPermalink
  • Alexei Starovoitov's avatar
    bpf: add missing rcu protection when releasing programs from prog_array · abf2e7d6
    Alexei Starovoitov authored May 28, 2015
    Normally the program attachment place (like sockets, qdiscs) takes
    care of rcu protection and calls bpf_prog_put() after a grace period.
    The programs stored inside prog_array may not be attached anywhere,
    so prog_array needs to take care of preserving rcu protection.
    Otherwise bpf_tail_call() will race with bpf_prog_put().
    To solve that introduce bpf_prog_put_rcu() helper function and use
    it in 3 places where unattached program can decrement refcnt:
    closing program fd, deleting/replacing program in prog_array.
    
    Fixes: 04fd61ab
    
     ("bpf: allow bpf programs to tail-call other bpf programs")
    Reported-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    abf2e7d6
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7