From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 F213A443A94; Thu, 30 Jul 2026 16:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785428175; cv=none; b=jiqmOpb7PxFQeYHmTQ1PhhaeSpuaDrNvDlnrS08+O1GTzw4Lk6mAU0BCd+j8SoUYHr+JHsHczdnXT184ZV05V396tfMw1MdfUXSe54Gs5nwCeHCGDHFpRTVESqYi2hOuEUve+rXuJg1REnOjE6tmOlCvZW7MParCQSOnXrCJ7Ic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785428175; c=relaxed/simple; bh=P1KPztpDpnVBLyjEeIiuoReII5kSJO3QKRLuXYgOp1Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ezitz0O4nsvQ6t3W5xqQEA/wDDAXl1CVWS/pYXpPxc7Oc/gicPYuZBD/nwE/9xbpQ/lvoi1J7kU0oUO3yGtD9bk3PAVh3zBcErqIiPo4HBz+a06PfSDJEMN2FGcozXr6urIKgLOd2NTqJ0nxd8DBrHYU5z2Yg0Be6rTzx0JuGss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=n4qfB+Te; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="n4qfB+Te" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADEDA1F00ACA; Thu, 30 Jul 2026 16:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785428159; bh=jtDsgZwBgQXb72gjCWpyIPfNOvGlQs1phpogAlTlC0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n4qfB+TeVfz44Jt00Is/1Dn4V9XPahOSo9mbs9jUyzLX4zqVihXFULMp1Yek+leEz gp0l1OfPdQTKzY+LNrpJIZmnyax4Ds4M29D57/Evbv98yCTqxUox5vNnAVKxvSK51/ WdY/zDJ9msShSXC3IMl+XoUyYJFS2rsGMQfOWNgQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fuchs , Miquel Raynal , Sasha Levin Subject: [PATCH 6.6 425/484] mtd: maps: vmu-flash: fix fault in unaligned fixup Date: Thu, 30 Jul 2026 16:15:22 +0200 Message-ID: <20260730141432.713646303@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Fuchs [ Upstream commit 79d1661502c6e4b6f626185cef72cf2fa78116e1 ] Use kzalloc_obj() / kzalloc_objs() to allocate the memcard structs, instead of kmalloc_obj() / kmalloc_objs() to prevent access to uninitialized data. Fixes runtime error: Fault in unaligned fixup: 0000 [#1] at mtd_get_fact_prot_info. Fixes: 47a72688fae7 ("mtd: flash mapping support for Dreamcast VMU.") Cc: stable@vger.kernel.org Signed-off-by: Florian Fuchs Signed-off-by: Miquel Raynal Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/maps/vmu-flash.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/drivers/mtd/maps/vmu-flash.c +++ b/drivers/mtd/maps/vmu-flash.c @@ -610,7 +610,7 @@ static int vmu_connect(struct maple_devi basic_flash_data = be32_to_cpu(mdev->devinfo.function_data[c - 1]); - card = kmalloc(sizeof(struct memcard), GFP_KERNEL); + card = kzalloc_obj(struct memcard); if (!card) { error = -ENOMEM; goto fail_nomem; @@ -628,15 +628,13 @@ static int vmu_connect(struct maple_devi * Not sure there are actually any multi-partition devices in the * real world, but the hardware supports them, so, so will we */ - card->parts = kmalloc_array(card->partitions, sizeof(struct vmupart), - GFP_KERNEL); + card->parts = kzalloc_objs(struct vmupart, card->partitions); if (!card->parts) { error = -ENOMEM; goto fail_partitions; } - card->mtd = kmalloc_array(card->partitions, sizeof(struct mtd_info), - GFP_KERNEL); + card->mtd = kzalloc_objs(struct mtd_info, card->partitions); if (!card->mtd) { error = -ENOMEM; goto fail_mtd_info;