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=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 84D05C47257 for ; Mon, 4 May 2020 13:43:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 648F920752 for ; Mon, 4 May 2020 13:43:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="TE0iYyWa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728290AbgEDNnN (ORCPT ); Mon, 4 May 2020 09:43:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726922AbgEDNnM (ORCPT ); Mon, 4 May 2020 09:43:12 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBC33C061A0E for ; Mon, 4 May 2020 06:43:11 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id h12so23753pjz.1 for ; Mon, 04 May 2020 06:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QAn+2RM7soSoqdOBHN+11VsA1mCP/YaXzCZebzqANzo=; b=TE0iYyWaTh8bQ7IhHQUx/YbRFRnMkI4YDJatk7J/aBL01J5cQhnQxteoR6dI47x2WM 9w6GKjsw2MxaEcoWrmr/sfBb3M1hW9o+V38nO1wdEs99XhLm+b2sfzz39ExcH7Z7lrZ8 3hh+1EqtCInJBgFUsAjijAZjvXJGKLf9i3PXhKlPubiiU6+tfcNv7UkM+PY/8BPiU/+d 0CoCZeT/EiobAGwHu4cy1D0QsKI5zVK1WHzdEKSvmisLf2zRy7QYw/rrIHiUOHZ8dhxs uJZKIS6sSR+EKs2QnO8trbgF6u3PH7lG36bjbej6xNQnma4QOJvC2lWBsb9KM2jn0a0+ JAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QAn+2RM7soSoqdOBHN+11VsA1mCP/YaXzCZebzqANzo=; b=p2LLPAQ4nNAW+tycSfDjCrG03zUwUqh1GlP+D/oVCQJgl+VjG9WzOV1rYcEr/Oikgy PKe1z9cpL/z27Aqc+HepkivuFBh9y8LWe1dKVuMoSR2tPzJxtMHy6wE8GyE/f4/7IzUv FHPoh3XpOyk9qRN14C0A/fgcktwuzet/lZrOqe/NGu23WCCnuUKgN55zp+B2UttG4FqV Qx1ZNaumKPS366P1iOhdBsNkGqfWQK1ZGfPVsVDud3R5ltua+wZHcnrHatnDp+md6135 qAnf4F3dylB6nWyLHv6xnYDy43dtm0ZySiVho1iGbnTiH273GdcFXNvarmecaizmycnN 2tJQ== X-Gm-Message-State: AGi0PuZ5OTN7babtsF9Xq6t6mTPjUwy2YvqIIRTk64JqomI2Fanz4h/d 0Lkdv71Mk+zQ5+4byFnGJnNqJA== X-Google-Smtp-Source: APiQypKVxfCwaRhwua444a4sKxbwU/GHLXZIu8GXcoaQjL6NbjBrUVGGq7g2rF/uM+Rfwd9g0kYMdA== X-Received: by 2002:a17:902:9693:: with SMTP id n19mr18232346plp.277.1588599791407; Mon, 04 May 2020 06:43:11 -0700 (PDT) Received: from [192.168.1.188] ([66.219.217.145]) by smtp.gmail.com with ESMTPSA id a23sm8908180pfo.145.2020.05.04.06.43.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 06:43:10 -0700 (PDT) Subject: Re: [PATCH 1/2] splice: export do_tee() To: Pavel Begunkov , Jann Horn Cc: io-uring , kernel list , Alexander Viro , linux-fsdevel , Clay Harris References: <56e9c3c84e5dbf0be8272b520a7f26b039724175.1588421219.git.asml.silence@gmail.com> <387c1e30-cdb0-532b-032e-6b334b9a69fa@gmail.com> From: Jens Axboe Message-ID: Date: Mon, 4 May 2020 07:43:09 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <387c1e30-cdb0-532b-032e-6b334b9a69fa@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/4/20 6:31 AM, Pavel Begunkov wrote: > On 04/05/2020 14:09, Jann Horn wrote: >> On Sat, May 2, 2020 at 2:10 PM Pavel Begunkov wrote: >>> export do_tee() for use in io_uring >> [...] >>> diff --git a/fs/splice.c b/fs/splice.c >> [...] >>> * The 'flags' used are the SPLICE_F_* variants, currently the only >>> * applicable one is SPLICE_F_NONBLOCK. >>> */ >>> -static long do_tee(struct file *in, struct file *out, size_t len, >>> - unsigned int flags) >>> +long do_tee(struct file *in, struct file *out, size_t len, unsigned int flags) >>> { >>> struct pipe_inode_info *ipipe = get_pipe_info(in); >>> struct pipe_inode_info *opipe = get_pipe_info(out); >> >> AFAICS do_tee() in its current form is not something you should be >> making available to anything else, because the file mode checks are >> performed in sys_tee() instead of in do_tee(). (And I don't see any >> check for file modes in your uring patch, but maybe I missed it?) If >> you want to make do_tee() available elsewhere, please refactor the >> file mode checks over into do_tee(). > > Overlooked it indeed. Glad you found it Yeah indeed, that's a glaring oversight on my part too. Will you send a patch for 5.7-rc as well for splice? -- Jens Axboe