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
  • pid.c
Find file BlameHistoryPermalink
  • Tycho Andersen's avatar
    pidfd: getfd should always report ESRCH if a task is exiting · 0c9bd6bc
    Tycho Andersen authored Feb 07, 2024
    
    
    We can get EBADF from pidfd_getfd() if a task is currently exiting,
    which might be confusing. Let's check PF_EXITING, and just report ESRCH
    if so.
    
    I chose PF_EXITING, because it is set in exit_signals(), which is called
    before exit_files(). Since ->exit_status is mostly set after
    exit_files() in exit_notify(), using that still leaves a window open for
    the race.
    
    Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
    Signed-off-by: default avatarTycho Andersen <tandersen@netflix.com>
    Link: https://lore.kernel.org/r/20240206192357.81942-1-tycho@tycho.pizza
    
    
    Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
    0c9bd6bc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7