X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fllite%2Fxattr.c;h=829584d73a9b3a2b2b1af6d6a19741768c14f478;hp=0c50a59c587f188c3b6a4b5132603551d82c1bdd;hb=f2d06d3c76a1d69447e7bd6fd29d8165be558d73;hpb=4249b02f5c4c8a14faa0b88479b8eac75b212617 diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c index 0c50a59..829584d 100644 --- a/lustre/llite/xattr.c +++ b/lustre/llite/xattr.c @@ -283,6 +283,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;