On 3/29/22 15:27, Heming Zhao wrote:
If bitmap area contains invalid data, kernel will crash then mdadm triggers "Segmentation fault". This is cluster-md speical bug. In non-clustered env, mdadm will handle broken metadata case. In clustered array, only kernel space handles bitmap slot info. But even this bug only happened in clustered env, current sanity check is wrong, the code should be changed> ... ... Signed-off-by: Heming Zhao <heming.zhao@xxxxxxxx> --- v2: * revise commit log - change mdadm "FPE" error to "Segmentation fault" error ("FPE" belongs to another issue) - add kernel crash log * modify a comment style to follow code rule * change strlcpy to strscpy for strlcpy is marked as deprecated in Documentation/process/deprecated.rst - note: strlcpy() still exists in md.c & md-cluster.c
Please note, beside Guoqing's review comments, I added new code change : strlcpy() => strscpy() - Heming