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 DB8C6C43465 for ; Sat, 19 Sep 2020 16:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F86021741 for ; Sat, 19 Sep 2020 16:21:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600532519; bh=tnnKVle7uGlb4ye6ETfPhESD0icbWeK+NnxFIW79sro=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=HvFnwMiplx4hbCrklxXJBD41I4aOVy+lRo1rwy7y+DBcXdZ1lHHC6BTdl6v/O/GBM brK0S3bJiU8O4+vO6Kh2aiegOysDbcumDLZEPGspgMPI2Kw/6ASaVOd2V/bqjA40gZ sHLNzyEpJSyFNTUdp9ExC6vNVsI/E8ykypqXdhcs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbgISQV7 (ORCPT ); Sat, 19 Sep 2020 12:21:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:59042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgISQV6 (ORCPT ); Sat, 19 Sep 2020 12:21:58 -0400 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 79D19235FA 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-f47.google.com with SMTP id e16so8577340wrm.2 for ; Sat, 19 Sep 2020 09:21:57 -0700 (PDT) X-Gm-Message-State: AOAM532+Sok3EA2hb7LMmc1c/UmNVKohHR7/MPSewwfBzqTEC2dULMdi 9Y6XcbRfFAnnqQb6OnNsD8L1btPBWTHhj6ySEM2RQg== 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: io-uring@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?