From patchwork Wed Apr 25 16:02:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134350 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1050368lji; Wed, 25 Apr 2018 09:04:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+/Tq5FPKEG3mg9OFM2gbdFWxvXciQGRN7Qv/5QR7gPId09MO0MsOlnUTamyexA/rLeu+bu X-Received: by 2002:a17:902:2d24:: with SMTP id o33-v6mr29917880plb.14.1524672291576; Wed, 25 Apr 2018 09:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524672291; cv=none; d=google.com; s=arc-20160816; b=wztZQipKpDr4+4MhbhqBfUOmBdLQwo+R5JWOEf5mu4oEp5DJW3OH4CSH9Uz/NEljvq LQ14JIvsrQpf79AL4nCWYttFe/FG/BV8ARlzbJyuEcr+P1DrYwuieLZk2iJcrq2Ppeg1 yO1dPXSFjHLlYlnmlNau5TANad+Nb/y9QmP67GlKNntmVDX9WWK81b/iF6ECUbgNQ3T1 EQvk2L7M+Duus+NN9xiIlCw3ev66RwbssAtcKSEeR1tRdDvyKaNTWkQs/A9ri0bPgaC5 mb6/5O1mP9pzwbHUDUTCISIgdF4g26J84eOv9hHp2cntGh4W7os22nRk+A0HXF5ptg5p Sh8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GzB6AhYB5j5t6ZqMs+/ZXiFhVR1Q+VaZdHFKnV5LYLs=; b=PeZTTdHJS1PR+g94si8tOg8rlTa7aUvCDOAKKhmW31saFUtNzZ/iGVfOwxprN+C2xK K8fM+stxkQd16ywcAAo2A71bwnn8Pj/JDpVKT4/aIdLyeWVaRE3K/9FW+FV9aygTENDj 4Ky+x+B8a4o60Hmfd40PziUZyv1LH2uvl/CVD0R+khQz6PZ/DRbZLhB8P2dwOKAB05Oe 7RNbAnRcMpsb89g6JBjB+SYaqGO6DONKi1V6n2ExMcPu8nP+fx4baePFqsReWKzoWWm6 eK5CbqWxAFphGA796l8qUBQyQVZleKZl4IkeI9yHmaFefS/EJcw5lyJq8BYKtQKp4Vz+ IU5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14-v6si10617873plj.146.2018.04.25.09.04.51; Wed, 25 Apr 2018 09:04:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755813AbeDYQEg (ORCPT + 9 others); Wed, 25 Apr 2018 12:04:36 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:33511 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755419AbeDYQE3 (ORCPT ); Wed, 25 Apr 2018 12:04:29 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LwptA-1eIIGo3pcG-016NG0; Wed, 25 Apr 2018 18:03:31 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, netdev@vger.kernel.org, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, albert.aribaud@3adev.fr, Peter Zijlstra , Darren Hart , "Eric W. Biederman" , Dominik Brodowski Subject: [PATCH 01/17] y2038: compat: Move common compat types to asm-generic/compat.h Date: Wed, 25 Apr 2018 18:02:55 +0200 Message-Id: <20180425160311.2718314-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-Provags-ID: V03:K1:yP2l/nqXRaBsQgkatbQ9Jz63oLT3+DQJ7AZ4y6lGKXuAizZC5iW qvbKFBaW2Cf2nQC146mTpV8kFDiyR10xElY1zYMG08f7PvKkX66+Ocvyw2mHoyT+ru/z4l2 IHwzY4E7aZEvgPbO+bu+FvMSSrSZ0H+j7/ddmE2Lfl5RfSzRficrdIqZ1SHTQ0x3uJqazOr zYSIqj3ferr0T/z+RxSpw== X-UI-Out-Filterresults: notjunk:1; V01:K0:UACJtUR9V4Q=:EnIhzzFfQjD6eQqmLrGNdX x5Vh3oUtQhtlj15Z0dKDca4cSANH3VgiRSBm08MRFfPnIhTXFNRvIkQjxkvzFvanT5cva2Axf EQozMQULxIwkA9xscgU3kFyavnoL5Xc4GfLBL5caPoyCZiHYNxPmXwcCRc8J7v6gYMZxmJsPB jlRtYa/m+sxKV4AF2ijBCiQoq11KcmQVbfSs9PMm8AJStVIjwWx8DG1QjtYuOoqEToQxRI84O 6NCdGiXMOqCRZqpTFJWdCRKYlWdNA+rZwbjBzb7xgJXvbK75GaK4L7bc9Ib2menu635FPko5p W7Wmu7raisO2tkOUohgv0P6yiJmPlnWJVE+yHvWmv1t/Mz4qVZU2fvLXrRlOGbuqOe+ZJqcwR 31JoUpXMWWvh9ieqkwDPjTcWLU0XutJhPRxlSTlpGCpPQdnBLNwNtAJ0xx1r1EW7BsvmT1XGT WNmehILa+g3urvlG23g+wGNJIC/3X6F95py28Qkyc5NEKvbnPbix5LC3aW1zXAE8O9qNPmOuC 7HQ0J475iBe+6yx+YNKw/iy1eK9ogQqjAiN+hECc/j9f+MX10RX0bvsyFafjZimJPN9L+RBRB XyGy9QiV8Sl1UC+ZrISLGjIjYYaIkPfh9CfKudm4Wcls85ZsLpdzonF1YrC1E725NORt6QV5h fes8nUeS2S408ySEqcrhqCh+BJKkm0z636uhUbr47SKzv9UkJBozNpxyorcCvm8HsOKA= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The architectures that support 32-bit compat mode define a number of simple types for use in compat handlers. About half of those are identical between architectures, and some of those are also required now by handlers shared with CONFIG_COMPAT_32BIT_TIME functions on 32-bit architectures. Let's move all the identical ones into asm-generic/compat.h to avoid having to add even more identical definitions of those types. For unknown reasons, mips defines __compat_gid32_t, __compat_uid32_t and compat_caddr_t as signed, while all others have them unsigned. This seems to be a mistake, but I'm leaving it alone here. The other types all differ by size or alignment on at least on architecture. compat_aio_context_t is currently defined in linux/compat.h but also needed for compat_sys_io_getevents(), so let's move it into the same place. Signed-off-by: Arnd Bergmann --- arch/arm64/include/asm/compat.h | 20 ++------------------ arch/mips/include/asm/compat.h | 22 ++-------------------- arch/parisc/include/asm/compat.h | 18 ++---------------- arch/powerpc/include/asm/compat.h | 18 ++---------------- arch/s390/include/asm/compat.h | 18 ++---------------- arch/sparc/include/asm/compat.h | 19 ++----------------- arch/x86/include/asm/compat.h | 19 ++----------------- include/asm-generic/compat.h | 24 +++++++++++++++++++++++- include/linux/compat.h | 2 -- 9 files changed, 37 insertions(+), 123 deletions(-) -- 2.9.0 diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index 1a037b94eba1..a4c79f9e856d 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h @@ -25,6 +25,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __AARCH64EB__ #define COMPAT_UTS_MACHINE "armv8b\0\0" @@ -32,10 +34,6 @@ #define COMPAT_UTS_MACHINE "armv8l\0\0" #endif -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u16 __compat_uid16_t; @@ -43,27 +41,13 @@ typedef u16 __compat_gid16_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s32 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s16 compat_short_t; -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u16 compat_ushort_t; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { #ifdef __AARCH64EB__ diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 78675f19440f..7033a7c93b48 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h @@ -9,43 +9,25 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "mips\0\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_suseconds_t; - -typedef s32 compat_pid_t; typedef s32 __compat_uid_t; typedef s32 __compat_gid_t; typedef __compat_uid_t __compat_uid32_t; typedef __compat_gid_t __compat_gid32_t; typedef u32 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u32 compat_nlink_t; typedef s32 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef s32 compat_caddr_t; typedef struct { s32 val[2]; } compat_fsid_t; -typedef s32 compat_timer_t; -typedef s32 compat_key_t; - -typedef s16 compat_short_t; -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u16 compat_ushort_t; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index ab8a54771507..f707e025f89b 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h @@ -8,36 +8,22 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "parisc\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u32 __compat_uid_t; typedef u32 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; /* dev_t is 32 bits on parisc */ diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 85c8af2bb272..036b210b1582 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h @@ -8,6 +8,8 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #ifdef __BIG_ENDIAN__ #define COMPAT_UTS_MACHINE "ppc\0\0" @@ -15,34 +17,18 @@ #define COMPAT_UTS_MACHINE "ppcle\0\0" #endif -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u32 __compat_uid_t; typedef u32 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u32 compat_mode_t; -typedef u32 compat_ino_t; typedef u32 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 97db2fba546a..63b46e30b2c3 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h @@ -9,6 +9,8 @@ #include #include +#include + #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p( \ typeof(0?(__force t)0:0ULL), u64)) @@ -51,34 +53,18 @@ #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "s390\0\0\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; typedef struct { u32 mask; diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index 4eb51d2dae98..985286b79891 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h @@ -6,38 +6,23 @@ */ #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "sparc\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef s16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_key_t; -typedef s32 compat_timer_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; typedef u64 compat_u64; -typedef u32 compat_uptr_t; - struct compat_stat { compat_dev_t st_dev; compat_ino_t st_ino; diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index fb97cf7c4137..0ce6f452d334 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h @@ -12,38 +12,23 @@ #include #include +#include + #define COMPAT_USER_HZ 100 #define COMPAT_UTS_MACHINE "i686\0\0" -typedef u32 compat_size_t; -typedef s32 compat_ssize_t; -typedef s32 compat_clock_t; -typedef s32 compat_pid_t; typedef u16 __compat_uid_t; typedef u16 __compat_gid_t; typedef u32 __compat_uid32_t; typedef u32 __compat_gid32_t; typedef u16 compat_mode_t; -typedef u32 compat_ino_t; typedef u16 compat_dev_t; -typedef s32 compat_off_t; -typedef s64 compat_loff_t; typedef u16 compat_nlink_t; typedef u16 compat_ipc_pid_t; -typedef s32 compat_daddr_t; typedef u32 compat_caddr_t; typedef __kernel_fsid_t compat_fsid_t; -typedef s32 compat_timer_t; -typedef s32 compat_key_t; - -typedef s32 compat_int_t; -typedef s32 compat_long_t; typedef s64 __attribute__((aligned(4))) compat_s64; -typedef u32 compat_uint_t; -typedef u32 compat_ulong_t; -typedef u32 compat_u32; typedef u64 __attribute__((aligned(4))) compat_u64; -typedef u32 compat_uptr_t; struct compat_stat { compat_dev_t st_dev; diff --git a/include/asm-generic/compat.h b/include/asm-generic/compat.h index 28819451b6d1..a86f65bffab8 100644 --- a/include/asm-generic/compat.h +++ b/include/asm-generic/compat.h @@ -1,3 +1,25 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_GENERIC_COMPAT_H +#define __ASM_GENERIC_COMPAT_H -/* This is an empty stub for 32-bit-only architectures */ +/* These types are common across all compat ABIs */ +typedef u32 compat_size_t; +typedef s32 compat_ssize_t; +typedef s32 compat_clock_t; +typedef s32 compat_pid_t; +typedef u32 compat_ino_t; +typedef s32 compat_off_t; +typedef s64 compat_loff_t; +typedef s32 compat_daddr_t; +typedef s32 compat_timer_t; +typedef s32 compat_key_t; +typedef s16 compat_short_t; +typedef s32 compat_int_t; +typedef s32 compat_long_t; +typedef u16 compat_ushort_t; +typedef u32 compat_uint_t; +typedef u32 compat_ulong_t; +typedef u32 compat_uptr_t; +typedef u32 compat_aio_context_t; + +#endif diff --git a/include/linux/compat.h b/include/linux/compat.h index cfc1b6383ae0..af5ac9de4bdf 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -104,8 +104,6 @@ typedef struct compat_sigaltstack { typedef __compat_uid32_t compat_uid_t; typedef __compat_gid32_t compat_gid_t; -typedef compat_ulong_t compat_aio_context_t; - struct compat_sel_arg_struct; struct rusage; From patchwork Wed Apr 25 16:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134354 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1051130lji; Wed, 25 Apr 2018 09:05:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48a+gaMI6snHWGfCxdrgvdEE//baE/sLGNf7Y6RYQKQNLK1oNtZRK954O+QVGx2pK4fQ4Dy X-Received: by 10.167.128.217 with SMTP id a25mr28496126pfn.132.1524672322906; Wed, 25 Apr 2018 09:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524672322; cv=none; d=google.com; s=arc-20160816; b=rNLB1Cdjv3UANKM0OdlbR/Z/bYV0hKDO6xfd34lRSO540aeTSi/eUdVshGsR5EsoHP 6ahETb9/wjl0arGZY8xRUgrPwJlA7kYtHw4P1Jopk+mVF7Wn8LgJWfbjoRBX4+cneXa7 Ts25UWAHEE2Hpz5L42zOtmWqg0v5okMyb3LEbSQS1L5WD8Zd6nyWRX6mUwzUxkPg/cdh 7Yq7+o3bQ+HHQaWPwIY1xVNtHAwJcTJM6NxgXO0mJ4tAruNz7Z6dfSJJEjiYmtp/zoCU dlt8zDdYThcgmeSaIU6DLJyA7ypl0UG3vCdeQUhub8qca9+c6PIEIhb50tU8iP4AWowi dx8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eUDuP3Z0NHpSwhrI+s14mFXMp/N2EUiYpkgaIHzCvzg=; b=fceB9GFprnM9cxeqYgRB/T5sBlWgS0hSSdRPm6bLpMCzTQQFZ1k1VBg/dV+AQUst8Z L2YJSM3W9uMdjJWkSHsHheD1/AU1YBleFDr4jMbQfnlmUaCaIV+wvAZPgwQTxvsw7sMh ZxjvHtBn37FIrHoUQSk1L7+TQeUnMWstMgoq49dMFuQI9kMI2BJpyAIAcsAzGyuaO/fD W/Rn8jNLGqPmsNoqNf0Ywc+HRqBkeWntWGG+kVPRAcH59nFsFX1MfJoyvH2k++MBgqmc WJghND8dBDEzWp+wioAXLWvONLy2WylLq8Dp0aVzWQIQfJnjTwUX9bQZQkEE4wWiuzoM erRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14-v6si10617873plj.146.2018.04.25.09.05.22; Wed, 25 Apr 2018 09:05:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755589AbeDYQFS (ORCPT + 9 others); Wed, 25 Apr 2018 12:05:18 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:52585 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755253AbeDYQFO (ORCPT ); Wed, 25 Apr 2018 12:05:14 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M2551-1eNXBy3JVL-00tynP; Wed, 25 Apr 2018 18:03:37 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, netdev@vger.kernel.org, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, albert.aribaud@3adev.fr, Peter Zijlstra , Darren Hart , "Eric W. Biederman" , Dominik Brodowski Subject: [PATCH 12/17] y2038: aio: Prepare sys_io_getevents for __kernel_timespec Date: Wed, 25 Apr 2018 18:03:06 +0200 Message-Id: <20180425160311.2718314-13-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-Provags-ID: V03:K1:4GGlfMGZlOC11z6Bn22ipNGC4iDwHQ1nTxVWJPLi5JaLxEbhSKq KOB7JEmzwnPUCLpov7GluLo1Pt7CTxcZdqYPLRBmBgPV1kQSkxeMRL1+hc/eBqN4bDG6ocF eO1eomsjj9jAwluqw7YFkb4vCIt9efD1q/AcCGgWpn4l5ro8D2TIggbYHOpMDc0JiX2V5dF j8jBy0yb9bddnBJPQfMnw== X-UI-Out-Filterresults: notjunk:1; V01:K0:yEzicpM9y5s=:GpoynPZ0JPhbV/v2tedIep RiZj6qO2l+Et5w68oHl5mFXevFj9/TjsCD7dmdq/rKHrb1HtR5/0DjIVh+OaJfZZ2Bxg2r0r5 1zoiObLi9Ihs9Hdt6crf8uu3J3Sdvbdi3CJgfFAXkMZ3ANZf2ZkmpSL3J17cMyCJs5hhzPO42 dW0ZlYzgZ6ScUPYBh028Y0DOwyy/heMkeOOmZBciQowcgWWRP/QDUTJszPPIzeZrllsTcu+um AqBtduKuUtO4OhkdjeaYBuQPe1vMXrcdbOVDiTwiIWH0bJV/ISGG3eRhJY4F1XTe1Rz0+eA95 UngF8AQvtdMihJwto5lwH8Acbykl8/KzM3hns5QYwTmDkfTTjyCVuHVm58oDN8BF10/nImNxq yh7BNLZQWJtoj6kUlb+2agKcHp9DbP1H+CBiTv4aoQ5Y185wziuuOiblh70MG03wespO5DCeQ M1eb+1NIZHSYimOiK9imrz7M6cWX7QKX0mkXqoL4NpwmRqCgSBsFPFsB9pO7BOLV11zpvgfEq r6D4CdH4kEZ3+T0Vk2mApvJonmrxHCme3Ld4ghN4lbOrjOopHPavbIasna5/JirWwXp0ZLmFN TGNvAHT/tXUTZep4yLrwG2L533CWDluYCTkERN6BUYMPZWHjh4a2fPWjyEE4YeOIlHIZMgJEc /eC9Mjs5KEwc6BUL63kr3ARnpxXHPBqcxUmyBIcqvZCsTwPA4C+0yZg033UK9oUOWK7s= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This is a preparation patch for converting sys_io_getevents to work with 64-bit time_t on 32-bit architectures. The 'timeout' argument is changed to struct __kernel_timespec, which will be redefined using 64-bit time_t in the future. The compat version of the system call in turn is enabled for compilation with CONFIG_COMPAT_32BIT_TIME so the individual 32-bit architectures can share the handling of the traditional argument with 64-bit architectures providing it for their compat mode. Signed-off-by: Arnd Bergmann --- fs/aio.c | 4 ++-- include/linux/syscalls.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.9.0 diff --git a/fs/aio.c b/fs/aio.c index 88d7927ffbc6..64fea8c27b16 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1858,7 +1858,7 @@ SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, long, min_nr, long, nr, struct io_event __user *, events, - struct timespec __user *, timeout) + struct __kernel_timespec __user *, timeout) { struct timespec64 ts; @@ -1870,7 +1870,7 @@ SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id, return do_io_getevents(ctx_id, min_nr, nr, events, timeout ? &ts : NULL); } -#ifdef CONFIG_COMPAT +#ifdef CONFIG_COMPAT_32BIT_TIME COMPAT_SYSCALL_DEFINE5(io_getevents, compat_aio_context_t, ctx_id, compat_long_t, min_nr, compat_long_t, nr, diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 2619678359ee..ffd8674e9df7 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -289,7 +289,7 @@ asmlinkage long sys_io_getevents(aio_context_t ctx_id, long min_nr, long nr, struct io_event __user *events, - struct timespec __user *timeout); + struct __kernel_timespec __user *timeout); /* fs/xattr.c */ asmlinkage long sys_setxattr(const char __user *path, const char __user *name, From patchwork Wed Apr 25 16:03:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134351 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1050635lji; Wed, 25 Apr 2018 09:05:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hJvZYe9W8DSkZwHijlRO2YfrEAYjj2XdXI8m3WWtmFtQnvTsKPAaniwrE/gmNGO6VFRZR X-Received: by 10.99.182.66 with SMTP id v2mr22669003pgt.158.1524672303017; Wed, 25 Apr 2018 09:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524672303; cv=none; d=google.com; s=arc-20160816; b=bJw6+qVK/2ySah/kIJUrxlKja4tkpcQxYIzOScbI/3zKDBWpgXe2OsDgQwC/+L5JV4 rZvhw58lxMJ98GhM0o2JafyhySkXnB/cLadfzEnGHm0Bz0ld3mnTXT6chEhrVO+toQai pV0C5HzPFYyNn/IVDH3py5qoSq8PlE88lnjUG1RI5MM3uiu1kYz7o5K2SmIGi6Jf9HI7 bdafYmDMBQQztYH6g3pD0jGSn8/KQus/UdMx6fj4pt/TBRHdTNUrcW0Ssc2n3KgeTPnX KmrtqJbRAsn1bhDzg7ltHdRPZoBl1W4YjxoQrUpTUKyLdsW/FPliGiZn3kFVz5UP7G8k TF1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=zMIC4FMpv4a6xmhQ5eufQ73u4pGz5FnRZCc8yzRcON0=; b=XEycT4keAJVPKQIfNKage8n+Ph5WaA6krN5xnZnbKbHdErYQA5S24lC+bgRr8EHJi6 zXBvsOGdkieomz7emupHR4aL1evYA2MgEbBp+/tntgfnueZOhXKF/Hb15C0tv+BNtAx4 1dZHemhebSi3EHlRxaWpWRliIBRPBdDtkpo+aIO+t8l3dhzYzJA7PNHEnW7IOMekhhQO GXmGl9QYVIM2ajKtGaS6r+/YSxJN8HHjTPlPBRY4TOzlw1SZk0CDud2k2BsS86Qze586 0mnMh9DCGOnzTuUTQKdY+V0y+Yr6qqN6nr0Cvjm3cVPry8mCT7eNedRs1+HGAaCiPdSa 8YAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14-v6si10617873plj.146.2018.04.25.09.05.02; Wed, 25 Apr 2018 09:05:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932140AbeDYQEn (ORCPT + 9 others); Wed, 25 Apr 2018 12:04:43 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:40331 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755477AbeDYQEg (ORCPT ); Wed, 25 Apr 2018 12:04:36 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LsQ2q-1eDsQO46vY-011zXI; Wed, 25 Apr 2018 18:03:41 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, netdev@vger.kernel.org, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, albert.aribaud@3adev.fr, Peter Zijlstra , Darren Hart , "Eric W. Biederman" , Dominik Brodowski Subject: [PATCH 17/17] y2038: signal: Add compat_sys_rt_sigtimedwait_time64 Date: Wed, 25 Apr 2018 18:03:11 +0200 Message-Id: <20180425160311.2718314-18-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-Provags-ID: V03:K1:O0tl35BX+FVRGiY7DYb8Pwh7dwKgNq2jlymsKjQ7HmDg4+G3hmU UnEhnvY0qus6+HVvQPkhVOb9huQ4jzCuAk0/sOjgGGTKiczmKZwpMQJZXM37sSdcW60wRRY WPFRkWF+Yci9KOyTVo0souBilbJdSGecvBCU7TyWKz0u6TApA+OoS5w+XnGQMnWdolbXyim 1yPBMlf2oKXo5v5eYG96w== X-UI-Out-Filterresults: notjunk:1; V01:K0:WbVlpHaoNGg=:ZwReD+umxITXrp3SV90uTG 2wOE5mvsGkezl+JcfqILpWaKumCzXblvtd7NDNTzrFdob3t77cdrscxh6DwmMGYr2kLF174Mr 01HBaMIzLOQMmNlT+4b5BLC4I44vxo5KrPsKRJ/1hPN/7Ea7AAPM4Qr5oBtcpZCEdZvJfmWer CeX5h8Tpy2oFSPwvI3cSEaI0+nv9mo6ufoD/ER0fCumBGHFSpLtdOWL3BJjkTD5hpM3ExJnoO DH6XyF83pwvE62uziiZlk6T1f2vPrXcja7LbbEJvz77JnMZNN4lypZh2Lf0rWsArVvrIaB3N0 lArOTd4zTPyQdOwyK/BKlHvbn393DhW4zVNzLHPpP0nfwDKtlioGCtMJMKCGnxFZRFxg3iFTI 0aOtQbwy2yrgm6F9Fc5KFLHRGEe71hn2RR6hf6toFPO/JCUtVVKWkfZ9tVX0WrZ9YtBFMFCCX Zg9RjJTQjlhYxi4U7bu82V6QRhnqO612xLNr8DrBvymyLPhuyvYgGj1c/U68rBe4m8htYhEiR lK2s8BJm7jX+CMt9XZj9+ONGq4NRWSuw5SPZQUM2DtHWeltvDuMFJvoNhiRFzOd5/e6bogUHF vm43722rWpikKGmvx4Z/Sih/H8fwwxLiBa1eYHPflqATwcIOhe4UUQIWKm05SAbtQs4l9MP9A wTtxp1MMYnAJwY9MLwuzzw0eDGDw6lVd7C7G1ALcCq2XbmwtDIUO8/TpRd7gdo+2BbIk= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that 32-bit architectures have two variants of sys_rt_sigtimedwaid() for 32-bit and 64-bit time_t, we also need to have a second compat system call entry point on the corresponding 64-bit architectures. The traditional system call keeps getting handled by compat_sys_rt_sigtimedwait(), and this adds a new compat_sys_rt_sigtimedwait_time64() that differs only in the timeout argument type. Signed-off-by: Arnd Bergmann --- kernel/signal.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.9.0 diff --git a/kernel/signal.c b/kernel/signal.c index 72609c6835fd..1927fcfa7077 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -3249,6 +3249,38 @@ COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese, } #endif +#ifdef CONFIG_COMPAT +COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait_time64, compat_sigset_t __user *, uthese, + struct compat_siginfo __user *, uinfo, + struct __kernel_timespec __user *, uts, compat_size_t, sigsetsize) +{ + sigset_t s; + struct timespec64 t; + siginfo_t info; + long ret; + + if (sigsetsize != sizeof(sigset_t)) + return -EINVAL; + + if (get_compat_sigset(&s, uthese)) + return -EFAULT; + + if (uts) { + if (get_timespec64(&t, uts)) + return -EFAULT; + } + + ret = do_sigtimedwait(&s, &info, uts ? &t : NULL); + + if (ret > 0 && uinfo) { + if (copy_siginfo_to_user32(uinfo, &info)) + ret = -EFAULT; + } + + return ret; +} +#endif + /** * sys_kill - send a signal to a process * @pid: the PID of the process