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
  • reuseport_array.c
Find file BlameHistoryPermalink
  • Martin KaFai Lau's avatar
    bpf: net: Avoid copying sk_user_data of reuseport_array during sk_clone · f3dda7a6
    Martin KaFai Lau authored Jul 08, 2020
    It makes little sense for copying sk_user_data of reuseport_array during
    sk_clone_lock().  This patch reuses the SK_USER_DATA_NOCOPY bit introduced in
    commit f1ff5ce2 ("net, sk_msg: Clear sk_user_data pointer on clone if tagged").
    It is used to mark the sk_user_data is not supposed to be copied to its clone.
    
    Although the cloned sk's sk_user_data will not be used/freed in
    bpf_sk_reuseport_detach(), this change can still allow the cloned
    sk's sk_user_data to be used by some other means.
    
    Freeing the reuseport_array's sk_user_data does not require a rcu grace
    period.  Thus, the existing rcu_assign_sk_user_data_nocopy() is not
    used.
    
    Fixes: 5dc4c4b7
    
     ("bpf: Introduce BPF_MAP_TYPE_REUSEPORT_SOCKARRAY")
    Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
    Link: https://lore.kernel.org/bpf/20200709061104.4018798-1-kafai@fb.com
    f3dda7a6
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7