public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Senkevich <andrew.n.senkevich@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Andreas Schwab <schwab@suse.de>, "H.J. Lu" <hjl.tools@gmail.com>,
	 libc-alpha <libc-alpha@sourceware.org>, Max Horn <max@quendi.de>,
	thomas@grindinggear.com
Subject: Re: [PATCH] Fix i386 memmove issue [BZ #22644]
Date: Mon, 19 Mar 2018 14:01:00 -0000	[thread overview]
Message-ID: <CAMXFM3t34PEtzV5mpB-P=yHbd6UJR+Eqxm2NFiqRbAyu_7UvFg@mail.gmail.com> (raw)
In-Reply-To: <597954a1-85da-e524-1454-27c46af57413@redhat.com>

2018-03-19 14:17 GMT+01:00 Florian Weimer <fweimer@redhat.com>:
> On 03/19/2018 02:11 PM, Andreas Schwab wrote:
>>
>> On Mär 19 2018, Andrew Senkevich<andrew.n.senkevich@gmail.com>  wrote:
>>
>>> +static void
>>> +do_test2 (void)
>>> +{
>>> +  uint32_t num = 0x20000000;
>>> +  uint32_t * large_buf;
>>> +
>>> +  large_buf = mmap ((void*)0x70000000, num, PROT_READ | PROT_WRITE,
>>> +     MAP_PRIVATE | MAP_ANON | MAP_FIXED, -1, 0);
>>
>> Since you are using MAP_FIXED this may overwrite an existing mapping.
>
>
> Leading to a hard-to-debug crash, maybe sporadically due to ASLR.  Yes, I
> have this concern as well.
>
> There was a long, long Linux thread about a non-overriding MAP_FIXED
> variant, but as far as I can see, this has not been merged.  Maybe it would
> have helped here.
>
> Is it very difficult to split out this test into a separate test file? Then
> link the whole thing statically, as non-PIE, and keep using MAP_FIXED.  This
> should make it quite likely that you don't override anything valuable.

I think not very difficult, I will try this way.


--
WBR,
Andrew

  reply	other threads:[~2018-03-19 14:01 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
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 [this message]
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='CAMXFM3t34PEtzV5mpB-P=yHbd6UJR+Eqxm2NFiqRbAyu_7UvFg@mail.gmail.com' \
    --to=andrew.n.senkevich@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=max@quendi.de \
    --cc=schwab@suse.de \
    --cc=thomas@grindinggear.com \
    /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).