mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
ext4: avoid unneeded lookup when xattr name is invalid
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 <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
This commit is contained in:
parent
1c8349a171
commit
230b8c1a7b
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue