[4.2.y-ckt stable] Patch "cuse: fix memory leak" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Jan 15 20:11:49 UTC 2016


This is a note to let you know that I have just added a patch titled

    cuse: fix memory leak

to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt2.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

---8<------------------------------------------------------------

>From 438c922625f9f5ed431207180ab30d0c621eec1f Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <miklos at szeredi.hu>
Date: Tue, 10 Nov 2015 10:32:36 +0100
Subject: cuse: fix memory leak

commit 2c5816b4beccc8ba709144539f6fdd764f8fa49c upstream.

The problem is that fuse_dev_alloc() acquires an extra reference to cc.fc,
and the original ref count is never dropped.

Reported-by: Colin Ian King <colin.king at canonical.com>
Signed-off-by: Miklos Szeredi <miklos at szeredi.hu>
Fixes: cc080e9e9be1 ("fuse: introduce per-instance fuse_dev structure")
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 fs/fuse/cuse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index eae2c11..8e3ee19 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -549,6 +549,8 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
 		unregister_chrdev_region(cc->cdev->dev, 1);
 		cdev_del(cc->cdev);
 	}
+	/* Base reference is now owned by "fud" */
+	fuse_conn_put(&cc->fc);

 	rc = fuse_dev_release(inode, file);	/* puts the base reference */

--
1.9.1





More information about the kernel-team mailing list