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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 1963DC169C4 for ; Thu, 31 Jan 2019 15:07:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D95D3218D3 for ; Thu, 31 Jan 2019 15:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548947224; bh=WIopZViXdSoCYGUhCc1pz0dPjXupHGy1p9xWewFns0o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=cPhdB+exZgYOicnN+ERaJkBj7T2NUpo4wrN+7Me997o6hSz7kn73cwooFMdYnpcbe wSKC+GR5A2S8PgQhntiI5q9cYpg7INY5xfdSge/3VSJX7f9cWGgItan6mhmAXYifvQ fnW9r5Mym5eUDXXqjIlatkBPrYmXcXMSsodPe3AU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbfAaPHE (ORCPT ); Thu, 31 Jan 2019 10:07:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:57380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfAaPHE (ORCPT ); Thu, 31 Jan 2019 10:07:04 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 22AA2218AF; Thu, 31 Jan 2019 15:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548947223; bh=WIopZViXdSoCYGUhCc1pz0dPjXupHGy1p9xWewFns0o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MogU4bgu1YamJIhlLzABCwgEDrj3w67Vh1FuqQUczODbB1oZ/6fVrSEJy50JcP3/S 7RqkjM1WYeb0D5RajvcBJxBspdwEUQXA7sfAG0va2N45ApnGo649zUvWXgDYGI/50S LkeodJRcL5oxotR2E6nEZVHdEzoakGZZPiNbeTBs= Date: Thu, 31 Jan 2019 16:07:01 +0100 From: Greg KH To: Jimmy Durand Wesolowski Cc: stable@vger.kernel.org, David Woodhouse , Amit Shah , Stefan Nuernberger , Frank Becker Subject: Re: [PATCH 1/1] fs: add the fsnotify call to vfs_iter_write Message-ID: <20190131150701.GB5621@kroah.com> References: <1548944379-21257-1-git-send-email-jdw@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548944379-21257-1-git-send-email-jdw@amazon.de> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Jan 31, 2019 at 03:19:39PM +0100, Jimmy Durand Wesolowski wrote: > A bug has been discovered when redirecting splice output to regular files > on EXT4 and tmpfs. Other filesystems might be affected. > This commit fixes the issue for stable series kernel, using one of the > change introduced during the rewrite and refactoring of vfs_iter_write in > 4.13, specifically in the > commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write"). > > This issue affects v4.4 and v4.9 stable series of kernels. > > Without this fix for v4.4 and v4.9 stable, the following upstream commits > (and their dependencies would need to be backported): > * commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write") > * commit 18e9710ee59c ("fs: implement vfs_iter_read using do_iter_read") > * commit edab5fe38c2c > ("fs: move more code into do_iter_read/do_iter_write") > * commit 19c735868dd0 ("fs: remove __do_readv_writev") > * commit 26c87fb7d10d ("fs: remove do_compat_readv_writev") > * commit 251b42a1dc64 ("fs: remove do_readv_writev") > > as well as the following dependencies: > * commit bb7462b6fd64 > ("vfs: use helpers for calling f_op->{read,write}_iter()") > * commit 0f78d06ac1e9 > ("vfs: pass type instead of fn to do_{loop,iter}_readv_writev()") > * commit 7687a7a4435f > ("vfs: extract common parts of {compat_,}do_readv_writev()") > > In order to reduce the changes, this commit uses only the part of > commit abbb65899aec ("fs: implement vfs_iter_write using do_iter_write") > that fixes the issue. > > This issue and the reproducer can be found on > https://bugzilla.kernel.org/show_bug.cgi?id=85381 > > Reported-by: Richard Li > Reported-by: Chad Miller > Reviewed-by: Stefan Nuernberger > Reviewed-by: Frank Becker > Signed-off-by: Jimmy Durand Wesolowski > --- > fs/read_write.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/fs/read_write.c b/fs/read_write.c > index ba28059..9819f7c 100644 > --- a/fs/read_write.c > +++ b/fs/read_write.c > @@ -392,8 +392,10 @@ ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos) > iter->type |= WRITE; > ret = file->f_op->write_iter(&kiocb, iter); > BUG_ON(ret == -EIOCBQUEUED); > - if (ret > 0) > + if (ret > 0) { > *ppos = kiocb.ki_pos; > + fsnotify_modify(file); > + } > return ret; > } > EXPORT_SYMBOL(vfs_iter_write); Nice catch! Queued up now, thanks. greg k-h