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 E5047C43465 for ; Sun, 20 Sep 2020 13:58:10 +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 6FFDE21531 for ; Sun, 20 Sep 2020 13:58:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PnGLZgTU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FFDE21531 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xiAZwyAUJ2ykLKbPNjmd4p/1JyPN/h1cKSX+hu/5mU4=; b=PnGLZgTUtXZnaBTV9MWxHO37b uwbauwTs6MrRu7XlJIbkEtoqBxjY/v7LuHuFZHyQKVbDTpVhHAwzWwS/JvmS9modlTgqxqvk05tGq Fa+ALlZCYg8o7vSfc/S5gYeVyQzJbY1yjlm0imxif195PoretGt3BiIDI9AI35MTy8tI4WL9Nqxcc s02oZuh1nRTsfHmuBmc5oe3isPxCuBgDX0dyy49fVdsPmeQiJ5nbtzu2rXc7k96cbjYuvvFSOA3Gt 1WMRS9B2nznFEQ3VbP42RJRKH2hLIhHzI4oHeWUNRBt1Jztl168xPXaZDV6Lgeqv+zsmZGxJwPzr1 QpeSX+pTw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJzp7-0002Ap-HN; Sun, 20 Sep 2020 13:56:13 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJzp4-00029W-7f for linux-arm-kernel@lists.infradead.org; Sun, 20 Sep 2020 13:56:11 +0000 Received: from mail-qk1-f170.google.com ([209.85.222.170]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MCayD-1kAP2B06nj-009eFB for ; Sun, 20 Sep 2020 15:56:08 +0200 Received: by mail-qk1-f170.google.com with SMTP id v123so12167747qkd.9 for ; Sun, 20 Sep 2020 06:56:04 -0700 (PDT) X-Gm-Message-State: AOAM5335GzyUU2fdRlSRiUyGmBWJxPaTlFkBdDp/Ttvpqp36clNdK79T HDkXOToq08CQRdNeLenCMwXRI9q6hspSD5IWL3k= X-Google-Smtp-Source: ABdhPJwjhkL3KLtOGKzNMPo/as4noBlQ9Jb8z4PXaKINeNIOOA3tWOtTq+bHeowiwT9kTTVa6K2ILOsBaWuTHLMSx30= X-Received: by 2002:a37:a495:: with SMTP id n143mr41151530qke.394.1600610163343; Sun, 20 Sep 2020 06:56:03 -0700 (PDT) MIME-Version: 1.0 References: <20200918124533.3487701-1-hch@lst.de> <20200918124533.3487701-2-hch@lst.de> <20200918134012.GY3421308@ZenIV.linux.org.uk> <20200918134406.GA17064@lst.de> <20200918135822.GZ3421308@ZenIV.linux.org.uk> <20200918151615.GA23432@lst.de> <20200919220920.GI3421308@ZenIV.linux.org.uk> In-Reply-To: <20200919220920.GI3421308@ZenIV.linux.org.uk> From: Arnd Bergmann Date: Sun, 20 Sep 2020 15:55:47 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag To: Al Viro X-Provags-ID: V03:K1:RABhf7LmX0PU/A73pK6ELzke+zDMVQDoBmBGTM8mpaiqk6QVyQ7 deUoJ4x1/dDD+qEosm8D//WLloV/tyXpeghhfw7WDhAaR1f2ZnZz93sxPdFs3cB0zZaXOvm Rw6ZLt/kTgS7gEbxwUeCqNVkcVm5ITYJlPAuPD1L1myPeuT/1XAGDopVt6J52NWKCsXHPvP dGw7588pp+1uuNAK/laKQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:bzQfzH4L9EQ=:AbYz1290Rs9TQgxl6wB+NB tHztjxpaols4UhmHiRTXhXp4VjpSebqmZQOKHQzV72P6DlJqNF5TjUAC6kqSpQqt9dy76XxDJ UrTRQgVH36SVZtj4fJXKKpoIWteRcy/4ceTECVenKljTCRH08mvxIYqnARflt/vvCJDP38vwe HdwGpGxvToDEsbh48RGNbHQ4zisuaEOGGDCGax86u1p+0jsNl7s5KIZ/H2tdj6OkmQqNP0jB6 JdzeTPXoNpC4x9kkZOVTUhAwE+n8xowSxDnjHvQcfqf/W4wxnP7PVcEfkf1EazOL/aZHZ668J S/yEbBO1uDEDOFmy3s9bJPW51UKl9gT3T+J3zTFDUCM1Ptv1Sd2uVk/weZSDVK3Ge9ViQdraM 5RIkRX7Hj4zUr0zbes/2oNbCOH4ZsDwUgdIpWiqpl34rWim58mOIcyB5cQIGc2FV6ly/YaNST qN1bx9gkPChogSXFvZigqz+GaXhSMsnwk05Y9yfTVWIT/pkSu1esgvoWbVtl1Bfa1ingxavDp V5H/zbtKIDCTxBBDatyQ78JvEoEK+TKCAej0Xg1qiq1rbX9BTPjKd4Bm5dFvJbH9+VnYf5qMJ xlK7bIhC2X7bFpYoxZKClF/qYWN5FfqlM/CtPLFWE4nVR45ESSETjIZ/0PF3y4GUsYRWl5p0C E82WTH2tNjfAfpYkwVDeu1EMLRd0r4nT42JoUWUJYE4Byud0b9NzhcyGEilqajfTICfv06lvw VBfM5OsaTfBwFaP7lI9RO30Go4MkUjyO+nN3igeEOdUTyx6kve3AnkMcDnMxhl5bAkh3xRHkb U+cbRxwHJP7wm6wiN3nB5IqZlCf0Mf70R0Dlgo5YB8KuwR5dMHm1VwLxT0yNwdNYCa/mK9rsI FtqSF7MkRk7Hbccq3JNR+VyhbusTIDCACT3xrD6cqGeX92i08jUpz+b2i/c6v5bSmh6g3mwuR 7012P7AK2Xo9sAXbuLGn5fc0LoDcVk55t9u9KUfuHFgoWhGbi32fs X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200920_095610_936534_F67D74B2 X-CRM114-Status: GOOD ( 23.49 ) 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 , "open list:BROADCOM NVRAM DRIVER" , David Howells , Linux-MM , keyrings@vger.kernel.org, sparclinux , Christoph Hellwig , linux-arch , linux-s390 , linux-scsi , the arch/x86 maintainers , linux-block , io-uring@vger.kernel.org, Linux ARM , Jens Axboe , Parisc List , Networking , "linux-kernel@vger.kernel.org" , LSM List , Linux FS-devel Mailing List , Andrew Morton , linuxppc-dev 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 12:09 AM Al Viro wrote: > On Fri, Sep 18, 2020 at 05:16:15PM +0200, Christoph Hellwig wrote: > > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > > Said that, why not provide a variant that would take an explicit > > > "is it compat" argument and use it there? And have the normal > > > one pass in_compat_syscall() to that... > > > > That would help to not introduce a regression with this series yes. > > But it wouldn't fix existing bugs when io_uring is used to access > > read or write methods that use in_compat_syscall(). One example that > > I recently ran into is drivers/scsi/sg.c. > > So screw such read/write methods - don't use them with io_uring. > That, BTW, is one of the reasons I'm sceptical about burying the > decisions deep into the callchain - we don't _want_ different > data layouts on read/write depending upon the 32bit vs. 64bit > caller, let alone the pointer-chasing garbage that is /dev/sg. Would it be too late to limit what kind of file descriptors we allow io_uring to read/write on? If io_uring can get changed to return -EINVAL on trying to read/write something other than S_IFREG file descriptors, that particular problem space gets a lot simpler, but this is of course only possible if nobody actually relies on it yet. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel