Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4062605pxk; Tue, 22 Sep 2020 09:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTnQM06XawZhFJRnEQ/cR4j1V0CI/zuZ6Y0H5MkMREhjMWcYgKRdfvWstBLxEsPMejDWCz X-Received: by 2002:a17:906:8695:: with SMTP id g21mr5636112ejx.504.1600791722730; Tue, 22 Sep 2020 09:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600791722; cv=none; d=google.com; s=arc-20160816; b=PvdYK/ihlAKyX0R6JkcmBquTBNo58dTChG9Gs1DjrJG6vDfSRKy6LByWc37//jiXOO zYHmKde+f9sntu/CVOXscx0X4ly9BaeTzrq+6UZPGXki8WNn5Ve2a301KFXP/LlK16pb bAfY00CMi9+ZzMfPRImM1ed/Jm0hNtZvhjpVq/vzpQ2o7ThunHZ3ipf3XldzImHCeBzz VXJe7V7av86HJr1zY6TibhcvOz5X7G9O/baijRCtbk9bWI8MHy/sneeLICPntlWBKiAL kBD8B/Tr8QfB+y3heeXH6kdKZ0K1wYGeiFqtgmgNRFC9Lqphr4mH9UhkakgnxD/xbhDz epcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:in-reply-to:cc:references:message-id:date :subject:mime-version:from:content-transfer-encoding:dkim-signature; bh=OuYZ36WnxwIp9b6camA1INonBCd7PS5F7n5lbvDtQoE=; b=d56WejzSb5jZawT0mkf9zb3iXudfSjLXAddzzFGN1OBJVW7A5OTtodbuttKxppOccF NdDVMJFA5D2ZHlS010uJylW60mSl9wtE3qqAKC96GgDPkepE/TSJo7HLuFisAHwkL9Ye hPORNJsxVChUqPHM4sFnXiMD34mnfBC/r12ZxGHB1cEqojxz5xjAQl4KpwG98WzccOCf W3gXfV/7fpSDQaL2SxUVmicf2htyOQiE1t9Nd0iYxEu44+FqgqXf+5jVq0ntAveP87if hhBYwoSn9T3OnAhxvJ+H7ROYW2zdpWpH7spDdOK7G5N9Pto/YRI8LuIlGjpM5d2M00sv XEhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=vkrTbtOH; 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 p18si10619373edy.100.2020.09.22.09.21.36; Tue, 22 Sep 2020 09:22:02 -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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=vkrTbtOH; 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 S1726714AbgIVQUR (ORCPT + 99 others); Tue, 22 Sep 2020 12:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbgIVQUO (ORCPT ); Tue, 22 Sep 2020 12:20:14 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BB63C0613D7 for ; Tue, 22 Sep 2020 09:20:14 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 7so12349690pgm.11 for ; Tue, 22 Sep 2020 09:20:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=OuYZ36WnxwIp9b6camA1INonBCd7PS5F7n5lbvDtQoE=; b=vkrTbtOH4vHnR/84aYqVDHrQ5AGvI5gJZ+epaaRbPDginNWZ7IQOaHp0KiQGLoRIqK lCtpCBfEppwh5xdm5Fg2E09yGBsQ1omUh0FsVnB0AGbc0KabsZevsMs5kdugIv8CVE5/ WA4g4A2X6yhuybhLsZ26G3b/9jK9koGpq3H8xumPWJXJrnSzbLUYbfDR++IgN0bKoBQq n0DG/oDelKPnE35WpGCvEELD66Jz17cs7lC56sr6mITihQA1DVJ1mt9BGhniHUyWF6Lh zzYPOu4uBf4nQ34xtWqSlA6XpnJ8NFviCNNpjE2H0nhrpatshwJ5hPmeTiRqtrX3VMpc QmhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=OuYZ36WnxwIp9b6camA1INonBCd7PS5F7n5lbvDtQoE=; b=AhJgak1VS3VpVhY/yYNLUVorm83+8DUnIOmaNHw9nyOBTtUMPtZ2OadWI7/p+kiOpw xrWGZeF/do4kpoigHmY75pSNYSwesjEhNE7Ebj980TaCyAum/BGMae7/djXtSrNHH3iA 5e6naZu9DJLOk+t0SH6gcZXcoyUY1711A1kj5JKGcqghxY/sC9Z2OHyevM3Ns33bcTXU nsXNmpgvlrJVdhE1fl537CkaFxUUgwvabDBgwFhBdPB5VWl8tEC3f/mIhbrKTl0Mm3pp Q8ffxxVVA/huFsyY02KBp6afihwLqenptTv7/18EL2WvzokhythnTE5Hq9FHul7LGAw5 X99Q== X-Gm-Message-State: AOAM533tokSlG5ojwciB/uBMTyZHY6YQVJDsNjMN1Di1m4PVrCJbhHAX CnynOau9s8Vt8lzn1SadadPgfSKW7l9HNQ== X-Received: by 2002:a17:902:fe88:b029:d2:2a16:254 with SMTP id x8-20020a170902fe88b02900d22a160254mr5598643plm.23.1600791613205; Tue, 22 Sep 2020 09:20:13 -0700 (PDT) Received: from localhost.localdomain ([2601:646:c200:1ef2:f4bd:fe2:85ed:ea92]) by smtp.gmail.com with ESMTPSA id gk14sm2982522pjb.41.2020.09.22.09.20.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Sep 2020 09:20:12 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Date: Tue, 22 Sep 2020 09:20:07 -0700 Message-Id: <446566DF-ECBC-449C-92A1-A7D5AEBE9935@amacapital.net> References: Cc: Pavel Begunkov , 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 In-Reply-To: To: Arnd Bergmann X-Mailer: iPhone Mail (18A373) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Sep 22, 2020, at 2:01 AM, Arnd Bergmann wrote: >=20 > =EF=BB=BFOn 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 w= rote: >>>> 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? >>>>=20 >>>> I diffed a not-saved file on a sleepy head, thanks for noticing. >>>> As you said, there should be an SQPOLL check. >>>>=20 >>>> ... >>>> if (ctx->compat && (p->flags & IORING_SETUP_SQPOLL)) >>>> goto err; >>>=20 >>> Wouldn't that mean that now 32-bit containers behave differently >>> between compat and native execution? >>>=20 >>> 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: >>=20 >> The intention was to disable only compat not native 32-bit. >=20 > 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. >=20 > 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. >=20 >>> Can we expect all existing and future user space to have a sane >>> fallback when IORING_SETUP_SQPOLL fails? >>=20 >> 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. >=20 > 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? >=20 >=20 I don=E2=80=99t have any real preference wrt SQPOLL, and it may be that we h= ave a problem even without SQPOLL when IO gets punted without one of the fix= es discussed. But banning the mismatched io_uring and io_uring_enter seems like it may be w= orthwhile regardless.=