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: <1318831867-8225-1-git-send-email-xiaoqiangnk@gmail.com>
Date:	Mon, 17 Oct 2011 14:11:07 +0800
From:	Yongqiang Yang <xiaoqiangnk@...il.com>
To:	linux-ext4@...r.kernel.org
Cc:	tytso@....edu, Yongqiang Yang <xiaoqiangnk@...il.com>
Subject: [PATCH] ext4: fix wrong verification in ext4_ext_insert_index

After inserting an new index, current number of indexes should
be greater than original number by 1.  So if the new index is
less or equal than LAST_INDEX + 1, then indexes are continugous.
If new index will be placed on the end, then ix will equals
LAST_INDEX + 1. Index entries has been verifiyed in pervious code
in ext4_ext_insert_index.

Signed-off-by: Yongqiang Yang <xiaoqiangnk@...il.com>
---
 fs/ext4/extents.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 2dff31e..322398e 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -779,7 +779,7 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
 		ix = curp->p_idx;
 	}
 
-	if (unlikely(ix > EXT_LAST_INDEX(curp->p_hdr))) {
+	if (unlikely(ix > EXT_LAST_INDEX(curp->p_hdr) + 1)) {
 		EXT4_ERROR_INODE(inode, "ix > EXT_LAST_INDEX!");
 		return -EIO;
 	}
-- 
1.7.5.1

--
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