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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B5D7FC43463 for ; Sun, 20 Sep 2020 13:56:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 206A021531 for ; Sun, 20 Sep 2020 13:56:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 206A021531 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2B76A6B0071; Sun, 20 Sep 2020 09:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2324B6B0072; Sun, 20 Sep 2020 09:56:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 121686B0071; Sun, 20 Sep 2020 09:56:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id CD7C96B0072 for ; Sun, 20 Sep 2020 09:56:07 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 928941EE6 for ; Sun, 20 Sep 2020 13:56:07 +0000 (UTC) X-FDA: 77283588774.07.alley97_4e034152713d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 6F9D71803F9A8; Sun, 20 Sep 2020 13:56:07 +0000 (UTC) X-HE-Tag: alley97_4e034152713d X-Filterd-Recvd-Size: 5204 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by imf07.hostedemail.com (Postfix) with ESMTP; Sun, 20 Sep 2020 13:56:06 +0000 (UTC) Received: from mail-qk1-f170.google.com ([209.85.222.170]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MG9To-1kGhUO3de8-00Gaw7; Sun, 20 Sep 2020 15:56:05 +0200 Received: by mail-qk1-f170.google.com with SMTP id n133so12160532qkn.11; Sun, 20 Sep 2020 06:56:04 -0700 (PDT) X-Gm-Message-State: AOAM530rQHANjaxgdpvEokAqY0VoaCR5GN8NmlY9q7hy4zTr/de/9+Y9 n44KsZd7Wx0v/grVykZxS2uGLOKGcqK4SKKypRI= 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 Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , David Howells , Linux ARM , "the arch/x86 maintainers" , "linux-kernel@vger.kernel.org" , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-block , linux-scsi , Linux FS-devel Mailing List , linux-aio , io-uring@vger.kernel.org, linux-arch , Linux-MM , Networking , keyrings@vger.kernel.org, LSM List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:TYofK64oU3Hpf3DGP7ClueeiCXQtjgbtINK9pOP1iIYcKf0XfsN lp0EG3vBgvrreOBRLQbsn13dG8kGEO2w/t4epQKfMGRxC/4sM2PNhZ9zHMTB4SxeUcGWldM bMwduSEzf67+rEZz71O4vfbhvZzeif/yu/tFZ+xgkC9MmCO4DDVsl/LSJYR/8XxKCBiNYhM L7I1EwZ55Z+1Kox+l0kIQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:NSMJzXDOnsk=:UFumWwMcJlGrvpJyPekvCX R5tCPnk4B51XO6H5NfOFayaHkjKa5Z4LNMD3JLPWipzqXydTySC/XcLU5IylR4w9eLtmE+cqo yVjppFloSQvRIbe0M5UCopgH2uk6rIc8r6lSVPLVmJjoRwQ5KA+bSIQUYCqF39OodEfS/2Egm U3/d/XgxFyI6sjEX53/7HqOMBKQW++1QPllbrv6FFDGFQUEeaRixCbGkSErS+c6zGMiTBriZ+ gbQMRLEyTb7me98UDI6vw0HLWo4HAvtk8YLuKviuxu258dbZInsIJgBIwrvr0pzwgdGZ8wnnH FpnlPiO8kJTFZj97t87VytdFWvbUjlZ0s9V/4ObQ3MatZujEpN39xA1QI0XTV/J5TSSEHRDYt qMPnA8G3FgjP52y74oaBUXEs9bpEjJ68UTjZS1/hzk5rlZzTIeMOU5YRzikRQDtEyhNopxl0x kTXABalbSWNERp62Y04KRX+F76mJ5qy7KR/2x0ffO7NRfe6pHEL/Oh4AJdjZx/K9qm/Ky7ymP YElJW2wqoFVLDD41LfPdZHROQHODN44lYdYtqrox9c2bdWWLNaJxGHHZNxtgKsyl0IMZUEf8Q aWJlRI18XRf6/U/+GU0W7iwt96XTxvXDJNRUqAnkDX/c7ffAGZq3kwfVpCCFiBdP4iRnujMir zdAaRO6w/b6fvOKGeJDC3jEZsysLp7PDb5c7Rm9+u6Y8BMDmb8bmGAfHKOK9rjDBwd2tM0NSV ditwzmbZuo2kXRXThhixpm3MkAKxIi9o0EzQcu2iL3Jaq4bHexvF6PsgmrRujyvTvarRM2B1P jh1ZRJAxc6huZZGEBi+p7nKiNBV+4q+i4IkhMku6+kWf7v2d+D2v+zEOGdAAU2XeGD91Zdl X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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