Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3773131pxk; Tue, 22 Sep 2020 02:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymkh5BZo1Ga0gRBNdfglQ72jdWk0gz29rVwGEHiCqaEtWDaZ4lKLiYwvbWcud7x76VWKLc X-Received: by 2002:a17:906:b156:: with SMTP id bt22mr3722572ejb.481.1600765396281; Tue, 22 Sep 2020 02:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600765396; cv=none; d=google.com; s=arc-20160816; b=DO8aZYmqwTXagr5EJdj+E2prMi+2Wdu7LMO4yOpnmS9+fS3WRKCa8QYZoqvhqptup8 QCAPbrhAygim0m2RI5X6Ty0fS2gtFUaSOD3zPObKn9wvIFUAya6+N4QeitAlWMT4BSfO ooeuDqWAhnjmeOJWhfqPZh8+mewzTCZ3gFcGRciLHTkoZ+e6GTxmMYuFGT9Pi5I/n6Gm HZwJqvpaMszYkq/UC7b4ZLa9QBySexllYXoHkq7ruWr6/QcPkUzR3Lz+ahlUwzM1lbWx OjmHoJizPWEbcErfjTVbM7rxvFIRwlGADRSrIRRhqmsY2HZZGUHehwJzUJ6p0upxxZ7n ZbyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mkTEComZkVXXBn7vuihjncEIOuNo9JXyqgtkYpuRl8E=; b=jvw/nzWN+6H1GJfRUBzmmzVsgH9miWTeAHK212srO4efDOA0Kfpdxpnx2ZoCtTjIUW x9dasUlQPowfL6UBwOMbEFt2nO18BlM9w6Rc4/Mbi/sFD3WVbY+8wux3CRxu/uZd58oI nr42Ym3KcBZxHZel5KOmXRsro6FZaE/yf/umGYXAV55vaS/sqUJpWNIZXYloWklhrfgj 9Fa8vmQdnEx2c4EGalQyNnbM29uxNOp8/mqiPwfRhMwE/Elrq/H9OBw7MUq3n98+xKwd cafcDrEgql++i/olvuw3gJobO3wuDLtK4aWjinkHTzyGfbHPv/hhwGBcnLePgJgMarsP tVwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si9919679edu.492.2020.09.22.02.02.51; Tue, 22 Sep 2020 02:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726553AbgIVJB4 (ORCPT + 99 others); Tue, 22 Sep 2020 05:01:56 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:48239 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgIVJBz (ORCPT ); Tue, 22 Sep 2020 05:01:55 -0400 Received: from mail-qk1-f174.google.com ([209.85.222.174]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1M8QJq-1kP1tX30wS-004R66; Tue, 22 Sep 2020 11:01:51 +0200 Received: by mail-qk1-f174.google.com with SMTP id 16so18290762qkf.4; Tue, 22 Sep 2020 02:01:50 -0700 (PDT) X-Gm-Message-State: AOAM531+93v+0pc6Wi7zIypNe7Vgpz/NCT5EEwScNq/ES31+DcqqIzIF wjBHiQJRNRN0efUxhQeFDvY1TrHFTG/Dy6uuW7w= 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:8U3QhqUgQssKpQivIurx1QhO0HcizCTbv9FM2dYjR7qI/BYtgBT aXnBt+gH3i7BkW4ORLrCt4H46/pNjWBK/mpqCyumcjcVfj1/zotel3weBob9uElfz3DwR7K SD73O72POJ3pwjD8gWBnHZGyAwt1MpkpQv9XkBHvto4Q+XAgPzYoa4EjGe8Z/x39gDR9cGO QujCKw+EEJbaSeenNDMzw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lxgMs8VhhiM=:l+UfaADbxVKseh338rQzK0 QfABKRk1uOM8j+TCS6sCwMVp7ftwkOoJIGxGdG6L6VzI7cEX/MhwRXSQNk8YlDVPqekFAwqsJ K748wMagnWb5anQxTXdEkOBo0uWtUSAEwztEdQ2OBKdjwEG1J6pIlrCcDyitdMMoAz861eF0u z2iEwNTG7KaprxuPyh3LpnSFr4t9fNgbzFOS7H+wEZEnC9CeAWNx5wP0L6sE37HsEVzBj0klw rCdMwj/xQX550kfGtz5Tst5P+5qFFcpSycGh7yxzuA7IfUTo0Jtcxxq8Nsoy2hdLMsRB5AeEU hTJ1KV0t+ZNP/UDzzsqu7H5kqZnJRYF/Z8Ji6rftWofkhI6uKJJ8Cfjq8tWrO/UeP3XIf9v2i DQj5nXdMHge7GHqPvPrsVFMyAkUL1J4r8j1ePLIXjlpNWnjVBfzHviGfTGbMYidP8nHyfMUv4 hEG02hwSHv9Zn7QmlN72PGM4XbtnD7nIM85CCGS+B86CUtmOfBWj5gRwwocYygk0Mfzi0STau 9lBglupWtfGYz14JMgT+7eEGaMn3WNy19TESYPhKMsyiDYRSSu38/SERTgtuUQo8ptjsjNOMw hMWuBgTKGkOX+0SeCUD2zOGOi/+ubpkvRVlttuUSAIEUl1xdqDzZNS6siOVdInCDtDO3VcOwL tz/kxsgWRCy7enDEmiF8nZGkmBV+bcNr8kAHKqyZDkcgcSxHstfrPlSvQ8eU70sysdob1c6pH o6m1IdiLADPf36SBZ2b/E1EXaXU5wEKpga7xW5vj4MkINkTWIONy6jvzXbTYJ5RaLNmyXl2Xq CcmZaAJaQnOwp55YtAfNvehwZlUtix7GjXWpSVDKul5QTnf8MdHSUm66q7etTCD1nugbL5krf nX96T+FtWTicJ8P6Rd2wiUyg+fLf10H8SOm4BOpcrhYne4qDBpHCkC3Wl4ydqivn66oeOEyJ9 sHgF+76xRs7ep05tWnMmeiHdPlcAupShCEbkpfyQnpooyIq1sTbAL Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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