Thread (99 messages) 99 messages, 4 authors, 2016-08-10
STALE3620d

[PATCH 4.6 95/96] vfs: ioctl: prevent double-fetch in dedupe ioctl

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2016-08-08 19:21:24
Also in: lkml

4.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Scott Bauer <redacted>

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 <redacted>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help