Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp806067lqt; Thu, 6 Jun 2024 21:26:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWAlUKhVfevrzCzf0vUiwCWOfxglQcQ3m4iQyuzab2IdvZVsHxHVjSI47tQ77tlMSJVL/i3bk4tBB5nCBxarl7zakEXdpS7irj97W3mCQ== X-Google-Smtp-Source: AGHT+IHlRZ/5z9WZhOQKa6L621fzkhXgwnPC8Wqst1awSa9EKreNxT5bt9rfPmhQdPXokVUfNEg8 X-Received: by 2002:a50:cdc2:0:b0:574:ebf4:f786 with SMTP id 4fb4d7f45d1cf-57c4e3f5be7mr1328467a12.16.1717734409100; Thu, 06 Jun 2024 21:26:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717734409; cv=pass; d=google.com; s=arc-20160816; b=lMwqh4rIsCuc3+9Lp+VnUwx+Ni/EgRxmO4/tN4t6pk4L7eDlQvMlbFeDrT7qOij/ex 4leCjTBokkzceI3w+a7XNUOBAKf1P4aB1RPOEurA+jP9bkrZH0jlKqXpOPGp+YNfrklh epTakIffr80GKabKpIjoet1wldUxba/4w3iYiuTGzXSGAr9XFawCQoi8o70jvlSawWCQ 8T0eJuL9paxXRFXze7GWbso4pKurCkS3N+mSn6Y0gQEO5hXaoZfJD3ZEWJ+vWYEfXrRG Mf2y7/0spRVl/yNvDP12tTUQbfNRHpl9AO9fzDEij1sx1Y5nbX303z3WHGbY9DpoBXUD 8Axw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6oZX4eW7sJl+FbCaI5FhKVf6eXHEeNUPxg+EosIHe0Y=; fh=yXYChwFvQA/NaaLzCC0IJdkW11OhjXgO4DHXzVmnGFw=; b=Kld4WUxjD82d20pCVQt1Exvew/N8BlTeDA9XqhAUBg3YUe7JjoZfNodgACmXyOBF6S cJQkz4oh4ke3wJapH7L7XxoCNjA3YrpwidTZqc05eVzJDN1GXaPcwmfvzL3ETcbT92HL v2QzpkCgzwVxV9NSajPTtt8BC8lr0jnPmHk9+5tzzTShhwPisitX4R/ZOuDfgabqEzZl L7RtXtB6VBYJA90SMweazjjykD8aelOC5Vxl8EdgsEdwBTsO75SGvfh8PJgLpIY2HeqK OExv8vM2F74m9Ki88RqaLVkG1gMXLL2PRj+XqbfQkrUh/KBkoef6T9YQ7nxJDOqMWzou 827w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-205283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae22d058si1365307a12.429.2024.06.06.21.26.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 21:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-205283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CCD061F247D7 for ; Fri, 7 Jun 2024 04:26:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12A751BF3B; Fri, 7 Jun 2024 04:26:34 +0000 (UTC) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4705418EA1 for ; Fri, 7 Jun 2024 04:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717734393; cv=none; b=JKisKFTC7RUMyywQn9RSuhwNZT0IIPi9JXCUF4qENnjKuPvNhTc4pGrsyGz0/TGbISQG4RyaOptPFZb66o1Ash7tOX0PRbr2dGAh1AOT/x2wWuZ+TbYeQBtWX8PvIS7TZxOzdUud9PTVgbg41OJZP+GDyz3nfyfmfGQpyj3Iwfc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717734393; c=relaxed/simple; bh=OubTEbmvvT4uQyxu+ylLsWyh+v4hByOhHO8hJew60KY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RibqyxN8D8i988ENk1ewLF0xeLwvEE9TQhNxjS6mvifzNQyMT/wZfjUCNkvybLsMcYDXbUv9e93HSu85l7xUFW/rpnfwA9PNjRXLOb5+VHnwpDhVEtH5wWca60MKFJvTmbTfM+PlgQ3ERBFk2cEtflyh4Q73MU4owDwDrhn2v8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4VwSjK2cKpz1S6K9; Fri, 7 Jun 2024 12:22:45 +0800 (CST) Received: from kwepemm600013.china.huawei.com (unknown [7.193.23.68]) by mail.maildlp.com (Postfix) with ESMTPS id 9C1E61400D3; Fri, 7 Jun 2024 12:26:28 +0800 (CST) Received: from huawei.com (10.175.104.67) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Fri, 7 Jun 2024 12:26:27 +0800 From: Zhihao Cheng To: , , , , , CC: , Subject: [RFC PATCH mtd-utils 002/110] mkfs.ubifs: Initialize 'cipher_name' as NULL Date: Fri, 7 Jun 2024 12:24:27 +0800 Message-ID: <20240607042615.2069840-3-chengzhihao1@huawei.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240607042615.2069840-1-chengzhihao1@huawei.com> References: <20240607042615.2069840-1-chengzhihao1@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600013.china.huawei.com (7.193.23.68) Variable 'cipher_name' is defined on stack without initialization, when an user invokes mkfs with '--key' and without '-C', 'cipher_name' is a random value, which could cause init_fscrypt_context() failed to find a valid cipher. Fix it by initializing 'cipher_name' as NULL when it is declared. Fixes: cc4c5e295f546 ("mkfs.ubifs: Enable support for building without crypto") Signed-off-by: Zhihao Cheng --- ubifs-utils/mkfs.ubifs/mkfs.ubifs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c index 5ca01512..b91a3e2d 100644 --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c @@ -556,7 +556,7 @@ static int get_options(int argc, char**argv) struct stat st; char *endp; #ifdef WITH_CRYPTO - const char *cipher_name; + const char *cipher_name = NULL; #endif c->fanout = 8; -- 2.13.6