Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3149899imm; Sun, 14 Oct 2018 12:50:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV60spnBWF28ghE+ohlU0RA8olBps6EM7D6uSAHQBQq1V+oK47zBAk9QRcVZJbUSfD7uJsCmm X-Received: by 2002:a63:4a0e:: with SMTP id x14-v6mr13144653pga.34.1539546657945; Sun, 14 Oct 2018 12:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539546657; cv=none; d=google.com; s=arc-20160816; b=cxUOqZR4VLnPHqk5xCZGulQrqIQouvzHaRhMjyuhHT+5En8rA6QM72P9d4M3CCHGDg XOI+g0TMgGIECWWSyQesm4F0WGMIj8IgHpLQZYMQyMwQ+T72fMpf0oUfyWo2XFgplEoV CwYoLrib1bJ16LV/ziFT3qBzpwyAmCI2HlnhTLJSO19uZXaiG8KcwZLpm98kz+VYFcCZ UBCz8LPNO474o9/s9gOM2UfNz9GWfGM+YwgemhZYpnMdqmle9UBPBZjIPz7K/5z7X6BS tZgDYq56Dg+irZ66vGcurLcDrfKUjAMRfEAFz6jUE4ryOgjbu38AwOTtzc4O5NQnG8Py Uo1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=pi89fFNjq2DxTE+Ppo+G6rtDEmLNPUOvGaFtWbUTl/A=; b=c/HRXVuF9pjWD3PUpOX30CwfmrWUm3Cql6pyN+wtIvWTf9bXc1q/E3EB9/wH9C4YF1 9/OIRBNT2eDADH10kVxMsrNjLt3bi/pE7T+n3sC1DM9/3x7PdfmZ3YMCX+gLRTa2LJZO /YMygukjAw0kPLjnHrJSFYp/StMBlcyPKK/lQ+wjnZOJ9YZaMGymeZ22xIpJzaIPHRfy wTTMEpjOANFVCXHB6TPNTr10hanR7JNc3DhZO1i6wUj5THOJQ/dDvwI0KclFukHhQGG8 zwopXaigD4iuKE85OuFHQoSZhDx0Nehydk/TPRRoBwPZix28v05KsnAh53+1uI4rIjkr PVKQ== 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 r21-v6si8781433pgl.257.2018.10.14.12.50.09; Sun, 14 Oct 2018 12:50:57 -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 S1726623AbeJODbY (ORCPT + 99 others); Sun, 14 Oct 2018 23:31:24 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:36051 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbeJODbX (ORCPT ); Sun, 14 Oct 2018 23:31:23 -0400 Received: by mail-qt1-f193.google.com with SMTP id u34-v6so19283182qth.3; Sun, 14 Oct 2018 12:49:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pi89fFNjq2DxTE+Ppo+G6rtDEmLNPUOvGaFtWbUTl/A=; b=VdZ0Kirl7jXeA/HstIf7iikJHdy3+EXjAgkuZP1k49+ycgVgoYfKBD64n+oJ6NHNtx N9paj+c31NQ6Q/rK7QgrZ5/sqtQrU08u3Xtaxif5ZovAEUhiiGgTZNZkAyK3+qDbOxr/ Xiu3F0+VIcphVTujR1JWQNPDkc3geG+gj90ojBSZ3W79XO9ljTT44CtjLuo/hSHtWNhk QnmAVMIPuh6PaQVW9iDwTUD28hgc9pjBE+gI4HrLX6BAPz4/BSVHIilKXJKpeQGEtG6K 33nHqNw9KW8vs/zKEICc1XyFcIJikCwIeh2sMiat/ofDGgVx9drE/ppty0wpgqOrCUGe oqrQ== X-Gm-Message-State: ABuFfojhfMlhlZ6nNM82NHuDY+luC9vy0xovmeH7yRNmqmhXf0RaG/xX TeJVT2y58Ys5uNNdHLbqu/00tmvryBGbEP0C7wA= X-Received: by 2002:a0c:881c:: with SMTP id 28mr13917792qvl.40.1539546557452; Sun, 14 Oct 2018 12:49:17 -0700 (PDT) MIME-Version: 1.0 References: <20180516081910.10067-1-ynorov@caviumnetworks.com> In-Reply-To: From: Arnd Bergmann Date: Sun, 14 Oct 2018 21:49:01 +0200 Message-ID: Subject: Re: [PATCH v9 00/24] ILP32 for ARM64 To: Andy Lutomirski Cc: Yury Norov , Catalin Marinas , Linux ARM , Linux Kernel Mailing List , "open list:DOCUMENTATION" , linux-arch , Linux API , Adam Borowski , Alexander Graf , Alexey Klimov , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Christoph Muellner , Dave Martin , David Miller , Florian Weimer , Geert Uytterhoeven , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Lin Yongting , "Manuel A. Fernandez Montecelo" , Mark Brown , Martin Schwidefsky , Maxim Kuvyrkov , Nathan Lynch , Philipp Tomsich , Prasun Kapoor , Ramana Radhakrishnan , Steve Ellcey , Szabolcs Nagy Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 13, 2018 at 9:36 PM Andy Lutomirski wrote: > > On Wed, May 16, 2018 at 1:19 AM Yury Norov wrote: > > > > This series enables AARCH64 with ILP32 mode. > > > > As supporting work, it introduces ARCH_32BIT_OFF_T configuration > > option that is enabled for existing 32-bit architectures but disabled > > for new arches (so 64-bit off_t userspace type is used by new userspace). > > Also it deprecates getrlimit and setrlimit syscalls prior to prlimit64. > > Second, ILP32 user code is highly unlikely > to end up with the same struct layout as ILP64 code. The latter seems > like it should be solved entirely in userspace by adding a way to > annotate a structure as being a kernel ABI structure and getting the > toolchain to lay it out as if it were ILP64 even though the target is > ILP32. The syscall ABI could be almost completely abstracted in glibc, the main issue is ioctl and a couple of related interfaces that pass data structures (read() on /dev/input/*, mmap on /dev/snd/* or raw sockets, fcntl). The question whether a data type is laid out like a 64-bit architecture would cannot be a property of the type in most of those cases, because the same types are used elsewhere. Many ioctls just take a pointer to a 'long' or similar, and then you have structures like 'timespec' that are used both in syscall/ioctl ABI and in normal user space code, but are required to be laid out differently there. (timespec is a bad example because y2038 of course, but it illustrates the point). > 2. I think you should make a conscious decision as to whether the > ILP32-ness of a syscall is a property of the task or of the syscall. > On x86, x32-ness is a property of the syscall, but historically it > also got rather entangled with the state of the task, and the result > was a mess. It looks like you're making it be a property of the task, > which is fine, but you're making it impossible for very clever ILP32 > libraries to include little ILP64 stubs that do fancy things with full > 64-bit syscalls. > > 3. Make very certain that you aren't exploitable by malicious > processes that set the high bits in ILP32 syscall args. x86 compat > has issues like that in the past. This point was actually the most important one for keeping the aarch64 ilp32 interface as restricted as it is: it doesn't allow anything that the normal aarch32/armv7 emulation doesn't already provide. Arnd