public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: Nikita Ermakov <sh1r4s3@mail.si-head.nl>,  libc-alpha@sourceware.org
Subject: Re: [PATCH] elf: Use the 64-bit wide 'seen' variable
Date: Mon, 09 Aug 2021 09:48:38 +0200	[thread overview]
Message-ID: <87lf5bgisp.fsf@igel.home> (raw)
In-Reply-To: <20210809004648.GB2038@altlinux.org> (Dmitry V. Levin's message of "Mon, 9 Aug 2021 03:46:48 +0300")

On Aug 09 2021, Dmitry V. Levin wrote:

> On Sat, Aug 07, 2021 at 05:22:23PM +0300, Nikita Ermakov via Libc-alpha wrote:
>> The 32-bit 'seen' variable doesn't allow to check any auxiliary entry
>> type with a value greater than 31 as it leads to wrapping and crumbling
>> of the 'seen' variable.
>> 
>> For example, if AT_UID (which is 11) would precede AT_L1D_CACHEGEOMETRY
>> (which is 43), then uid would be overridden by an AT_L1D_CACHEGEOMETRY
>> value.
>> 
>> Using 64-bit wide 'seen' variable allows to handle such situations.
>
> I agree with the analysis, but I'm not sure uint64_t would be the most
> appropriate type in this case.  I'd suggest to consider using uintmax_t
> instead.

AT_* constants can be arbitrary so no type will fit.  The right way to
fix that is to check the range.

Of course, this is only relevant for non-linux configurations.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2021-08-09  7:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 14:22 Nikita Ermakov
2021-08-09  0:46 ` Dmitry V. Levin
2021-08-09  7:48   ` Andreas Schwab [this message]
2021-08-17 18:03     ` Nikita Ermakov

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=87lf5bgisp.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=ldv@altlinux.org \
    --cc=libc-alpha@sourceware.org \
    --cc=sh1r4s3@mail.si-head.nl \
    /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).