public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Florian Weimer" <fweimer@redhat.com>
Cc: "YunQiang Su" <yunqiang.su@cipunited.com>,
	"Xi Ruoyao" <libc-alpha@sourceware.org>,
	aurelien@aurel32.net,
	"Adhemerval Zanella Netto" <adhemerval.zanella@linaro.org>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>,
	syq@debian.org
Subject: Re: [PATCH v3] Define in_int32_t_range to check if the 64 bit time_t syscall should be used
Date: Tue, 08 Nov 2022 12:33:45 +0100	[thread overview]
Message-ID: <80f469a6-f432-419d-9cdc-91f2366639d3@app.fastmail.com> (raw)
In-Reply-To: <87cz9xk84v.fsf@oldenburg.str.redhat.com>

On Tue, Nov 8, 2022, at 12:17, Florian Weimer wrote:
> * Arnd Bergmann:
>> On Tue, Nov 8, 2022, at 05:49, YunQiang Su wrote:
>>> Currently glibc uses in_time_t_range to detects time_t overflow,
>>> and if it occurs fallbacks to 64 bit syscall version.
>>>
>>> The function name is confusing because internally time_t might be
>>> either 32 bits or 64 bits (depending on __TIMESIZE).
>>>
>>> This patch refactors the in_time_t_range by replacing it with
>>> in_int32_t_range for the case to check if the 64 bit time_t syscall
>>> should be used.
>>>
>>> The in_time_t range is used to detect overflow of the
>>> syscall return value.
>>
>> It looks like the fallback logic has another flaw, I don't
>> see how this works on kernels with COMPAT_32BIT_TIME disabled,
>> as these only have the time64 syscalls available.
>
> Isn't that an invalid kernel configuration?

No, this is what we will use anyway after 2038 (possibly
earlier), so the option is useful to ensure that all userspace
has been converted away from the time32 interfaces.

     Arnd

  reply	other threads:[~2022-11-08 11:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  1:39 [PATCH] Use in_int32_t_range to check need 64bit syscall YunQiang Su
2022-11-08  4:49 ` [PATCH v3] Define in_int32_t_range to check if the 64 bit time_t syscall should be used YunQiang Su
2022-11-08 10:39   ` Arnd Bergmann
2022-11-08 11:17     ` Florian Weimer
2022-11-08 11:33       ` Arnd Bergmann [this message]
2022-11-08 11:39         ` Florian Weimer
2022-11-08 11:55           ` Adhemerval Zanella Netto
2022-11-08 12:28           ` Arnd Bergmann
2022-11-08 12:51             ` Adhemerval Zanella Netto
2022-11-08 13:27               ` Arnd Bergmann
2022-11-08 13:49                 ` Adhemerval Zanella Netto
2022-11-08 14:07                   ` Arnd Bergmann
2022-11-08 14:27                     ` Adhemerval Zanella Netto
2022-11-08 19:47                       ` Adhemerval Zanella Netto
2022-11-08 23:29                         ` Rich Felker
2022-11-17 17:35   ` 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=80f469a6-f432-419d-9cdc-91f2366639d3@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=fweimer@redhat.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=macro@orcam.me.uk \
    --cc=syq@debian.org \
    --cc=yunqiang.su@cipunited.com \
    /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).