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 67190C2D0E2 for ; Tue, 22 Sep 2020 09:01:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E62C7208A9 for ; Tue, 22 Sep 2020 09:01:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E62C7208A9 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 1316790003D; Tue, 22 Sep 2020 05:01:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0B62190003F; Tue, 22 Sep 2020 05:01:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBEDB90003D; Tue, 22 Sep 2020 05:01:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id CE734900036 for ; Tue, 22 Sep 2020 05:01:53 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9BAA7180AD80F for ; Tue, 22 Sep 2020 09:01:53 +0000 (UTC) X-FDA: 77290104906.24.power77_05039962714c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 6D36A1A4A0; Tue, 22 Sep 2020 09:01:53 +0000 (UTC) X-HE-Tag: power77_05039962714c X-Filterd-Recvd-Size: 6309 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by imf12.hostedemail.com (Postfix) with ESMTP; Tue, 22 Sep 2020 09:01:52 +0000 (UTC) Received: from mail-qk1-f182.google.com ([209.85.222.182]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1N0nvJ-1khNal3Q6H-00wlJ2; Tue, 22 Sep 2020 11:01:51 +0200 Received: by mail-qk1-f182.google.com with SMTP id c62so5079136qke.1; Tue, 22 Sep 2020 02:01:50 -0700 (PDT) X-Gm-Message-State: AOAM531aLvQzPexbb5kmre6MzEWc9UIaoZW56w2EO6Tsc/P0l6oGoIk/ guwHlbiO539DpEaIcZ+crRAFxTddEjR4cLFQa04= X-Google-Smtp-Source: ABdhPJyRqkNrv5vljO58DCgwZZgH8gYzn8Pg1f10DkzXAekHvwLoBvZT9T4MCMOwP2QMtNaCPo1tGJEV8E4gZYbkeUE= X-Received: by 2002:ae9:c30d:: with SMTP id n13mr3794670qkg.138.1600765309262; Tue, 22 Sep 2020 02:01:49 -0700 (PDT) MIME-Version: 1.0 References: <563138b5-7073-74bc-f0c5-b2bad6277e87@gmail.com> <486c92d0-0f2e-bd61-1ab8-302524af5e08@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 22 Sep 2020 11:01:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag To: Pavel Begunkov Cc: Andy Lutomirski , Christoph Hellwig , Al Viro , Andrew Morton , Jens Axboe , David Howells , linux-arm-kernel , X86 ML , LKML , "open list:MIPS" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-block , Linux SCSI List , Linux FS Devel , linux-aio , io-uring@vger.kernel.org, linux-arch , Linux-MM , Network Development , keyrings@vger.kernel.org, LSM List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:X1aDYPqhW1ZKCFdYaRRuIRPlX+4rfChrEuWtUNx70yGqL2HIGFR MAZfHmLCTshhEOY5XdxHmCvbIduDXeqQ7sT/93nyvpFd8P7D3ZmoSh2DZ81F1l4lz3HBbqn vVuI9gmOg+4UnRkgkoYhbEmY5THwME3BPfb9zIElFsI6ivJA+JiY44hv/S58OFlfrydQSkB ozMeWGdFdivO8Z27i3F1g== X-UI-Out-Filterresults: notjunk:1;V03:K0:Qfl9HzRBR+g=:Qx7EMs53CKPMbC6Psavt/7 8lO/Y8FZf3QIpP19eRR+CT6koqlwfVYCVHIJWA6x2EXF+/iFjq9lCyQdOlDJ9Kof5Aao+eAbf FgxSzh8YPptiys9epBXdUP+HTwKq5prWFsoi/mNoQta+EbmoOGei24FuV4PfRo/QEyd+vBd+m PQ6SvAHXvcfjrGtmdazGQJDTUWi65u4ND4N4k4lykkmmswgIo1dRAbBlfDvx7ZvfQivT23zN3 8eYUCjOmduPYvt/w+vh3+HfoF0fhMLjw4nHe7nCcoayea0Y1lMZYj2Ygx5SjMqiWwVleG9rWJ aNoqi30YtHB+Fg/gnpeNOY7cHS6Bydv0j9pM+3xKR3DfDdjjdAyWCa7M01AvmGpNbST9VXCyF yDxTs9+ZLBiU3gYMyMmDLUkBgzsz1DG27nv7UJ6Z93fZqFV0TYY06vw8czCe1HGGZn7old07n PBUPJgVJpnGAG1okCLKCraDW8LUMqG12bP7ei38USI/yqNw2waioYnpfYOEeTyeFBVihJC+Ib zPPwsZPqTeI6k5B/Yq2B7nDPMXM2iB8CpkxfZVrr+vy9f2n1Z95j3/gxhclMAScndW/6JPmuX Y664/Am/+fnwwoy9Nq9POKiXvfI/QMdL5bYyYoMhSxYa3QrKFIJKMb2SwyD2BIHD/g4TxGKVl rz8jkyj0vSfcT6VkqxHBETk5UcB8vgrFVSFOR0FAGEv08fwCuBkLC0sacEX2DyxcYJxOeHG02 uFOQCs65mCyl6O/lhQR1dkPP23sR2By1thmUFTMUe/quIbcDOCP9jJcH+dCdnHglGGRLYYxDn wGN3eJPQ6X9LCytA3QMbqtj1lfZZ9YL8gu7Gsz5Ftb3qfnyMXoUxaZb87jcuJ8c4yfyEllslg Rt/MK95tSG4j5fCF017BZIBvDfuNXtUlO6fIy7YzX1j8SIJVl8OjqfQcl4XVYlRmA6Xx4dyys tbpXNYs2Jg33jvPV5hE+5bll1AkNL0FAWJYrP6QWbUjLwHQS/CId5 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 Tue, Sep 22, 2020 at 9:59 AM Pavel Begunkov wrote: > On 22/09/2020 10:23, Arnd Bergmann wrote: > > On Tue, Sep 22, 2020 at 8:32 AM Pavel Begunkov wrote: > >> On 22/09/2020 03:58, Andy Lutomirski wrote: > >>> On Mon, Sep 21, 2020 at 5:24 PM Pavel Begunkov wrote: > >>> I may be looking at a different kernel than you, but aren't you > >>> preventing creating an io_uring regardless of whether SQPOLL is > >>> requested? > >> > >> I diffed a not-saved file on a sleepy head, thanks for noticing. > >> As you said, there should be an SQPOLL check. > >> > >> ... > >> if (ctx->compat && (p->flags & IORING_SETUP_SQPOLL)) > >> goto err; > > > > Wouldn't that mean that now 32-bit containers behave differently > > between compat and native execution? > > > > I think if you want to prevent 32-bit applications from using SQPOLL, > > it needs to be done the same way on both to be consistent: > > The intention was to disable only compat not native 32-bit. I'm not following why that would be considered a valid option, as that clearly breaks existing users that update from a 32-bit kernel to a 64-bit one. Taking away the features from users that are still on 32-bit kernels already seems questionable to me, but being inconsistent about it seems much worse, in particular when the regression is on the upgrade path. > > Can we expect all existing and future user space to have a sane > > fallback when IORING_SETUP_SQPOLL fails? > > SQPOLL has a few differences with non-SQPOLL modes, but it's easy > to convert between them. Anyway, SQPOLL is a privileged special > case that's here for performance/latency reasons, I don't think > there will be any non-accidental users of it. Ok, so the behavior of 32-bit tasks would be the same as running the same application as unprivileged 64-bit tasks, with applications already having to implement that fallback, right? Arnd