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] [day] [month] [year] [list]
Date:   Mon, 15 Nov 2021 09:30:01 -0800
From:   Axel Rasmussen <axelrasmussen@...gle.com>
To:     Peter Xu <peterx@...hat.com>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrea Arcangeli <aarcange@...hat.com>,
        Nadav Amit <nadav.amit@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] selftests/uffd: Allow EINTR/EAGAIN

Looks correct to me!

Reviewed-by: Axel Rasmussen <axelrasmussen@...gle.com>

On Mon, Nov 15, 2021 at 5:52 AM Peter Xu <peterx@...hat.com> wrote:
>
> This allow test to continue with interruptions like gdb.
>
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
>  tools/testing/selftests/vm/userfaultfd.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
> index 8a09057d2f22..64845be3971d 100644
> --- a/tools/testing/selftests/vm/userfaultfd.c
> +++ b/tools/testing/selftests/vm/userfaultfd.c
> @@ -644,7 +644,7 @@ static int uffd_read_msg(int ufd, struct uffd_msg *msg)
>
>         if (ret != sizeof(*msg)) {
>                 if (ret < 0) {
> -                       if (errno == EAGAIN)
> +                       if (errno == EAGAIN || errno == EINTR)
>                                 return 1;
>                         err("blocking read error");
>                 } else {
> @@ -720,8 +720,11 @@ static void *uffd_poll_thread(void *arg)
>
>         for (;;) {
>                 ret = poll(pollfd, 2, -1);
> -               if (ret <= 0)
> +               if (ret <= 0) {
> +                       if (errno == EINTR || errno == EAGAIN)
> +                               continue;
>                         err("poll error: %d", ret);
> +               }
>                 if (pollfd[1].revents & POLLIN) {
>                         if (read(pollfd[1].fd, &tmp_chr, 1) != 1)
>                                 err("read pipefd error");
> --
> 2.32.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ