lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160105095719.GF23619@mwanda>
Date:	Tue, 5 Jan 2016 12:57:19 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-ext4@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] ext4 crypto: unlock on error in
 ext4_set_encryption_metadata()

There is a missing unlock if ext4_journal_start() fails.

Fixes: 374431bae296 ('ext4 crypto: add ioctls to allow backup of encryption metadata')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>

diff --git a/fs/ext4/crypto_key.c b/fs/ext4/crypto_key.c
index 6e6fbcb..21fdcea 100644
--- a/fs/ext4/crypto_key.c
+++ b/fs/ext4/crypto_key.c
@@ -372,8 +372,10 @@ int ext4_set_encryption_metadata(struct inode *inode,
 
 	handle = ext4_journal_start(inode, EXT4_HT_MISC,
 				    ext4_jbd2_credits_xattr(inode));
-	if (IS_ERR(handle))
-		return PTR_ERR(handle);
+	if (IS_ERR(handle)) {
+		res = PTR_ERR(handle);
+		goto errout;
+	}
 	res = ext4_xattr_set(inode, EXT4_XATTR_INDEX_ENCRYPTION,
 			     EXT4_XATTR_NAME_ENCRYPTION_CONTEXT, ctx,
 			     sizeof(struct ext4_encryption_context), 0);
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ