From patchwork Mon Oct 24 11:29:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp417021wru; Mon, 24 Oct 2022 05:12:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42p4AhzpcGgnC3+/piwQfsD1VZBa18Fh0evKiPNs1Se2gmKSumK57IH9V+g94qQpbfh95j X-Received: by 2002:a17:903:1105:b0:178:ae31:aad with SMTP id n5-20020a170903110500b00178ae310aadmr32907987plh.3.1666613551597; Mon, 24 Oct 2022 05:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613551; cv=none; d=google.com; s=arc-20160816; b=FXTCLnErgrdHwR8V8D6tlCOFLe+yhczQNrqzQ1ldCGWPMvCG2jbECu0zyGXpVOtt6h CjCQMJaTiNREAmVgDV3JS+U/mGpUfPQsNBOcyK/+Ej60x6ZHTWS9KX6QCMoQxHN0K2X2 5vYQIlS0DW8lguQP8DYB58MqEfGVblzU+w7bSxE+wvAEMwpEvoIAm55aI4QrTBhlCD3Y 66MGLGtNG7T1+QZJvW6x+fupn+2ACkNlooZLc5nIzMnsMD0IlsB+1LMPrDhbaK6g81yy AJ2DQWAMOn/ttSLVxgqmIgqGlJPoyFsVgjWpV3PM7oEYqOdZzh9vOGKqswsdxvyENpqX GcMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fCRKNMoDBltWLfDNcKeccFfKuww49DFJHbqqTKVamUk=; b=Eco5Edg59aJZH/WA28qk23OHmbqpWeolxrmrxnEO12JgYXhi5GDPic8cUQz6iaSuH4 Yq4nm2wT5UR1VGnjeMZEEPl87VoPz3djfL7Xm11RJmGxf82YiM6IkwAGkDQG22LIMDpD CEpSld/2Sj8lq6xPBB5Az2+/pVh4HXYSPN62WzSOzDzyhdHPYv4+NVzzhWrhg/iw1GYG EUkxoP2CxWsu2ohaF0WO9O13Y8n9cNV1VdXhuQrXcu6uxNZBZzRtVFtBhC7cuINa9kwG 4Ve8GPmsCOWaddJfJ9c+d1u5/bDquTnJ18jCmJY6Cge1PbNQuOJwYzO1hLlvqYQPw6Ki aVjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wZYn4lK+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a170903228600b0017f75ce8a2esi38313101plh.575.2022.10.24.05.12.18; Mon, 24 Oct 2022 05:12:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wZYn4lK+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229491AbiJXMBV (ORCPT + 99 others); Mon, 24 Oct 2022 08:01:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbiJXL7J (ORCPT ); Mon, 24 Oct 2022 07:59:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D889B67CAF; Mon, 24 Oct 2022 04:48:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1156861291; Mon, 24 Oct 2022 11:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2749DC433D6; Mon, 24 Oct 2022 11:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612075; bh=qm6vKhVcLtaeb42ubq9uaM2a4mSl/VgbKZoVaXZyZXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wZYn4lK+eaOTDbFB1gaCVZNR2N2zCBAiybBNICb2rk7pM+eAIKnxDHF/CEPMfYkLc 7Bw62jmMBe3S2lkqPjEG8QisBZ3GW8YAfKhzcAFCnHq0pF+xrDBJYQcn413kPOSRGW aK6/+8kRA4n4GosAg4BNsk9mPU7R1rBQfng6T8XQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Saeed Mirzamohammadi , Sasha Levin Subject: [PATCH 4.14 060/210] Revert "fs: check FMODE_LSEEK to control internal pipe splicing" Date: Mon, 24 Oct 2022 13:29:37 +0200 Message-Id: <20221024112958.979609043@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747570971359345547?= X-GMAIL-MSGID: =?utf-8?q?1747570971359345547?= This reverts commit fd0a6e99b61e6c08fa5cf585d54fd956f70c73a6. Which was upstream commit 97ef77c52b789ec1411d360ed99dca1efe4b2c81. The commit is missing dependencies and breaks NFS tests, remove it for now. Reported-by: Saeed Mirzamohammadi Signed-off-by: Sasha Levin --- fs/splice.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/fs/splice.c +++ b/fs/splice.c @@ -898,15 +898,17 @@ ssize_t splice_direct_to_actor(struct fi { struct pipe_inode_info *pipe; long ret, bytes; + umode_t i_mode; size_t len; int i, flags, more; /* - * We require the input to be seekable, as we don't want to randomly - * drop data for eg socket -> socket splicing. Use the piped splicing - * for that! + * We require the input being a regular file, as we don't want to + * randomly drop data for eg socket -> socket splicing. Use the + * piped splicing for that! */ - if (unlikely(!(in->f_mode & FMODE_LSEEK))) + i_mode = file_inode(in)->i_mode; + if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) return -EINVAL; /*