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]
Date:	Tue, 11 Oct 2011 16:49:12 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"Theodore Ts'o" <tytso@....edu>,
	Yongqiang Yang <xiaoqiangnk@...il.com>
Cc:	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-ext4@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] ext4: error handling fix in ext4_ext_convert_to_initialized()

When allocated is unsiged it breaks the error handling at the end
of the function when we call:
	allocated = ext4_split_extent(...);
	if (allocated < 0)
		err = allocated;

I've made it a signed int instead of unsigned.

Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
---
You guys know I'm not an ext4 expert.  I can't swear that the math
all works correctly with a signed int.  I'm pretty sure it does, but
please review this carefully.

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 57cf568..d65b268 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2919,7 +2919,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
 	struct ext4_extent zero_ex;
 	struct ext4_extent *ex;
 	ext4_lblk_t ee_block, eof_block;
-	unsigned int allocated, ee_len, depth;
+	unsigned int ee_len, depth;
+	int allocated;
 	int err = 0;
 	int split_flag = 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