Details
-
Bug
-
Resolution: Fixed
-
Critical
-
Lustre 2.5.0, Lustre 2.6.0
-
b2_5 and master have the same issue.
-
3
-
12885
Description
If a filesystem name is 8-byte aligned, all HSM commands will get -EINVALID. The root cause is in following code:
/* Return pointer to first hai in action list */ static inline struct hsm_action_item *hai_first(struct hsm_action_list *hal) { return (struct hsm_action_item *)(hal->hal_fsname + cfs_size_round(strlen(hal-> \ hal_fsname))); }
hal_fsname is a string terminated with NULL. If strlen(hal->hal_fsname) is 8 aligned, hai_first() ends up eating the terminating NULL character.
Now when the caller first time call hai_first() and set proper value to the returning first hsm_action_item, it ends up appending some non-NULL characters at the address of hal_fsname + strlen(hal_fsname). The side effect is that the next time someone calls hal_first(), strlen(hal->hal_fsname) is larger than the first time. That would result in misplacement of hsm_action_item and causes hal_is_sane() check to fail.