From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:33878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752147AbcHHSBa (ORCPT ); Mon, 8 Aug 2016 14:01:30 -0400 Subject: Patch "vfs: ioctl: prevent double-fetch in dedupe ioctl" has been added to the 4.6-stable tree To: sbauer@plzdonthack.me, gregkh@linuxfoundation.org, torvalds@linux-foundation.org Cc: , From: Date: Mon, 08 Aug 2016 20:01:35 +0200 Message-ID: <14706792953093@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled vfs: ioctl: prevent double-fetch in dedupe ioctl to the 4.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: vfs-ioctl-prevent-double-fetch-in-dedupe-ioctl.patch and it can be found in the queue-4.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 10eec60ce79187686e052092e5383c99b4420a20 Mon Sep 17 00:00:00 2001 From: Scott Bauer Date: Wed, 27 Jul 2016 19:11:29 -0600 Subject: vfs: ioctl: prevent double-fetch in dedupe ioctl From: Scott Bauer commit 10eec60ce79187686e052092e5383c99b4420a20 upstream. This prevents a double-fetch from user space that can lead to to an undersized allocation and heap overflow. Fixes: 54dbc1517237 ("vfs: hoist the btrfs deduplication ioctl to the vfs") Signed-off-by: Scott Bauer Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/ioctl.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -590,6 +590,7 @@ static long ioctl_file_dedupe_range(stru goto out; } + same->dest_count = count; ret = vfs_dedupe_file_range(file, same); if (ret) goto out; Patches currently in stable-queue which might be from sbauer@plzdonthack.me are queue-4.6/vfs-ioctl-prevent-double-fetch-in-dedupe-ioctl.patch