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 98A1FC43467 for ; Sat, 19 Sep 2020 16:22:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 22F82208DB for ; Sat, 19 Sep 2020 16:22:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="RfHyY7UE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 22F82208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8548B6B0055; Sat, 19 Sep 2020 12:22:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 802F76B005A; Sat, 19 Sep 2020 12:22:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CA8D6B005C; Sat, 19 Sep 2020 12:22:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 4679C6B0055 for ; Sat, 19 Sep 2020 12:22:00 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 067581F1B for ; Sat, 19 Sep 2020 16:22:00 +0000 (UTC) X-FDA: 77280327600.03.cook91_3c0ceb627135 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id DC64228A4EA for ; Sat, 19 Sep 2020 16:21:59 +0000 (UTC) X-HE-Tag: cook91_3c0ceb627135 X-Filterd-Recvd-Size: 3949 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Sat, 19 Sep 2020 16:21:59 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 41D162098B for ; Sat, 19 Sep 2020 16:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600532518; bh=tnnKVle7uGlb4ye6ETfPhESD0icbWeK+NnxFIW79sro=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RfHyY7UEHaYrIbe8hMZ2MtdHVBKJ+bZQK0mI3BGyOnPP65FOEi+hk6c2JRsb35XJY xi9VjvXDgmoKvuQgAP22thdI4BRRUc3MiYXhglRZqdnik/KtdJxND3hwmm6dP/CRei Hdp+s4ggvo+uj/y1Lyp9OpZ6jQ1boX/yMBLTGuuo= Received: by mail-wr1-f48.google.com with SMTP id o5so8544678wrn.13 for ; Sat, 19 Sep 2020 09:21:58 -0700 (PDT) X-Gm-Message-State: AOAM5302v8LRM5vBf0io3F+kSxi8dlPr5lh1+YzU+XMkEe6LiW1n/Pet plliWMG2nbh9TbNu8tt4Ky2a7pjl50jGMll5XTZCDg== 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?