public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] malloc: Implement heap protector
Date: Fri, 28 Oct 2016 20:45:00 -0000	[thread overview]
Message-ID: <xn7f8snqwt.fsf@greed.delorie.com> (raw)
In-Reply-To: <dd818b8d-7176-8490-0780-e6e25756323a@redhat.com> (Florian Weimer's message of "Fri, 28 Oct 2016 15:17:22 +0200")


My only comments on this one are:

> +/* Decrypt a heap header chunk.  */
> +#define HEAP_CRYPT_SIZE(val) (__malloc_header_guard ^ ((INTERNAL_SIZE_T) val))
> +#define HEAP_CRYPT_PREVSIZE(val) \
> +  (__malloc_footer_guard ^ ((INTERNAL_SIZE_T) val))

For readability and maintainability, we should probably have both CRYPT
and DECRYPT macros, used correcly throughout.  Yes, I know they'd be the
same now, but they might not be later.

> +/* The heap cookie.  The lowest three bits (corresponding to
> +   SIZE_BITS) in __malloc_guard_header must be clear.  Initialized
> +   during libc startup, and computed by elf/dl-keysetup.c.  */

If the lowest three bits must be clear, we should either clear them or
assert that they're clear.

      parent reply	other threads:[~2016-10-28 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 13:17 Florian Weimer
2016-10-28 15:05 ` Carlos O'Donell
2016-10-28 17:56 ` Paul Eggert
2016-11-08 15:13   ` Florian Weimer
2016-11-08 16:09     ` Andreas Schwab
2016-11-10 15:39     ` Florian Weimer
2016-10-28 20:45 ` DJ Delorie [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=xn7f8snqwt.fsf@greed.delorie.com \
    --to=dj@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).