Re: [PATCH v3 1/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev

From: Mike Rapoport

Date: Wed Apr 29 2026 - 02:42:14 EST


On Tue, Apr 28, 2026 at 10:05:49PM +0200, David Hildenbrand (Arm) wrote:
> On 4/28/26 14:28, Alban Crequy wrote:
> > From: Alban Crequy <albancrequy@xxxxxxxxxxxxx>
> > @@ -194,10 +202,18 @@ static ssize_t process_vm_rw_core(pid_t pid, struct iov_iter *iter,
> > }
> >
> > /* Get process information */
> > - task = find_get_task_by_vpid(pid);
> > - if (!task) {
> > - rc = -ESRCH;
> > - goto free_proc_pages;
> > + if (flags & PROCESS_VM_PIDFD) {
> > + task = pidfd_get_task(pid, &f_flags);
> > + if (IS_ERR(task)) {
> > + rc = PTR_ERR(task);
>
> This could return -EBADF or -ESRCH. We should document both in the man page. (or
> decide to always return -ESRCH, dunno)

I'm for documenting both in the man page to let userpsace see what went
wrong.

> --
> Cheers,
> David

--
Sincerely yours,
Mike.