From 24a2a4ed6b2120aa21cbaad9496281ff69d1d7c2 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Tue, 27 May 2025 21:09:28 +0530 Subject: [PATCH] LU-17000 llite: Handle not NUL terminated buffer in ll_statahead_info Match ll_statahead_info:sai_fname(target) array length with llapi_lu_ladvise2:lla_buf(source). Test-Parameters: trivial CoverityID: 400216 ("Buffer not null terminated") Fixes: 1288681b (LU-14361 statahead: add statahead advise IOCTL) Signed-off-by: Arshad Hussain Change-Id: Id898ab4b49d54bd734831c09e3de725533e7c249 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59456 Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Tested-by: jenkins Tested-by: Maloo --- lustre/llite/llite_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 6c07c85..37434f2 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -1887,7 +1887,8 @@ struct ll_statahead_info { __u8 sai_fname_zeroed_len; }; }; - char sai_fname[NAME_MAX]; + /* match array size of llapi_lu_ladvise2:lla_buf */ + char sai_fname[NAME_MAX + 1]; }; /* Per inode statahead information */ -- 1.8.3.1