Whamcloud - gitweb
LU-7965 utils: fix stack corruption in mkfs.lustre 60/19260/3
authorGregoire Pichon <gregoire.pichon@bull.net>
Thu, 31 Mar 2016 11:05:20 +0000 (13:05 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Apr 2016 02:52:22 +0000 (02:52 +0000)
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 <gregoire.pichon@bull.net>
Change-Id: I8838b90a1dcda7c27457c0be0246e216856e7d5d
Reviewed-on: http://review.whamcloud.com/19260
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: lokesh.jaliminche <lokesh.jaliminche@seagate.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/utils/mount_utils_ldiskfs.c

index e350133..3e50ae7 100644 (file)
@@ -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 ",