Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1217865pxk; Fri, 18 Sep 2020 07:00:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZdjB3CFCFZ1z5GJRtet/PI8qjMd77MEwicxKXmZ9p4c8UiRIAxR63sTTMyHpHyEmzpFms X-Received: by 2002:a05:6402:3075:: with SMTP id bs21mr39145688edb.236.1600437634638; Fri, 18 Sep 2020 07:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600437634; cv=none; d=google.com; s=arc-20160816; b=anmklq7jionlbEpEi2hgYD8oW7kHho9RI3WlPsTcVB2iqlCHFPOmM5UxPxjfldiMoY LwORAJ5Yqr6GDQiC1ugGYXaw5qtX9pAvB7koHwFSvm5eZnn+9PnfL+OqRdo2khSTjBpb iftTxcEsn6fK0O4pbs6BNSMmr3HiyRXL7SKMCFTqpEH8238Mb8qfY08GR7f78FQCgnwn Arj4/K57nStBb76CHnIQS8w0TV4Ke0/ownwOwBONWXncjWP0P4YDGk8w4/t3wykw/pPr pH5ZB45eRcbzG4UUgMfhCfrwP8MFandCsy6PGEyPXJYjZgKqtqYUukFKgwGbCFDXF/0P /v7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=SkCAY/U16AGbgb3fYU9tfRGs2QYZoFrMjdAjn167hNU=; b=PoRg01rkoChAmefDnztyXMcDTK+PdIEFkWbOeM5CIVPbscTtxCc4EuDbk7J6Q+8/Pw 0gtWukEAQksFWgxWF/fyB+GW9Tyj/C3qf8E9KAKbs29cbEDESRDgxl+oNE/2KUfKQFW9 C/GQMeVynepuGd4ZQhEywzpm46InDD8YFwZeVW7bNzWrtu0hbl8bAESP9oURQ4EfjgBS CuSB/BPBkZOxDLV1R2n4FfDY6D5vwyhFMCtThAmaPzmQMTFz9KsnMBBZcz17HU2169pI X21dG/0rOYqYGaYpk7vdnlSBQEe/1NC0yVNloEu+IqcSwFof7YZEl14UuhJ6UUEmTUcI FDLQ== 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 ss23si2135658ejb.350.2020.09.18.07.00.09; Fri, 18 Sep 2020 07:00:34 -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 S1726782AbgIRN6a (ORCPT + 99 others); Fri, 18 Sep 2020 09:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbgIRN63 (ORCPT ); Fri, 18 Sep 2020 09:58:29 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB3AC0613CE; Fri, 18 Sep 2020 06:58:28 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJGu6-0014uQ-9R; Fri, 18 Sep 2020 13:58:22 +0000 Date: Fri, 18 Sep 2020 14:58:22 +0100 From: Al Viro To: Christoph Hellwig Cc: Andrew Morton , Jens Axboe , Arnd Bergmann , David Howells , linux-arm-kernel@lists.infradead.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag Message-ID: <20200918135822.GZ3421308@ZenIV.linux.org.uk> References: <20200918124533.3487701-1-hch@lst.de> <20200918124533.3487701-2-hch@lst.de> <20200918134012.GY3421308@ZenIV.linux.org.uk> <20200918134406.GA17064@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918134406.GA17064@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 03:44:06PM +0200, Christoph Hellwig wrote: > On Fri, Sep 18, 2020 at 02:40:12PM +0100, Al Viro wrote: > > > /* Vector 0x110 is LINUX_32BIT_SYSCALL_TRAP */ > > > - return pt_regs_trap_type(current_pt_regs()) == 0x110; > > > + return pt_regs_trap_type(current_pt_regs()) == 0x110 || > > > + (current->flags & PF_FORCE_COMPAT); > > > > Can't say I like that approach ;-/ Reasoning about the behaviour is much > > harder when it's controlled like that - witness set_fs() shite... > > I don't particularly like it either. But do you have a better idea > how to deal with io_uring vs compat tasks? git rm fs/io_uring.c would make a good starting point Yes, I know it's not going to happen, but one can dream... 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...