From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4091220628634494826==" MIME-Version: 1.0 From: Christoph Hellwig To: lkp@lists.01.org Subject: Re: [fs] 36e2c7421f: kernel-selftests.splice.short_splice_read.sh.fail Date: Sat, 19 Sep 2020 07:07:39 +0200 Message-ID: <20200919050739.GA7038@lst.de> In-Reply-To: <202009181443.C2179FB@keescook> List-Id: --===============4091220628634494826== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, Sep 18, 2020 at 02:49:19PM -0700, Kees Cook wrote: > In response to my recent bug fix for splice vs sysfs binary handler[1], > I added splice testing for other pseudo filesystems[2], for which the > test output is seen above. > = > What is the final verdict on the "should splice have a fallback mode?" > question[3]? Right now /proc and /sys reject splice attempts (which, as > I mentioned in the thread, is fine by me, since it would have blocked > the bug I had to fix from ever being exposed in the first place). The verdict is: without a set_fs()-like mechanism that allows uaccess routines to operate on kernel buffers, or even worse a compat_alloc_user_space-like mechanism we can't have an entirely generic fallback. > Should I update the test to _expect_ that splice should fail? I think so. We can updated individual file operations to support splice where actually used applications except it (even when they shouldn't), but I'd rather not do it just for a test case. --===============4091220628634494826==-- 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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 D3224C43463 for ; Sat, 19 Sep 2020 05:13:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C3CC22208 for ; Sat, 19 Sep 2020 05:13:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726159AbgISFHm (ORCPT ); Sat, 19 Sep 2020 01:07:42 -0400 Received: from verein.lst.de ([213.95.11.211]:34840 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgISFHm (ORCPT ); Sat, 19 Sep 2020 01:07:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id C9EBB68BEB; Sat, 19 Sep 2020 07:07:39 +0200 (CEST) Date: Sat, 19 Sep 2020 07:07:39 +0200 From: Christoph Hellwig To: Kees Cook Cc: Christoph Hellwig , Al Viro , LKML , lkp@lists.01.org, lkp@intel.com, kernel test robot Subject: Re: [fs] 36e2c7421f: kernel-selftests.splice.short_splice_read.sh.fail Message-ID: <20200919050739.GA7038@lst.de> References: <20200917012542.GF28738@shao2-debian> <202009181443.C2179FB@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009181443.C2179FB@keescook> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 02:49:19PM -0700, Kees Cook wrote: > In response to my recent bug fix for splice vs sysfs binary handler[1], > I added splice testing for other pseudo filesystems[2], for which the > test output is seen above. > > What is the final verdict on the "should splice have a fallback mode?" > question[3]? Right now /proc and /sys reject splice attempts (which, as > I mentioned in the thread, is fine by me, since it would have blocked > the bug I had to fix from ever being exposed in the first place). The verdict is: without a set_fs()-like mechanism that allows uaccess routines to operate on kernel buffers, or even worse a compat_alloc_user_space-like mechanism we can't have an entirely generic fallback. > Should I update the test to _expect_ that splice should fail? I think so. We can updated individual file operations to support splice where actually used applications except it (even when they shouldn't), but I'd rather not do it just for a test case.