public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH v4 1/5] support: Add support_stack_alloc
Date: Fri, 12 Mar 2021 11:01:49 -0300	[thread overview]
Message-ID: <997f658d-f6e7-a3ad-0be0-124a2dc4e98d@linaro.org> (raw)
In-Reply-To: <87v99w4hqo.fsf@oldenburg.str.redhat.com>



On 12/03/2021 10:35, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 10/03/2021 13:10, Florian Weimer wrote:
>>> * Adhemerval Zanella via Libc-alpha:
>>>
>>>> +  /* Use MAP_NORESERVE so that RAM will not be wasted on the guard
>>>> +     bands; touch all the pages of the actual stack before returning,
>>>> +     so we know they are allocated.  */
>>>> +  void *alloc_base = xmmap (0,
>>>> +                            alloc_size,
>>>> +                            PROT_READ|PROT_WRITE,
>>>> +                            MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE|MAP_STACK,
>>>> +                            -1);
>>>> +  xmprotect (alloc_base, guardsize, PROT_NONE);
>>>> +  xmprotect (alloc_base + guardsize + stacksize, guardsize, PROT_NONE);
>>>
>>> The usual pattern is to map with PROT_NONE and then use
>>> PROT_READ|PROT_WRITE with mprotect.
>>>
>>> Rest looks okay, thanks.
>>>
>>> Florian
>>>
>>
>> Ok, I will fix it and push upstream.
> 
> Just to be clear, it avoids the need for MAP_NORESERVE.

Right, I will fix it.

      reply	other threads:[~2021-03-12 14:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 15:26 Adhemerval Zanella
2021-03-10 15:26 ` [PATCH v4 2/5] support: Add xclone Adhemerval Zanella
2021-03-10 15:26 ` [PATCH v4 3/5] Linux: Add close_range Adhemerval Zanella
2021-03-24 22:42   ` Alyssa Ross
2021-03-10 15:26 ` [PATCH v4 4/5] io: Add closefrom [BZ #10353] Adhemerval Zanella
2021-03-10 21:54   ` Joseph Myers
2021-03-11 11:24     ` Adhemerval Zanella
2021-03-10 15:26 ` [PATCH v4 5/5] posix: Add posix_spawn_file_actions_closefrom_np Adhemerval Zanella
2021-03-10 16:10 ` [PATCH v4 1/5] support: Add support_stack_alloc Florian Weimer
2021-03-12 13:24   ` Adhemerval Zanella
2021-03-12 13:35     ` Florian Weimer
2021-03-12 14:01       ` Adhemerval Zanella [this message]

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=997f658d-f6e7-a3ad-0be0-124a2dc4e98d@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /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).