lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Aug 2017 09:08:17 +0300
From:   Mike Rapoport <rppt@...ux.vnet.ibm.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-mm <linux-mm@...ck.org>, lkml <linux-kernel@...r.kernel.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        "Dr. David Alan Gilbert" <dgilbert@...hat.com>,
        Pavel Emelyanov <xemul@...tuozzo.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH] userfaultfd: replace ENOSPC with ESRCH in case mm has
 gone during copy/zeropage

(adding Michal)

On Mon, Aug 07, 2017 at 04:12:25PM +0300, Mike Rapoport wrote:
> When the process exit races with outstanding mcopy_atomic, it would be
> better to return ESRCH error. When such race occurs the process and it's mm
> are going away and returning "no such process" to the uffd monitor seems
> better fit than ENOSPC.
> 
> Suggested-by: Michal Hocko <mhocko@...e.com>
> Cc: Andrea Arcangeli <aarcange@...hat.com>
> Cc: "Dr. David Alan Gilbert" <dgilbert@...hat.com>
> Cc: Pavel Emelyanov <xemul@...tuozzo.com>
> Cc: Mike Kravetz <mike.kravetz@...cle.com>
> Signed-off-by: Mike Rapoport <rppt@...ux.vnet.ibm.com>
> ---
> The man-pages update is ready and I'll send it out once the patch is
> merged.
> 
>  fs/userfaultfd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index 06ea26b8c996..b0d5897bc4e6 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -1600,7 +1600,7 @@ static int userfaultfd_copy(struct userfaultfd_ctx *ctx,
>  				   uffdio_copy.len);
>  		mmput(ctx->mm);
>  	} else {
> -		return -ENOSPC;
> +		return -ESRCH;
>  	}
>  	if (unlikely(put_user(ret, &user_uffdio_copy->copy)))
>  		return -EFAULT;
> @@ -1647,7 +1647,7 @@ static int userfaultfd_zeropage(struct userfaultfd_ctx *ctx,
>  				     uffdio_zeropage.range.len);
>  		mmput(ctx->mm);
>  	} else {
> -		return -ENOSPC;
> +		return -ESRCH;
>  	}
>  	if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage)))
>  		return -EFAULT;
> -- 
> 2.7.4
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ