From patchwork Mon Nov 25 23:03:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11260901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A583314DB for ; Mon, 25 Nov 2019 23:03:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86C5620733 for ; Mon, 25 Nov 2019 23:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574723016; bh=awSI1iSxQbhSMV0m77NwnLOTQKzfcKC3DBlLMmMYNGA=; h=Date:From:To:Cc:Subject:List-ID:From; b=HSvMjsv6SJ1ZBNqnu7OvimDhCTU+DLEuurl59xJnO9yw2BcJ0WWTaWDrE2njy9ww0 RbeEOydNjmN9p8beCnKFuVTZRX2hN1jujfqWnUPPMCrJex0WmOaX+L0NyzVLteQRHP OCJ+13s2ZoG7ENOte707bGQ7ZBgv6NCjL7P+YMhg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726990AbfKYXDa (ORCPT ); Mon, 25 Nov 2019 18:03:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:50552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfKYXDa (ORCPT ); Mon, 25 Nov 2019 18:03:30 -0500 Received: from localhost (unknown [148.87.23.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D41E20733; Mon, 25 Nov 2019 23:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574723009; bh=awSI1iSxQbhSMV0m77NwnLOTQKzfcKC3DBlLMmMYNGA=; h=Date:From:To:Cc:Subject:From; b=WZkLYSU53+TCdd5XbKUpAvsTF6p8uUTt1bP8tiSfGNHTjbY4I4KvZoW7uMxYPBPZX wtyI4r554FqLYpnJpLgBiufq4SJNPVMSaOE/HKg39MEVl6+7JBXTze1MmA8V6NroIK Wmh4hpF8HJlZnTniKAWpwqM9wevTUHNoOFVQAebQ= Date: Mon, 25 Nov 2019 15:03:26 -0800 From: "Darrick J. Wong" To: Linus Torvalds Cc: "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, agruenba@redhat.com Subject: [GIT PULL] splice: fix for 5.5 Message-ID: <20191125230326.GS6211@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Hi Linus, Please pull this single patch for 5.5 that fixes some questionable pipe behavior in the splice code. Specifically, whenever we perform a read into a pipe, we now clamp the read request to the length of the pipe buffer since there's no point in asking for more than we can handle. We already fixed this in one place, but Andreas Gruenbacher found another place where we could overflow, and requested a second fix. The branch merges cleanly against this morning's HEAD and survived a few days' worth of xfstests. The merge was completely straightforward, so please let me know if you run into anything weird. --D The following changes since commit 4f5cafb5cb8471e54afdc9054d973535614f7675: Linux 5.4-rc3 (2019-10-13 16:37:36 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/vfs-5.5-merge-1 for you to fetch changes up to 3253d9d093376d62b4a56e609f15d2ec5085ac73: splice: only read in as much information as there is pipe buffer space (2019-10-15 08:44:32 -0700) ---------------------------------------------------------------- New code for 5.5: - Fix another place in the splice code where a pipe could ask a filesystem for a longer read than the pipe actually has free buffer space. ---------------------------------------------------------------- Darrick J. Wong (1): splice: only read in as much information as there is pipe buffer space fs/splice.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)