From: Cyril Hrubis <chrubis@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] cve-2017-17052: tolerate ENOMEM during test
Date: Thu, 29 Jan 2026 15:24:53 +0100 [thread overview]
Message-ID: <aXtttXRzAF7Qj0Ea@yuki.lan> (raw)
In-Reply-To: <CAEemH2fppgf4iJE4h1n3XSMw9v-hMF11BZAYjz_-9dHgKv0iFg@mail.gmail.com>
Hi!
> for (;;) {
> - SAFE_MMAP(NULL, 0x1000000, PROT_READ,
> + ptr = mmap(NULL, 0x1000000, PROT_READ,
> MAP_POPULATE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
> +
> + if (ptr == MAP_FAILED) {
> + if (errno == ENOMEM) {
> + usleep(1000);
> + continue;
> + }
> + tst_brk(TBROK | TTERRNO, "Unexpected mmap() error");
Maybe this part would be more readable with an else branch:
if (errno == ENOMEM)
usleep(1000);
else
tst_brk(TBROK | TTERRNO, "mmap() failed");
Otherwise:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
> + }
> }
>
> return arg;
>
>
>
> --
> Regards,
> Li Wang
>
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-01-29 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 10:00 [LTP] [PATCH] cve-2017-17052: tolerate ENOMEM during test Li Wang via ltp
2026-01-29 10:08 ` Li Wang via ltp
2026-01-29 13:28 ` Petr Vorel
2026-01-29 13:44 ` Li Wang via ltp
2026-01-29 14:24 ` Cyril Hrubis [this message]
2026-01-30 0:01 ` Li Wang via ltp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXtttXRzAF7Qj0Ea@yuki.lan \
--to=chrubis@suse.cz \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.