public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Andrew Senkevich <andrew.n.senkevich@gmail.com>
Cc: libc-alpha <libc-alpha@sourceware.org>,  max@quendi.de
Subject: Re: [PATCH] Fix i386 memmove issue [BZ #22644]
Date: Mon, 19 Feb 2018 10:31:00 -0000	[thread overview]
Message-ID: <mvm606ts2w6.fsf@suse.de> (raw)
In-Reply-To: <CAMXFM3s5b2a6o_CMS0cJ35oE3SuJUHssqLAUY94LSZhEEtG71A@mail.gmail.com> (Andrew Senkevich's message of "Mon, 19 Feb 2018 10:45:56 +0100")

On Feb 19 2018, Andrew Senkevich <andrew.n.senkevich@gmail.com> wrote:

> diff --git a/string/test-memmove.c b/string/test-memmove.c
> index edc7a4c..8dc152b
> --- a/string/test-memmove.c
> +++ b/string/test-memmove.c
> @@ -245,6 +245,49 @@ do_random_tests (void)
>      }
>  }
>
> +#if __SIZEOF_POINTER__ == 4
> +static void
> +do_test2 (void)
> +{
> +  uint32_t i;
> +  uint32_t num = 0x20000000;
> +  uint32_t * large_buf = mmap (0, sizeof(uint32_t) * num, PROT_READ |
> PROT_WRITE,
> +        MAP_PRIVATE | MAP_ANON, -1, 0);
> +  if (large_buf == MAP_FAILED)
> +    error (EXIT_FAILURE, errno, "large mmap failed");
> +
> +  if (!((uint32_t)(large_buf) < (0x80000000 - 128) && (0x80000000 +
> 128) < (uint32_t)(&large_buf[num])))
> +    {
> +      error (0, 0,"allocated large memory doesn't cross 0x80000000 boundary");
> +      ret = 1;
> +      return;

Please properly fold long lines, and remove the redundant parens.  Also,
there is no guarantee that the address range is unallocated.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

  reply	other threads:[~2018-02-19 10:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 10:13 Andrew Senkevich
2018-02-19 10:31 ` Andreas Schwab [this message]
2018-03-14 14:43   ` Andrew Senkevich
2018-03-14 14:59     ` H.J. Lu
2018-03-19 12:46       ` Andrew Senkevich
2018-03-19 12:55         ` H.J. Lu
2018-03-19 13:11         ` Andreas Schwab
2018-03-19 13:17           ` Florian Weimer
2018-03-19 14:01             ` Andrew Senkevich
2018-03-19 14:25             ` Szabolcs Nagy
2018-03-19 15:33               ` Florian Weimer
2018-03-19 17:52                 ` Andrew Senkevich
2018-03-19 17:57                   ` H.J. Lu
2018-03-19 19:30                     ` Andrew Senkevich
2018-03-19 19:38                       ` H.J. Lu
2018-03-19 20:33                         ` Andrew Senkevich
2018-03-19 20:50                           ` H.J. Lu
2018-03-20  8:58                           ` Andreas Schwab
2018-03-23 17:15                             ` Andrew Senkevich

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=mvm606ts2w6.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=andrew.n.senkevich@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=max@quendi.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).