public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org,  DJ Delorie <dj@redhat.com>
Subject: Re: [PATCH 2/3] Introduce <pointer_guard.h>, extracted from <sysdep.h>
Date: Tue, 18 Oct 2022 17:03:48 +0200	[thread overview]
Message-ID: <87lepdi36z.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <ca54bf5d-1846-5710-ff72-90f7093f1083@linaro.org> (Adhemerval Zanella Netto's message of "Mon, 17 Oct 2022 13:13:10 -0300")

* Adhemerval Zanella Netto:

> On 13/10/22 09:20, Florian Weimer via Libc-alpha wrote:
>> This allows us to define a generic no-op version of PTR_MANGLE and
>> PTR_DEMANGLE.  In the future, we can use PTR_MANGLE and PTR_DEMANGLE
>> unconditionally in C sources, avoiding an unintended loss of hardening
>> due to missing include files or unlucky header inclusion ordering.
>
> Could we also improve the generic implementation to always XOR with the
> pointer guard and move it to be a proper static inline function?  I think
> we can then remove a lot of boilerplate code each architecture need to
> have.

I think the assembler implementation in part aims to avoid leaving the
plain guard value behind in a register, at least on some targets.

>> In i386 and x86_64, we can avoid a <tls.h> dependency in the C
>> code by using the computed constant from <tcb-offsets.h>.  <sysdep.h>
>> no longer includes these definitions, so there is no cyclic dependency
>> anymore when computing the <tcb-offsets.h> constants.
>
> LGTM, thanks.
>
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Thanks,
Florian


  reply	other threads:[~2022-10-18 15:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 12:20 [PATCH 0/3] PTR_MANGLE/PTR_DEMANGLE refactoring Florian Weimer
2022-10-13 12:20 ` [PATCH 1/3] x86-64: Move LP_SIZE definition to its own header Florian Weimer
2022-10-17 16:03   ` Adhemerval Zanella Netto
2022-10-13 12:20 ` [PATCH 2/3] Introduce <pointer_guard.h>, extracted from <sysdep.h> Florian Weimer
2022-10-14  3:30   ` DJ Delorie
2022-10-14  8:14     ` Florian Weimer
2022-10-17 16:13   ` Adhemerval Zanella Netto
2022-10-18 15:03     ` Florian Weimer [this message]
2022-10-13 12:20 ` [PATCH 3/3] Use PTR_MANGLE and PTR_DEMANGLE unconditionally in C sources Florian Weimer
2022-10-17 16:15   ` Adhemerval Zanella Netto

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=87lepdi36z.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=dj@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).