From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A2FBC43463 for ; Sun, 20 Sep 2020 19:03:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 18D02207D3 for ; Sun, 20 Sep 2020 19:03:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DUceRzNY"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="g5wq+0/n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18D02207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aez0p7yxG04+hxkcPKhqyUkQuSglVCHGcAHq2dnuzLk=; b=DUceRzNYM4Xfscpu3XqBmEvq6 JG3HBYE6iStgnSYAZ6bvY5v7OvKQDRR2T7LwmX24efYjSB56GrfBXBZb86Lm2Yg/MoJkLBxktE1Iv h8jtM2LDv3GzRLNFW38qrKV6+gbARDMJrFdz619BtxlHkaah4UWJHIr3tam/TpOTRquLrNp4rpCgE YUd6+rAayTQqgAk7hsCPfRNCXucDH4UC5krDhS92CpzJRpb3Hwgoyuc70gwkVuheVVzJIlJhovsvC BSNdDzi9FG8N4pgpXjqeczGQlVCB9V4gWkzUFV0lPWuwuPfBe/UmeFACuQALkHVkQpBPmEAf2k/uQ Z8XIxaT4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK4b4-0001lF-SN; Sun, 20 Sep 2020 19:02:03 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK4b2-0001l6-OW for linux-arm-kernel@merlin.infradead.org; Sun, 20 Sep 2020 19:02:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=IDW3RmS0RDwF1PxkMWRCY+cTnTy0vBsZViqlQFFmOdo=; b=g5wq+0/nR7te7B4gJNw+xxZEh4 vIYebQdoarMEpWmpRDhj1bWsfYD36OHjLCErlQNaLSUq8CTrXuLatwHN9B+K+KO1QIhzWqG7Z6waK del3pmKFJAAuj35sQYQznNEe+qO0m5iu5fRGSMsKcikhX7RyrIn/RWw/VFHRk4mWe6oZMZa9R6Je1 oGcYf/SOT5wxGjakHifLpr17yPf4i9EhX/Cy94JdQ9a5xDZHTyc0bbRlyh+8XGfdroAgldwfZpb7H 4VqjUhxS1EFiueOXW0SA9H6gHtPsQs2vFJVBdst+6vs08n2gMA9frgF4VF0y0tLMDhkql0UrCuprC yBGQJbwg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kK4b1-0000nk-2G; Sun, 20 Sep 2020 19:01:59 +0000 Date: Sun, 20 Sep 2020 20:01:59 +0100 From: Matthew Wilcox To: Al Viro Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Message-ID: <20200920190159.GT32101@casper.infradead.org> References: <20200918124533.3487701-1-hch@lst.de> <20200918124533.3487701-2-hch@lst.de> <20200920151510.GS32101@casper.infradead.org> <20200920180742.GN3421308@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200920180742.GN3421308@ZenIV.linux.org.uk> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aio@kvack.org, linux-mips@vger.kernel.org, David Howells , linux-mm@kvack.org, keyrings@vger.kernel.org, sparclinux@vger.kernel.org, Christoph Hellwig , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, x86@kernel.org, Arnd Bergmann , linux-block@vger.kernel.org, io-uring@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jens Axboe , linux-parisc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Sep 20, 2020 at 07:07:42PM +0100, Al Viro wrote: > 2) a few drivers are really fucked in head. They use different > *DATA* layouts for reads/writes, depending upon the calling process. > IOW, if you fork/exec a 32bit binary and your stdin is one of those, > reads from stdin in parent and child will yield different data layouts. > On the same struct file. > That's what Christoph worries about (/dev/sg he'd mentioned is > one of those). > > IMO we should simply have that dozen or so of pathological files > marked with FMODE_SHITTY_ABI; it's not about how they'd been opened - > it describes the userland ABI provided by those. And it's cast in stone. > > Any in_compat_syscall() in ->read()/->write() instances is an ABI > bug, plain and simple. Some are unfixable for compatibility reasons, but > any new caller like that should be a big red flag. So an IOCB_COMPAT flag would let us know whether the caller is expecting a 32-bit or 64-bit layout? And io_uring could set it based on the ctx->compat flag. > Current list of those turds: > /dev/sg (pointer-chasing, generally insane) > /sys/firmware/efi/vars/*/raw_var (fucked binary structure) > /sys/firmware/efi/vars/new_var (fucked binary structure) > /sys/firmware/efi/vars/del_var (fucked binary structure) > /dev/uhid (pointer-chasing for one obsolete command) > /dev/input/event* (timestamps) > /dev/uinput (timestamps) > /proc/bus/input/devices (fucked bitmap-to-text representation) > /sys/class/input/*/capabilities/* (fucked bitmap-to-text representation) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel