Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c4c4ca
)
LU-12602 mdt: check EA size in mdt_getxattr_pack_reply()
36/35936/5
author
Emoly Liu
<emoly@whamcloud.com>
Wed, 14 Aug 2019 07:52:58 +0000
(15:52 +0800)
committer
Oleg Drokin
<green@whamcloud.com>
Wed, 18 Sep 2019 14:04:42 +0000
(14:04 +0000)
Check EA data size(non-positive or excessively large) in case of
any corruption.
Lustre-change: https://review.whamcloud.com/35768
Lustre-commit:
915135c37cbfa6851a5ec732afd20955eb020566
Change-Id: I8ccea214f8d7c0403a9df180acf487ee381b8d77
Reported-by: Alibaba Cloud <yunye.ry@alibaba-inc.com>
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/35936
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mdt/mdt_xattr.c
patch
|
blob
|
history
diff --git
a/lustre/mdt/mdt_xattr.c
b/lustre/mdt/mdt_xattr.c
index
06baab6
..
4c362a3
100644
(file)
--- a/
lustre/mdt/mdt_xattr.c
+++ b/
lustre/mdt/mdt_xattr.c
@@
-97,6
+97,11
@@
static int mdt_getxattr_pack_reply(struct mdt_thread_info * info)
/* We could calculate accurate sizes, but this would
* introduce a lot of overhead, let's do it later... */
size = info->mti_body->mbo_eadatasize;
+ if (size <= 0 || size > info->mti_mdt->mdt_max_ea_size) {
+ CERROR("%s: invalid EA size(%d) for FLXATTRALL\n",
+ mdt_obd_name(info->mti_mdt), size);
+ RETURN(-EINVAL);
+ }
req_capsule_set_size(pill, &RMF_EAVALS, RCL_SERVER, size);
req_capsule_set_size(pill, &RMF_EAVALS_LENS, RCL_SERVER, size);
} else {