From 8d7c131c9610fe1ffafdda50b3d543766463a291 Mon Sep 17 00:00:00 2001 From: Gregoire Pichon Date: Thu, 31 Mar 2016 13:05:20 +0200 Subject: [PATCH] LU-7965 utils: fix stack corruption in mkfs.lustre This patch fixes a stack corruption that randomly happens when formating a Lustre target. A call to append_unique() routine was done with a wrong maxbuflen value. Signed-off-by: Gregoire Pichon Change-Id: I8838b90a1dcda7c27457c0be0246e216856e7d5d Reviewed-on: http://review.whamcloud.com/19260 Reviewed-by: Andreas Dilger Reviewed-by: lokesh.jaliminche Tested-by: Jenkins Tested-by: Maloo --- lustre/utils/mount_utils_ldiskfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/utils/mount_utils_ldiskfs.c b/lustre/utils/mount_utils_ldiskfs.c index e350133..3e50ae7 100644 --- a/lustre/utils/mount_utils_ldiskfs.c +++ b/lustre/utils/mount_utils_ldiskfs.c @@ -568,7 +568,7 @@ static int enable_default_ext4_features(struct mkfs_opts *mop, char *anchor, { if (IS_OST(&mop->mo_ldd)) { append_unique(anchor, user_spec ? "," : " -O ", - "extents", NULL, sizeof(mop->mo_mkfsopts)); + "extents", NULL, maxbuflen); append_unique(anchor, ",", "uninit_bg", NULL, maxbuflen); } else if (IS_MDT(&mop->mo_ldd)) { append_unique(anchor, user_spec ? "," : " -O ", -- 1.8.3.1