From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A0CE33858C39 for ; Tue, 8 Nov 2022 11:17:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0CE33858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667906263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SHfSvLST297YntejMDJkIT4W1xWtXolbfBzpIVf9V0o=; b=PNtI5ghxRfnxLMGqFU/UyR2krRRDVRgAHYyGZN/CAF/c0tS8vlWC4CUTrhLnAqUpW5TeeQ WM5Bzy9H/tdTOUnkazthAfYRVUOX+Ecix9Qr8kFkU3gRfAziLEqZ98bdV6U66Fl/ZcroJQ WS3pb8MCiRn3duR9EfOn9IjMSTHxBHI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-8-GagXPnV2PSW4JTJT9iomJw-1; Tue, 08 Nov 2022 06:17:40 -0500 X-MC-Unique: GagXPnV2PSW4JTJT9iomJw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD32B1C0759F; Tue, 8 Nov 2022 11:17:39 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 207A62028E90; Tue, 8 Nov 2022 11:17:38 +0000 (UTC) From: Florian Weimer To: "Arnd Bergmann" Cc: "YunQiang Su" , "Xi Ruoyao" , aurelien@aurel32.net, "Adhemerval Zanella Netto" , "Jiaxun Yang" , "Maciej W. Rozycki" , syq@debian.org Subject: Re: [PATCH v3] Define in_int32_t_range to check if the 64 bit time_t syscall should be used References: <20221104013913.1543593-1-yunqiang.su@cipunited.com> <20221108044945.2173509-1-yunqiang.su@cipunited.com> <652b5ea3-2305-4a1e-b1b5-de81864a844c@app.fastmail.com> Date: Tue, 08 Nov 2022 12:17:36 +0100 In-Reply-To: <652b5ea3-2305-4a1e-b1b5-de81864a844c@app.fastmail.com> (Arnd Bergmann's message of "Tue, 08 Nov 2022 11:39:26 +0100") Message-ID: <87cz9xk84v.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * 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? Thanks, Florian