projects
/
deliverable
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c8349a
)
ext4: avoid unneeded lookup when xattr name is invalid
author
Zhang Zhen
<zhenzhang.zhang@huawei.com>
Mon, 12 May 2014 13:57:59 +0000
(09:57 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Mon, 12 May 2014 13:57:59 +0000
(09:57 -0400)
In ext4_xattr_set_handle() we have checked the xattr name's length. So
we should also check it in ext4_xattr_get() to avoid unneeded lookup
caused by invalid name.
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/xattr.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/xattr.c
b/fs/ext4/xattr.c
index 4eec399ec807bc6733d1a90b8c3d0d205eb795c1..c6ae6fab99befc751015f7b2e4e8f0ed06653d1c 100644
(file)
--- a/
fs/ext4/xattr.c
+++ b/
fs/ext4/xattr.c
@@
-369,6
+369,9
@@
ext4_xattr_get(struct inode *inode, int name_index, const char *name,
{
int error;
+ if (strlen(name) > 255)
+ return -ERANGE;
+
down_read(&EXT4_I(inode)->xattr_sem);
error = ext4_xattr_ibody_get(inode, name_index, name, buffer,
buffer_size);
This page took
0.025332 seconds
and
5
git commands to generate.