From: Nikita Ermakov via Libc-alpha <libc-alpha@sourceware.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: libc-alpha@sourceware.org, "Dmitry V. Levin" <ldv@altlinux.org>
Subject: Re: [PATCH] elf: Use the 64-bit wide 'seen' variable
Date: Tue, 17 Aug 2021 21:03:16 +0300 [thread overview]
Message-ID: <YRv55NOuj85+Sr6T@amanita> (raw)
In-Reply-To: <87lf5bgisp.fsf@igel.home>
Hi Andreas, Dmitry,
Thank you for the comments!
I'm sorry, I was rather busy past week so couldn't reply.
On Mon, Aug 09, 2021 at 09:48:38AM +0200, Andreas Schwab wrote:
> 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.
>
So, if AT_* constants can be arbitrary, then we could probably skip all
constants with a value > sizeof(uintmax_t)*8 and process the rest with the uintmax_t variable?
--
Thanks,
Nikita
B8 00 4C CD 21
prev parent reply other threads:[~2021-08-17 18:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-07 14:22 [PATCH] elf: Use the 64-bit wide 'seen' variable Nikita Ermakov via Libc-alpha
2021-08-09 0:46 ` Dmitry V. Levin
2021-08-09 7:48 ` Andreas Schwab
2021-08-17 18:03 ` Nikita Ermakov via Libc-alpha [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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRv55NOuj85+Sr6T@amanita \
--to=libc-alpha@sourceware.org \
--cc=ldv@altlinux.org \
--cc=schwab@linux-m68k.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).