From patchwork Mon Jul 5 18:30:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 44154 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D54373864805 for ; Mon, 5 Jul 2021 18:30:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D54373864805 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1625509855; bh=6iLK7J81/RYSZFOVHi70Os1IEaWh9ZyG8Kr8lnCY3OY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gZL6vWapAxB3MQNM3Ll5POMxQxOZr8Ejy6ajU/6caFDaWq6Ir8wal2yefVTo6hJi+ 0ecOzTq2jXDx4NUW3QgBtMoad5h/YrDjsSGTNcBix+nQHdPY/7sddTcGWibvl2uuWB 5pJ0u201PeKdE6L853sG6HTUmHgvw792vNq+oH7c= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 7EB0C3857C63 for ; Mon, 5 Jul 2021 18:30:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7EB0C3857C63 Received: by mail-pl1-x62b.google.com with SMTP id u19so10670011plc.3 for ; Mon, 05 Jul 2021 11:30:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=6iLK7J81/RYSZFOVHi70Os1IEaWh9ZyG8Kr8lnCY3OY=; b=K/X616774yIv0HNjVK/vb1mHr2OS+tM8Vun9cyGENVDgO0IxPocv1XgaMDgVa/6vfe MAxxvev084LU4Wuhlcq5xWkKn3M2ObDFWWCex/gi9z6NQUDjQZQDM/EbhiKxroTV3RHC rgfOhCl+pjiBRu95SivkX06b0cwSfxAoM3YebJi/WG2+ml52XYETePB0PwL8m4KNebYW Hadzb/pdNJz+NbBSAvjwrJYsnoU3AU788dSGowhYZK726oqoUtTffCQE74OkgRewKXQC s6oIQqnzmlPm7kAWnzMgO3Jb+RzyBvYETVQzGEjFXIdm7+rCV7Al4kR5Mq+qRH0Z0N7G HAog== X-Gm-Message-State: AOAM533pFD31td2qssV47QMMlEttNxKAiq4aIWdyI8Hn9ApzG5NIkshf 7fubS3Tgfg9aH46PgK2fob7xrrMdPgSykg== X-Google-Smtp-Source: ABdhPJxTGgcjwRytQbr9D+gnyp0ey4+lyBtlEtj3JsUIYCKz4SpF3gTBMVRLGOWdjV2X1aoZCZZAoQ== X-Received: by 2002:a17:90a:d90f:: with SMTP id c15mr16720413pjv.146.1625509832434; Mon, 05 Jul 2021 11:30:32 -0700 (PDT) Received: from birita.. ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id y13sm14311299pgp.16.2021.07.05.11.30.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 11:30:32 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 0/7] Linux 64-bit time_t socket fixes Date: Mon, 5 Jul 2021 15:30:20 -0300 Message-Id: <20210705183027.3804093-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This series fixes some issues with socket timestamps on legacy ABIs with 32-bit time_t support. The first two patches consolidates the setsockopt and getsockopt, which fixes the missing timestamp handling on some architectures (hppa, mips32, arm, cksy, and nios2). The third and forth patches fixes a wrong conversion for timestamps and a wrong argument usage for setsockopt. Finally the remaining patches adds proper tests for both recvmsg and recvmmsg. They check for timestamp on both syscalls() with different ancilliary data sizes (to check if convertion take this in consideration, and with different time_t sizes. I checked it on x86_64-linux-gnu and i686-linux-gnu on both 5.11 kernel and on 4.15 kernel. I am planning to run on some different system with different kernels as well. It might worth to check if this series fix the ruby issue [1]. [1] https://sourceware.org/pipermail/libc-alpha/2021-June/128113.html Adhemerval Zanella (7): linux: Consolidate Linux getsockopt implementation linux: Consolidate Linux setsockopt implementation linux: Use the expected size for SO_TIMESTAMP{NS} convertion linux: Fix setsockopt fallback support: Add support_socket_time64_timestamp socket: Add recvmsg timestamp test socket: Add recvmmsg timestamp test support/Makefile | 1 + support/support.h | 3 + support/support_socket_time64_timestamp.c | 68 +++++++ sysdeps/unix/sysv/linux/Makefile | 3 + sysdeps/unix/sysv/linux/alpha/syscalls.list | 2 - sysdeps/unix/sysv/linux/arm/syscalls.list | 2 - .../unix/sysv/linux/convert_scm_timestamps.c | 8 +- sysdeps/unix/sysv/linux/generic/syscalls.list | 2 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 2 - .../unix/sysv/linux/i386/kernel-features.h | 4 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 2 - sysdeps/unix/sysv/linux/kernel-features.h | 2 + .../unix/sysv/linux/m68k/kernel-features.h | 4 +- .../sysv/linux/microblaze/kernel-features.h | 2 - sysdeps/unix/sysv/linux/mips/syscalls.list | 2 - .../unix/sysv/linux/powerpc/kernel-features.h | 2 - .../unix/sysv/linux/s390/kernel-features.h | 4 +- sysdeps/unix/sysv/linux/setsockopt.c | 2 +- sysdeps/unix/sysv/linux/sh/kernel-features.h | 2 - .../unix/sysv/linux/sparc/kernel-features.h | 4 +- sysdeps/unix/sysv/linux/tst-recvmmsg-time64.c | 1 + sysdeps/unix/sysv/linux/tst-recvmmsg.c | 185 ++++++++++++++++++ sysdeps/unix/sysv/linux/tst-recvmsg-time64.c | 1 + sysdeps/unix/sysv/linux/tst-recvmsg.c | 171 ++++++++++++++++ sysdeps/unix/sysv/linux/x86_64/syscalls.list | 2 - 25 files changed, 450 insertions(+), 31 deletions(-) create mode 100644 support/support_socket_time64_timestamp.c create mode 100644 sysdeps/unix/sysv/linux/tst-recvmmsg-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-recvmmsg.c create mode 100644 sysdeps/unix/sysv/linux/tst-recvmsg-time64.c create mode 100644 sysdeps/unix/sysv/linux/tst-recvmsg.c