Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2010376pxk; Sat, 19 Sep 2020 09:25:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUPurnb6FHE4DulpUhpZmnR1d0S7IaktbYLifd/5RJ6HUzWaxpsMaHTvBSD2QGFmdoi8q7 X-Received: by 2002:a17:906:4c51:: with SMTP id d17mr41316168ejw.28.1600532728206; Sat, 19 Sep 2020 09:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600532728; cv=none; d=google.com; s=arc-20160816; b=aFAva428rIvdLFBWCtK/7gRduzyomcdSg2A1tlgUJUea1t6dHRTh9fx5pkKViNLf4p WGzne+yjWOI6O5wPFxs25K5iYUOg/Z8orNVqxibjNSbdQg1otYSp1J35PeMEu0DmBTFM 5bL2I41XEv3p4z8UAGDN4yiPCgtRcmaPialX1quwbiaeaaiscdD/fJIGrO/+1NvWzabc p+Rqkx/bMX1XKUqqgoOkrgYtVzJp9bLhhXKvQw+uyNdq5Vb5BKLt0/BAeqbxEAqDqwE4 dGsAlhZvevEeagxLmNPnnJmHrWtX0q2CTX5/U9Nu54UyV8Tn+qcHmiLN7MgEix4JIRGF bCIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=K0fQeZEU21TOEyqvsaA0DEWuWPhlvm8vaqoE3oKZYdk=; b=D9ib+AT7gi5Upx+RitqwIm6XoEqXC2cbsnbVlVWqLcvac9eJOyBm5jvz3G7gogoCtA m2GVwNfXBJCJALTQ+sxBjAABgaw4O93IzU7PscMb0gQd2KXj654huKp23+XAiIsdU54j F70k+zKumsetjA/WfB2oVnIaF7doRmA+/5adHgKlSsqN/mB18PrhWRm8iDZeIAoFkZ46 UO1kKcx+MNpincndeHkN5mGJQ1kmYdhEIFvDAis7d0msG9ekyoIAFHYmutvUMrIWioqi gDU5CWPIszScuv6gC4I9PRavRDH/MXuws6OMchDxROEu0XT0CniKSmoltmx6RplpyLdZ KATw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QrIUAAqT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn4si5478730ejb.143.2020.09.19.09.25.05; Sat, 19 Sep 2020 09:25:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QrIUAAqT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbgISQWD (ORCPT + 99 others); Sat, 19 Sep 2020 12:22:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:59034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgISQV6 (ORCPT ); Sat, 19 Sep 2020 12:21:58 -0400 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 6C3542311B 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-f46.google.com with SMTP id z1so8573052wrt.3 for ; Sat, 19 Sep 2020 09:21:57 -0700 (PDT) X-Gm-Message-State: AOAM5319lqGRt+GOkpo5U+giJPyZwcXK74IsX+XDrnPwfULldzzh5f8F Vhxk0culyDGqsve0iaRrVgWQz6bikgNTu50goQsQOw== 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-kernel@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?