X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fxattr.c;h=ec1e8341407a59c9ac1f9c084281fcd4b30a5f3b;hb=6b0011b8b9cd1a0fc5752512067ae2e384bf8adb;hp=fd53bef97043312a54298bed7c622962757ba4f1;hpb=21b34dd8a226fbaf2fee52b294f2482aa8670ad2;p=fs%2Flustre-release.git diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index fd53bef..ec1e834 100644 --- 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;