[3.11.y.z extended stable] Patch "jbd2: fix use after free in jbd2_journal_start_reserved()" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Wed Feb 26 12:23:01 UTC 2014


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

    jbd2: fix use after free in jbd2_journal_start_reserved()

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

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

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

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 0ee681bbf25b30a95ade3cba39d66d78cc0e1306 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter at oracle.com>
Date: Mon, 17 Feb 2014 20:33:01 -0500
Subject: jbd2: fix use after free in jbd2_journal_start_reserved()

commit 92e3b40537707001d17bbad800d150ab04e53bf4 upstream.

If start_this_handle() fails then it leads to a use after free of
"handle".

Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso at mit.edu>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/jbd2/transaction.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index b0b74e5..7272cc6 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -514,11 +514,13 @@ int jbd2_journal_start_reserved(handle_t *handle, unsigned int type,
 	 * similarly constrained call sites
 	 */
 	ret = start_this_handle(journal, handle, GFP_NOFS);
-	if (ret < 0)
+	if (ret < 0) {
 		jbd2_journal_free_reserved(handle);
+		return ret;
+	}
 	handle->h_type = type;
 	handle->h_line_no = line_no;
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL(jbd2_journal_start_reserved);

--
1.9.0





More information about the kernel-team mailing list