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 E797B3B27E9; Thu, 30 Jul 2026 15:54:15 +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=1785426857; cv=none; b=fFMeSiBpbctMuPfR3NhsU09BhZZiz9UrHi/J1NvBrJ8d4VrQd/NvrXlLdPwiQABvnbqiR8xrdkP/YTT7rzz//AgMIdGiWV3YsMHfBEMYf9RravEdEMHXZf9yCyamAT4R5jI/UNpudSu26+lYDMqe2y34/xCt1XK/OefiflZ17dQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785426857; c=relaxed/simple; bh=IMSWkzGNqH7W8vlfbJsWpRMfJk47HkNFxeeNuU0zx0I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ASzxI5r9N/Lnd6wbVY5Dvc78rBHkkw8Eq0RZTDNf2WfI3WE27E2DlUmBJYGrbh2dtKYPE4MXLgwxocNfJgVXvrvA+ZBuxqmjJGzhkdfp9ocyJ0p16GIvhvd/3WfkCINOXxWF0CIjU+BYt0ldZmfsYYa317JUYi9VtPVGu/lPmwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=GcK6sWpY; 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="GcK6sWpY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48C461F000E9; Thu, 30 Jul 2026 15:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785426855; bh=5YZgqcuDyVu8jm0/nK/MXHu5EicrXAPc3yf3Gbxmm80=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GcK6sWpYAAuBGIY7ESh5eqlZfBvROFJ1RqMuRAt5WBGmRv6qS+2UIKhtxFjsj0iam Pmbk05SnHNvnqxoAmPtXIeHSSflozGWkELXiOURm3wG6aq5vwm1nshU6FqLUSpjVAf ro/RMr5cSUFaQjJ8iJKbP8H73yHcXVktKFmUm2xQ= 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.12 522/602] mtd: maps: vmu-flash: fix fault in unaligned fixup Date: Thu, 30 Jul 2026 16:15:14 +0200 Message-ID: <20260730141446.977049784@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141435.976815864@linuxfoundation.org> References: <20260730141435.976815864@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.12-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;