From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 68077145B for ; Sat, 19 Sep 2015 00:04:40 +0000 (UTC) Received: from mail.zytor.com (terminus.zytor.com [198.137.202.10]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 16F06172 for ; Sat, 19 Sep 2015 00:04:39 +0000 (UTC) To: Arnd Bergmann , ksummit-discuss@lists.linuxfoundation.org References: <1407895613.3017.138.camel@deadeye.wl.decadent.org.uk> <3758173.O0N9ZgmMoN@wuerfel> From: "H. Peter Anvin" Message-ID: <55FCA686.601@zytor.com> Date: Fri, 18 Sep 2015 17:04:22 -0700 MIME-Version: 1.0 In-Reply-To: <3758173.O0N9ZgmMoN@wuerfel> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: John Stultz , lkml , "Joseph S. Myers" Subject: Re: [Ksummit-discuss] 2038 Kernel Summit Discussion Fodder List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 08/13/2014 01:06 PM, Arnd Bergmann wrote: > On Wednesday 13 August 2014 03:06:53 Ben Hutchings wrote: >>> On the kernel side, it also adds more complexity, where we have to add >>> even more complex compat support for 64bit systems to handle all the >>> various 32bit applications possible. >> [...] >> >> Didn't we need to do this already to support x32? Have compat ioctls >> involving time been botched? > > AFAICT, every ioctl that involves passing a __kernel_ulong_t or > __kernel_ulong_t is potentially broken on x32, and this includes > everything passing a time_t or timespec. > > The problem is that the libc ioctl() function ends up in the kernel's > compat_ioctl handler, which expects the 32-bit ABI, not the 64-bit ABI. > Most other syscalls in x32 however use the 64-bit ABI. > > It works only for drivers that use the same function for .ioctl and > .compat_ioctl, and that encode the size of the data structure correctly > in the ioctl command code. I assume this is how we will do it for all > 32-bit architectures with 64-bit time_t, but on x32 it also concerns > other types that use __kernel_long_t. > OK, super-late reply. Actually we have by and large dealt with that. Sadly this meant an increase in the number of paths with conditional ABI. -hpa From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668AbbISAEl (ORCPT ); Fri, 18 Sep 2015 20:04:41 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56209 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754156AbbISAEk (ORCPT ); Fri, 18 Sep 2015 20:04:40 -0400 Subject: Re: [Ksummit-discuss] 2038 Kernel Summit Discussion Fodder To: Arnd Bergmann , ksummit-discuss@lists.linuxfoundation.org References: <1407895613.3017.138.camel@deadeye.wl.decadent.org.uk> <3758173.O0N9ZgmMoN@wuerfel> Cc: Ben Hutchings , John Stultz , "Joseph S. Myers" , lkml From: "H. Peter Anvin" Message-ID: <55FCA686.601@zytor.com> Date: Fri, 18 Sep 2015 17:04:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <3758173.O0N9ZgmMoN@wuerfel> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/13/2014 01:06 PM, Arnd Bergmann wrote: > On Wednesday 13 August 2014 03:06:53 Ben Hutchings wrote: >>> On the kernel side, it also adds more complexity, where we have to add >>> even more complex compat support for 64bit systems to handle all the >>> various 32bit applications possible. >> [...] >> >> Didn't we need to do this already to support x32? Have compat ioctls >> involving time been botched? > > AFAICT, every ioctl that involves passing a __kernel_ulong_t or > __kernel_ulong_t is potentially broken on x32, and this includes > everything passing a time_t or timespec. > > The problem is that the libc ioctl() function ends up in the kernel's > compat_ioctl handler, which expects the 32-bit ABI, not the 64-bit ABI. > Most other syscalls in x32 however use the 64-bit ABI. > > It works only for drivers that use the same function for .ioctl and > .compat_ioctl, and that encode the size of the data structure correctly > in the ioctl command code. I assume this is how we will do it for all > 32-bit architectures with 64-bit time_t, but on x32 it also concerns > other types that use __kernel_long_t. > OK, super-late reply. Actually we have by and large dealt with that. Sadly this meant an increase in the number of paths with conditional ABI. -hpa