From patchwork Thu Sep 13 15:59:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 146630 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp768467ljw; Thu, 13 Sep 2018 09:00:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY24/zPnopV+D2OcSMRIAHsOSsG21tL03QbD8TjxNmDN9wBmF6Dccvd3dJaEK02SLeTf+K3 X-Received: by 2002:a65:6104:: with SMTP id z4-v6mr7454984pgu.361.1536854428186; Thu, 13 Sep 2018 09:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536854428; cv=none; d=google.com; s=arc-20160816; b=Mx6uqrUtWRFpD/f8CknEVs495cNYUZxEM7E0RxvkRaAEsaXuIk31Ajwx8J6Di6L5jG 2SDDEsJOsAfrfOewJF4UG7R92n0pFJDbmKOMfj1d2uTRvjEI2vElV713xTz0ALmRy5nR dz+LstEK3o0gQBpC0cz8Wq2BKfMT8E9wtPIAdzdZ4UH5KW9woVTs+KZi4mSA86tiBZzq L+DX6VZBekq8pHW8Tb6I7xvp08R/D+vj1At55M26PZegUD727qRUAg2qCKgRoLhk7Iy6 ukXdWrbMJEB+HCwsiLhpZq4gw06pS5idongxT5Qj+Fs00ecyPa5q0vqCnQB3BL91tE+P oZnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=SPjCngiQsBlp2XF19eV4/X4Ljoifsllh8iVn4So+gss=; b=YRgNm5tvtiCU15mTZAk/1ZDuLBCtveQR4N0OWiiDswTMJta2onjmWxsaNn3+lsiuej vjluBlzS9Wli7X203dD9IcgfcK78ATk+PkCnGpGikkAfecQ2G/wW9O5qSLQXDjmeL93Y 4t7HnkcDMwv2gmkWf13uhqtayYv6LEekfg8HiDAkqcv8bySFj7PE5wewTnCMy/97iR3p xI5hsimUCawnxtPCLl12OS/JTSduOo8AM4/v3vfrncY0xAYDGN2jnC2tqbAOQ5TiNMm7 N3tCOyAm2elJ/jOGM/C4Vawar88ff8HPnF45mITPxb8xDdRFxX9fHueOiNWLK9EXmufg I7mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q66-v6si4394475pfk.268.2018.09.13.09.00.27; Thu, 13 Sep 2018 09:00:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728563AbeIMVKc (ORCPT + 32 others); Thu, 13 Sep 2018 17:10:32 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:55123 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726763AbeIMVKc (ORCPT ); Thu, 13 Sep 2018 17:10:32 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1McYTD-1fQJkC26tp-00cuhz; Thu, 13 Sep 2018 18:00:17 +0200 From: Arnd Bergmann To: "James E.J. Bottomley" , Helge Deller Cc: y2038@lists.linaro.org, Arnd Bergmann , Thomas Gleixner , linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC] parisc64: change __kernel_suseconds_t to match glibc Date: Thu, 13 Sep 2018 17:59:50 +0200 Message-Id: <20180913160010.905798-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:vWNPlqFzuf2u7GS8XexfshPCl2Aw1/8WG3vOemmAVO5grvJWPAZ rOasN7CWlRjHw21rU07Re9RJqxwYGkU5HZAC/ajupO1tJK95/rFfo5iyPMZl/LYnbpaZf5M 1G751IEtGrIfmkQHjEHdJPo/OCNQrN2kw4ItlKhWZaINABoF4ktZULUCfa3gL22cL4L9O+X C9fNgfij8riugHvhIQjsQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0VxYlGW9D90=:AUh88BfkOuy2D7g3vEqtR0 /ztA/EdH980MSJ4AP93ojRQ8d3cEXVWkw5vWp1QtJosjA26pocehqBookFLjqL2rN6RBRhsDC 7/ZaJIKQrNwclOzFvt5Af3eGSv2Uhi6JRqiV11vI6DSx8a93ohPpyuHIyrAuImKnErE6gQRss GLYCEpoLblGIgmVL5CPQArhfcs/NyNRRT28HXvi7zTr9H6opxmTDUtwqlnaEVMGUG8rtz0hPY a2M5MjwfCxmKZf3kVuratFLoVNZahhOfQlTbaeZcd521lrLk7bj9kdDXzxrgpNZTCvzCpib0w g6Gs5yY10bDavTcszEsg+5G9UxxK22wtEGB4oRaqkqvwVlWB7dr7tRXCzgWQHR3eINhD7EIQb att4oh/5imnZXLlwgQTQCW5Xh/2UKho53AUMd65POW1yC10/hpI1qfL+odft6cNWZMa9N6GnH 64jlfJuDCw8IcYGUCaMjQWVkyNfmAl0v/Ycc2VN4ZIRAUg1iypDddl2teWnoPgtzI6uhcO9lf AauxF1XOQb+nQU6ygH3z5FBcfZTVNmXgW9EtZvGV2frrQTo5SLXQG58FIqAIIt0qAA7QEnc7o R5wt5Vb4ytYEkkZlEjm4Shr8MFKtDEFHS6xG6pH4y01pPuLrzIng9PNE0K/Vk9PTcju2GLxR0 Yx0Mtx/HR5sFhUct9qf0sn/tbYpVYnJMW4BUvORV+f0tN9N0G0NvczQuiBLaeOfRg+0E= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are only two 64-bit architecture ports that have a 32-bit suseconds_t: sparc64 and parisc64. I've encountered a number of problems with this, while trying to get a proper 64-bit time_t working on 32-bit architectures. Having a 32-bit suseconds_t combined with a 64-bit time_t means that we get extra padding in data structures that may leak kernel stack data to user space, and it breaks all code that assumes that timespec and timeval have the same layout. While we can't change sparc64, it seems that glibc on parisc64 has always set suseconds_t to 'long', and the current version would give incorrect results for gettimeofday() and many other interfaces: timestamps passed from user space into the kernel result in tv_usec being always zero (the lower bits contain the intended value but are ignored) while data passed from the kernel to user space contains either zeroes or random data in tv_usec. Based on that, it seems best to change the user API in the kernel in an incompatible way to match what glibc expects. Note that the distros I could find (gentoo and debian) all just have 32-bit user space, which does not suffer from this problem. Signed-off-by: Arnd Bergmann --- arch/parisc/include/uapi/asm/posix_types.h | 3 --- 1 file changed, 3 deletions(-) -- 2.18.0 diff --git a/arch/parisc/include/uapi/asm/posix_types.h b/arch/parisc/include/uapi/asm/posix_types.h index 2785632c85e7..8dce56f5dcee 100644 --- a/arch/parisc/include/uapi/asm/posix_types.h +++ b/arch/parisc/include/uapi/asm/posix_types.h @@ -16,9 +16,6 @@ typedef unsigned short __kernel_mode_t; typedef unsigned short __kernel_ipc_pid_t; #define __kernel_ipc_pid_t __kernel_ipc_pid_t -typedef int __kernel_suseconds_t; -#define __kernel_suseconds_t __kernel_suseconds_t - typedef long long __kernel_off64_t; typedef unsigned long long __kernel_ino64_t;