Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp499896ybh; Tue, 21 Jul 2020 00:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDLVzrafVtOT+CTa/271kQfy5OypeUUmg9n3WwGemQrhGpiWSb+ERB01I+PLvbRROnHbs6 X-Received: by 2002:a05:6402:947:: with SMTP id h7mr24685481edz.213.1595315261459; Tue, 21 Jul 2020 00:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595315261; cv=none; d=google.com; s=arc-20160816; b=SolD9hSemY3acdoNmUaDQPiiTIuKl9398Hy0V/eYIC0cryJOXTrh2AyTNd46y9Uort 58w9OOxD7IMIP1KtTxeGOaGjo89joz8CfNbsi3hP7lY0/omgCtCGQdvI/2ZXFsZFGIC4 chIzZkR0glnDDX9mnS/LIgMoLvkdNWrJgc4G08wD0LhDuhzzVvGD5axYIcgMxb/SvbDz Bs2y84uvODnoc4Dx1gIvso7ohgUshkSdFd06nn2JJGMXSRIX/0EHVvaXfMcxB1ntOqqF CcaPqO2k03cxD/NVfWyZo5nNjLZi23w8hjVA9e4awiGGsvlfleq12LKUi2xYDxgHCXm6 VPgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/8c2T9BKeytWkNWpJbXeg1MbT1NqF12QIaTU93pvUNc=; b=GfjXEjrqVWMDJMMOkPQNonaezDCL+PB3aAuCX6I7REwl4MFHwSFzeS6FWHagBHaq/u s9ku1MuM3I6qSe2yMuY+choOnT+xmjzISihLk4xabkKLDgw9T2cUjL8LI3yLBJc9ieMH PA1UlrZnLMGex/I4wI5u3yVJgtyrn7/JuIVg1SseoN75KqUErT6xpfu3jCE4G+psVFt3 0peQ6s9drBaBXgjaYJIjuM2A4+Q9q4iIKIp7pQKO1yYqLopOOWY5WeRvm0CPuQzyLyZN z+2SloUNRGaDbbmOcjJCXrcDQ1aP9LbZLUDCC8GdKPsefNR8JyEaIEVA3crRuqsrIs4n ECNA== 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 l8si11215328ejc.665.2020.07.21.00.07.18; Tue, 21 Jul 2020 00:07:41 -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 S1728472AbgGUHHN (ORCPT + 99 others); Tue, 21 Jul 2020 03:07:13 -0400 Received: from verein.lst.de ([213.95.11.211]:50851 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726474AbgGUHHM (ORCPT ); Tue, 21 Jul 2020 03:07:12 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8BF9468AFE; Tue, 21 Jul 2020 09:07:09 +0200 (CEST) Date: Tue, 21 Jul 2020 09:07:09 +0200 From: Christoph Hellwig To: Andy Lutomirski Cc: Jens Axboe , Christoph Hellwig , linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org Subject: Re: io_uring vs in_compat_syscall() Message-ID: <20200721070709.GB11432@lst.de> References: <8987E376-6B13-4798-BDBA-616A457447CF@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8987E376-6B13-4798-BDBA-616A457447CF@amacapital.net> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 20, 2020 at 10:28:55AM -0700, Andy Lutomirski wrote: > > Sure, I'd consider that implementation detail for the actual patch(es) > > for this issue. > > There’s a corner case, though: doesn’t io_uring submission frequently do the work synchronously in the context of the calling thread? Yes. > If so, can a thread do a 64-bit submit with 32-bit work or vice versa? In theory you could share an fd created in a 32-bit thread to a 64-bit thread or vice versa, but I think at that point you absolutely are in "you get to keep the pieces" land. > Sometimes I think that in_compat_syscall() should have a mode in which calling it warns (e.g. not actually in a syscall when doing things in io_uring). And the relevant operations should be properly wired up to avoid global state like this. What do you mean with "properly wired up". Do you really want to spread ->compat_foo methods everywhere, including read and write? I found in_compat_syscall() a lot small and easier to maintain than all the separate compat cruft.