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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 74E5EC43466 for ; Sat, 19 Sep 2020 16:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48B0223119 for ; Sat, 19 Sep 2020 16:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600532520; bh=tnnKVle7uGlb4ye6ETfPhESD0icbWeK+NnxFIW79sro=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=ZvJrIsSPYTdTtK+QIlyiH7Cg9S01UE/a7RbPo+3osAlGv2OBC6Rv4h8GVKRFtHpXu vA7a6DV//qDFOfgPhoot5A/xgvkDGsVw5PAkGngn1Xubbc4pEBXkdoZWE9LNZOf4j3 Tf5LzScrgdj+bdRocD+fzkVs3Fck7w/eSGEIod2o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726635AbgISQV6 (ORCPT ); Sat, 19 Sep 2020 12:21:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:58994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbgISQV6 (ORCPT ); Sat, 19 Sep 2020 12:21:58 -0400 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B29D2158C for ; Sat, 19 Sep 2020 16:21:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600532517; bh=tnnKVle7uGlb4ye6ETfPhESD0icbWeK+NnxFIW79sro=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QrIUAAqT1dp8+jrXrF0kfdV5PIOJITY8xSkYh8pnrNFPmM98EPjnnqgiUheWM3Zz4 0qTg36uFIa2gFwlgsZXnXxJdaWIK0Dls7hdq0zd60qlpvRgxcHCvRNqCi9kc1myB6l slKQU2ILvCXePIOP8ZGSdUV9ciTDnkbyjJ8h5bj0= Received: by mail-wr1-f49.google.com with SMTP id s12so8547776wrw.11 for ; Sat, 19 Sep 2020 09:21:57 -0700 (PDT) X-Gm-Message-State: AOAM530Eus83To8RicUN2rZvkAFML0QBYpFqfl/C7ZO4vagcl2/12EfZ 4DycMUGM1CeR9g2aUBNDLFWq4IrCfycrZSlpjOowaw== X-Google-Smtp-Source: ABdhPJwBFQKjUG5Ajrf8DpZFR91CZN4BHC9/gKbhMJfUTwAnV0GCUbZx28T5SkvcVSnD9FMlBdmx1p4waD7HgdNSIPM= X-Received: by 2002:a5d:5281:: with SMTP id c1mr43283094wrv.184.1600532515963; Sat, 19 Sep 2020 09:21:55 -0700 (PDT) MIME-Version: 1.0 References: <20200918124533.3487701-1-hch@lst.de> <20200918124533.3487701-2-hch@lst.de> <20200918134012.GY3421308@ZenIV.linux.org.uk> <20200918134406.GA17064@lst.de> <20200918135822.GZ3421308@ZenIV.linux.org.uk> <20200918151615.GA23432@lst.de> In-Reply-To: <20200918151615.GA23432@lst.de> From: Andy Lutomirski Date: Sat, 19 Sep 2020 09:21:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/9] kernel: add a PF_FORCE_COMPAT flag To: Christoph Hellwig Cc: Al Viro , Andrew Morton , Jens Axboe , Arnd Bergmann , 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@kvack.org, io-uring@vger.kernel.org, linux-arch , Linux-MM , Network Development , keyrings@vger.kernel.org, LSM List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Sep 18, 2020 at 8:16 AM Christoph Hellwig wrote: > > On Fri, Sep 18, 2020 at 02:58:22PM +0100, Al Viro wrote: > > 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... > > That would help to not introduce a regression with this series yes. > But it wouldn't fix existing bugs when io_uring is used to access > read or write methods that use in_compat_syscall(). One example that > I recently ran into is drivers/scsi/sg.c. Aside from the potentially nasty use of per-task variables, one thing I don't like about PF_FORCE_COMPAT is that it's one-way. If we're going to have a generic mechanism for this, shouldn't we allow a full override of the syscall arch instead of just allowing forcing compat so that a compat syscall can do a non-compat operation?