Re: [PATCH] pidfd: add ioctl to retrieve pid info

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

 



On Sat, 5 Oct 2024 at 12:29, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> On 10/04, Luca Boccassi wrote:
> >
> > On Fri, 4 Oct 2024 at 20:30, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > >
> > > I guess Christian meant you should simply use
> > >
> > >                 info.pid = task_pid_vnr(task);
> > >
> > > task_pid_vnr(task) returns the task's pid in the caller's namespace.
> >
> > Ah I see, I didn't realize there was a difference, sent v3 with the
> > suggested change just now, thanks.
>
> I didn't get v3, I guess I wasn't cc'ed again.
>
> So, just in case, let me add that task_pid_vnr(task) can return 0 if
> this task exits after get_pid_task().
>
> Perhaps this is fine, I do not know. But perhaps you should actually
> use pid_vnr(pid).
>
> Oleg.

I have just sent v5 CC'ing you and adding a final check before the
copy to userspace, that returns ESRCH if the task has exited. This
should solve that issue, and also be future-proof against potential
additions that might slow down processing due to gathering more data
or so.




[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