public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] sysmalloc: Initialize previous size field of mmaped chunks
Date: Fri, 28 Oct 2016 14:13:00 -0000	[thread overview]
Message-ID: <3244fc5c-8d85-64e6-f4e8-6584eaf44ada@redhat.com> (raw)
In-Reply-To: <20161028130449.BB0E9439942E0@oldenburg.str.redhat.com>

On 10/28/2016 09:04 AM, Florian Weimer wrote:
> With different encodings of the header, the previous zero initialization
> may be insufficient and produce an invalid encoding.
> 
> 2016-10-27  Florian Weimer  <fweimer@redhat.com>
> 
> 	* malloc/malloc.c (sysmalloc): Initialize previous size field of
> 	mmaped chunks.
> 
> diff --git a/malloc/malloc.c b/malloc/malloc.c
> index 186e174..72d22bd 100644
> --- a/malloc/malloc.c
> +++ b/malloc/malloc.c
> @@ -2306,6 +2306,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
>                else
>                  {
>                    p = (mchunkptr) mm;
> +		  set_prev_size (p, 0);
>                    set_head (p, size | IS_MMAPPED);
>                  }
>  
 
Agreed. This looks good to me, and paves the way for the header
encodings to be non-zero.

-- 
Cheers,
Carlos.

      reply	other threads:[~2016-10-28 14:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 13:04 Florian Weimer
2016-10-28 14:13 ` Carlos O'Donell [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=3244fc5c-8d85-64e6-f4e8-6584eaf44ada@redhat.com \
    --to=carlos@redhat.com \
    --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).