Files
Ravi Singh 532d3c8422 udf: fix partition descriptor append bookkeeping
JIRA: https://issues.redhat.com/browse/RHEL-179583
CVE: CVE-2026-45991
Conflicts:
  - fs/udf/super.c: upstream uses kzalloc_objs(), CS9 uses kcalloc() — kept kcalloc()

commit 08841b06fa64d8edbd1a21ca6e613420c90cc4b8
Author: Seohyeon Maeng <bioloidgp@gmail.com>
Date:   Tue Mar 10 17:16:52 2026 +0900

    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: ee4af50ca9 ("udf: Fix mounting of Win7 created UDF filesystems")
    Cc: stable@vger.kernel.org
    Signed-off-by: Seohyeon Maeng <bioloidgp@gmail.com>
    Link: https://patch.msgid.link/20260310081652.21220-1-bioloidgp@gmail.com
    Signed-off-by: Jan Kara <jack@suse.cz>

(cherry picked from commit 08841b06fa64d8edbd1a21ca6e613420c90cc4b8)
Signed-off-by: Ravi Singh <ravising@redhat.com>
2026-06-18 09:03:34 -04:00
..
2024-10-16 09:07:05 +08:00