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.129.124]) by sourceware.org (Postfix) with ESMTPS id 57D41385F026 for ; Fri, 28 Jan 2022 18:19:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57D41385F026 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-SAaEcQIQPJiZrOp59juyNg-1; Fri, 28 Jan 2022 13:19:05 -0500 X-MC-Unique: SAaEcQIQPJiZrOp59juyNg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29B8B5F9C5; Fri, 28 Jan 2022 18:19:04 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3597E838F2; Fri, 28 Jan 2022 18:19:02 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v6 3/3] Linux: Only generate 64 bit timestamps for 64 bit time_t recvmsg/recvmmsg References: <20220128175043.161446-1-adhemerval.zanella@linaro.org> <20220128175043.161446-4-adhemerval.zanella@linaro.org> Date: Fri, 28 Jan 2022 19:19:01 +0100 In-Reply-To: <20220128175043.161446-4-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Fri, 28 Jan 2022 14:50:43 -0300") Message-ID: <875yq3k9ka.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 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 28 Jan 2022 18:19:09 -0000 * Adhemerval Zanella: > The timestamps created by __convert_scm_timestamps only make sense for > 64 bit time_t programs, 32 bit time_t programs will ignore 64 bit time_t > timestamps since SO_TIMESTAMP will be defined to old values (either by > glibc or kernel headers). > > Worse, if the buffer is not suffice MSG_CTRUNC is set to indicate it > (which breaks some programs [1]). > > This patch makes only 64 bit time_t recvmsg and recvmmsg to call > __convert_scm_timestamps. Also, the assumption to called it is changed > from __ASSUME_TIME64_SYSCALLS to __TIMESIZE != 64 since the setsockopt > might be called by libraries built without __TIME_BITS=64. The > MSG_CTRUNC is only set for the 64 bit symbols, it should happen only > if 64 bit time_t programs run older kernels. > > Checked on x86_64-linux-gnu and i686-linux-gnu. > > [1] https://github.com/systemd/systemd/pull/20567 > --- > include/sys/socket.h | 10 +- > sysdeps/unix/sysv/linux/Makefile | 10 +- > sysdeps/unix/sysv/linux/recvmmsg.c | 45 ++- > sysdeps/unix/sysv/linux/recvmsg.c | 34 ++- > .../tst-socket-timestamp-compat-time64.c | 1 + > .../sysv/linux/tst-socket-timestamp-compat.c | 265 ++++++++++++++++++ > 6 files changed, 336 insertions(+), 29 deletions(-) > create mode 100644 sysdeps/unix/sysv/linux/tst-socket-timestamp-compat-time64.c > create mode 100644 sysdeps/unix/sysv/linux/tst-socket-timestamp-compat.c Looks okay. Reviewed-by: Florian Weimer Thanks, Florian