From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9622B340280 for ; Mon, 4 May 2026 08:37:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777883857; cv=none; b=lBB6NKeb+W8WBuhs0IKzSf0x4KpibrWJAKWB8d+MKPSpvxRA1gBDBki2OFiwpDqLFq8pAf6WX0lKhisaL53FVJe7be+ZeLEczVRCiiMoEwWForWAOgM3E6o2q643f01a3XjbLNBorCT6cvFsteUuqsT+sCNVcm/dkJIjY7TSVbE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777883857; c=relaxed/simple; bh=XXxKp9NygqJ+T3o+QCdGYpaf66CgsVJava5LaLSQees=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=ioHLZRWH9IgfyJ1OBUa8ORvXE6fFoyPBH6S0QcYxC5piRw5P+nPgj2kpo3pDP8+PYHjVrAzHJcRGkg6sEe95KQfIESlKdggtNPox6tTREws9DDJD2OOSu8c+XhZ2f5HPPN9Me3cFEiQVogS1RYJRTyj5DiMAzqnOsjVyL3mubNE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fRcHl4Ll; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fRcHl4Ll" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF69CC2BCB8; Mon, 4 May 2026 08:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777883857; bh=XXxKp9NygqJ+T3o+QCdGYpaf66CgsVJava5LaLSQees=; h=Subject:To:Cc:From:Date:From; b=fRcHl4LlZxqMv5G2T0UlC2u/7epB8pvL40vMxZADI4pAvTaGhGZEwJyqoNXxIGuvW 1phzJdguHz1q0JnxhU89zF7fMSxyA8CA07tWKX7xw4hjA7Ag8qIsQEp6X2OxNOSz2D qOL7bByDupmOJ1BqrcD84sb1rX5/BWW2/bQbJi5A= Subject: FAILED: patch "[PATCH] udf: fix partition descriptor append bookkeeping" failed to apply to 5.15-stable tree To: bioloidgp@gmail.com,jack@suse.cz Cc: From: Date: Mon, 04 May 2026 10:37:26 +0200 Message-ID: <2026050426-sprinkler-crestless-202a@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 08841b06fa64d8edbd1a21ca6e613420c90cc4b8 # git commit -s git send-email --to '' --in-reply-to '2026050426-sprinkler-crestless-202a@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 08841b06fa64d8edbd1a21ca6e613420c90cc4b8 Mon Sep 17 00:00:00 2001 From: Seohyeon Maeng Date: Tue, 10 Mar 2026 17:16:52 +0900 Subject: [PATCH] udf: fix partition descriptor append bookkeeping Mounting a crafted UDF image with repeated partition descriptors can trigger a heap out-of-bounds write in part_descs_loc[]. handle_partition_descriptor() deduplicates entries by partition number, but appended slots never record partnum. As a result duplicate Partition Descriptors are appended repeatedly and num_part_descs keeps growing. Once the table is full, the growth path still sizes the allocation from partnum even though inserts are indexed by num_part_descs. If partnum is already aligned to PART_DESC_ALLOC_STEP, ALIGN(partnum, step) can keep the old capacity and the next append writes past the end of the table. Store partnum in the appended slot and size growth from the next append count so deduplication and capacity tracking follow the same model. Fixes: ee4af50ca94f ("udf: Fix mounting of Win7 created UDF filesystems") Cc: stable@vger.kernel.org Signed-off-by: Seohyeon Maeng Link: https://patch.msgid.link/20260310081652.21220-1-bioloidgp@gmail.com Signed-off-by: Jan Kara diff --git a/fs/udf/super.c b/fs/udf/super.c index 27f463fd1d89..df2b62eddfc0 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1694,8 +1694,9 @@ static struct udf_vds_record *handle_partition_descriptor( return &(data->part_descs_loc[i].rec); if (data->num_part_descs >= data->size_part_descs) { struct part_desc_seq_scan_data *new_loc; - unsigned int new_size = ALIGN(partnum, PART_DESC_ALLOC_STEP); + unsigned int new_size; + new_size = data->num_part_descs + PART_DESC_ALLOC_STEP; new_loc = kzalloc_objs(*new_loc, new_size); if (!new_loc) return ERR_PTR(-ENOMEM); @@ -1705,6 +1706,7 @@ static struct udf_vds_record *handle_partition_descriptor( data->part_descs_loc = new_loc; data->size_part_descs = new_size; } + data->part_descs_loc[data->num_part_descs].partnum = partnum; return &(data->part_descs_loc[data->num_part_descs++].rec); }