Whamcloud - gitweb
LU-17000 llite: Handle not NUL terminated buffer in ll_statahead_info 56/59456/3
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Tue, 27 May 2025 15:39:28 +0000 (21:09 +0530)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Jun 2025 06:36:56 +0000 (06:36 +0000)
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 <arshad.hussain@aeoncomputing.com>
Change-Id: Id898ab4b49d54bd734831c09e3de725533e7c249
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59456
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/llite/llite_internal.h

index 6c07c85..37434f2 100644 (file)
@@ -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 */