Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-12911 llite: Don't access lov_md fields before size check
[fs/lustre-release.git]
/
lustre
/
llite
/
xattr.c
diff --git
a/lustre/llite/xattr.c
b/lustre/llite/xattr.c
index
fd53bef
..
ec1e834
100644
(file)
--- a/
lustre/llite/xattr.c
+++ b/
lustre/llite/xattr.c
@@
-272,6
+272,12
@@
static int ll_setstripe_ea(struct dentry *dentry, struct lov_user_md *lump,
if (!size && lump)
lump = NULL;
+ if (size && size < sizeof(*lump)) {
+ /* ll_adjust_lum() or ll_lov_user_md_size() might access
+ * before size - just give up now.
+ */
+ return -ERANGE;
+ }
rc = ll_adjust_lum(inode, lump);
if (rc)
return rc;