From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C152B1F910 for ; Tue, 8 Nov 2022 11:41:28 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="CdOkJMd/"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 970B03858295 for ; Tue, 8 Nov 2022 11:41:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 970B03858295 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667907682; bh=wU3voirfpWgD2uN8E+XJr8kdn74lWqwpNPe788iNOxQ=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=CdOkJMd/As2li/xdXepexZl+gXlwmD5x7PONmVE92g/WblvbaKnYzuOYRXxaLNEhY xC4vrK1/LshBdOaX8oooPr1v0mHAx+IfjPlA26js24Hy9UWMO/QqAoKmnBl1uF+06w mNe1Xki/BVB6/ns9QLN1c5WICJ28ziooKWrG+RFM= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8C9363858437 for ; Tue, 8 Nov 2022 11:40:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C9363858437 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-457-BG-YsbtQPhOeTm6SaH-wSQ-1; Tue, 08 Nov 2022 06:40:24 -0500 X-MC-Unique: BG-YsbtQPhOeTm6SaH-wSQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C569681173C; Tue, 8 Nov 2022 11:39:48 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D6AB51415117; Tue, 8 Nov 2022 11:39:39 +0000 (UTC) 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> <87cz9xk84v.fsf@oldenburg.str.redhat.com> <80f469a6-f432-419d-9cdc-91f2366639d3@app.fastmail.com> Date: Tue, 08 Nov 2022 12:39:37 +0100 In-Reply-To: <80f469a6-f432-419d-9cdc-91f2366639d3@app.fastmail.com> (Arnd Bergmann's message of "Tue, 08 Nov 2022 12:33:45 +0100") Message-ID: <87sfitisjq.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.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Florian Weimer via Libc-alpha Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" * Arnd Bergmann: > 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. What happened to not breaking userspace? Those with 32-bit applications will want to run their legacy stuff in a time-shifted environment, so these system calls must remain supported outside specialized applications. Thanks, Florian