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 BD27144AB62; Thu, 30 Jul 2026 15:25:38 +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=1785425139; cv=none; b=G/CCJVVDrvR/l8CMPPejNNqFE5Krk183++LRRW3GK4nYsTmyFp6sSkIx4cw4h5t4l4mZmdcLcZ2W+pI0MEv3HEAfYDeS5XOt/+V6M7HnpRb1puk57Cl+PXTFUXHkOPU2GtReMUdz8D+OC22m4yOl5KT1A/fJWSjkF6cC5NEmvm4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785425139; c=relaxed/simple; bh=MVhQv/mvKrYQJrMQD8/xFSqDe++MVIobuoL4U7VwK6Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F1gg4/hayfdC0nsPmll11e4fPxuFjLKAHWrI6PJgAfHHrMqW9oXIUKrHO0A24pUb+pmd2thTh9ae68vmLRqITM+yCPKI71ZUdA54DEnHJGyjweOGmw2M0L1cbsmxlbe2VN27B24+tllbqwPMebpD+gpMYAlaImxXlUmxTe3Ym10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eNgpVizr; 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="eNgpVizr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14ABC1F000E9; Thu, 30 Jul 2026 15:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785425138; bh=dJIPWoWzU2igqpODQ4S0GYqNaMim1GOPxXViniGUyvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eNgpVizrG4+roUHUC3NACvJAyUQ5zH4D7HNeqrUUDyYeFmoCer7CdHOBJFhzx1dU+ 9Jf4I3EDss6bXmkKWbjuGUwTI7+tt8nDxfCTmQnFHiMYnXK+dRjl66Pz/fPRY7RQuJ 6cqpY9UcyfAF1L8Vi9OmaPphKQlMNdFEX00ndpAg= 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.18 636/675] mtd: maps: vmu-flash: fix fault in unaligned fixup Date: Thu, 30 Jul 2026 16:16:06 +0200 Message-ID: <20260730141458.647599641@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141445.110192266@linuxfoundation.org> References: <20260730141445.110192266@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.18-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;