Re: [PATCH v2] pidfs: ensure that PIDFS_INFO_EXIT is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/19, Christian Brauner wrote:
>
> On Tue, Mar 18, 2025 at 03:46:54PM +0100, Oleg Nesterov wrote:
> >
> > Why pidfs_pid_valid() can't simply return false if !pid_has_task(pid,type) ?
> >
> > pidfd_open() paths check pid_has_task() too and fail if it returns NULL.
> > If this task is already reaped when pidfs_pid_valid() is called, we can
> > pretend it was reaped before sys_pidfd_open() was called?
>
> We could for sure but why would we. If we know that exit information is
> available then returning a pidfd can still be valuable for userspace as
> they can retrieve exit information via PIDFD_INFO_EXIT and it really
> doesn't hurt to do this.

OK, agreed. I thought I missed another subtle reason.

Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux