Revert "ocfs2: strict bound check before memcmp in ocfs2_xattr_find_entry()"
This reverts commit e5a4f3990a
.
This commit is contained in:
parent
7534e491aa
commit
288d6adf78
1 changed files with 5 additions and 10 deletions
|
@ -1074,7 +1074,7 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index,
|
||||||
{
|
{
|
||||||
struct ocfs2_xattr_entry *entry;
|
struct ocfs2_xattr_entry *entry;
|
||||||
size_t name_len;
|
size_t name_len;
|
||||||
int i, name_offset, cmp = 1;
|
int i, cmp = 1;
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -1089,15 +1089,10 @@ static int ocfs2_xattr_find_entry(struct inode *inode, int name_index,
|
||||||
cmp = name_index - ocfs2_xattr_get_type(entry);
|
cmp = name_index - ocfs2_xattr_get_type(entry);
|
||||||
if (!cmp)
|
if (!cmp)
|
||||||
cmp = name_len - entry->xe_name_len;
|
cmp = name_len - entry->xe_name_len;
|
||||||
if (!cmp) {
|
if (!cmp)
|
||||||
name_offset = le16_to_cpu(entry->xe_name_offset);
|
cmp = memcmp(name, (xs->base +
|
||||||
if ((xs->base + name_offset + name_len) > xs->end) {
|
le16_to_cpu(entry->xe_name_offset)),
|
||||||
ocfs2_error(inode->i_sb,
|
name_len);
|
||||||
"corrupted xattr entries");
|
|
||||||
return -EFSCORRUPTED;
|
|
||||||
}
|
|
||||||
cmp = memcmp(name, (xs->base + name_offset), name_len);
|
|
||||||
}
|
|
||||||
if (cmp == 0)
|
if (cmp == 0)
|
||||||
break;
|
break;
|
||||||
entry += 1;
|
entry += 1;
|
||||||
|
|
Loading…
Reference in a new issue