aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-range-diff.txt
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2025-01-27 10:44:08 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-27 08:21:41 -0800
commitf11f0a5a2db955f68776ea95aec42df7fcb8ce1b (patch)
tree789f88c73917bbd8b830b4b53884cf5f3b65947f /Documentation/git-range-diff.txt
parentreftable: write correct max_update_index to header (diff)
downloadgit-f11f0a5a2db955f68776ea95aec42df7fcb8ce1b.tar.gz
git-f11f0a5a2db955f68776ea95aec42df7fcb8ce1b.zip
refs/reftable: fix uninitialized memory access of `max_index`
When migrating reflogs between reference backends, maintaining the original order of the reflog entries is crucial. To achieve this, an `index` field is stored within the `ref_update` struct that encodes the relative order of reflog entries. This field is used by the reftable backend as update index for the respective reflog entries to maintain that ordering. These update indices must be respected when writing table headers, which encode the minimum and maximum update index of contained records in the header and footer. This logic was added in commit bc67b4ab5f (reftable: write correct max_update_index to header, 2025-01-15), which started to use `reftable_writer_set_limits()` to propagate the mininum and maximum update index of all records contained in a ref transaction. However, we only set the maximum update index for the first transaction argument, even though there can be multiple such arguments. This is the case when we write to multiple stacks in a single transaction, e.g. when updating references in two different worktrees at once. Consequently, the update index for all but the first argument remain uninitialized, which may cause undefined behaviour. Fix this by moving the assignment of the maximum update index in `reftable_be_transaction_finish()` inside the loop, which ensures that all elements of the array are correctly initialized. Furthermore, initialize the `max_index` field to 0 when queueing a new transaction argument. This is not strictly necessary, as all elements of `write_transaction_table_arg.max_index` are now assigned correctly. However, this initialization is added for consistency and to safeguard against potential future changes that might inadvertently introduce uninitialized memory access. Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-range-diff.txt')
0 files changed, 0 insertions, 0 deletions
>ARM: OMAP2+: Remove gpmc-onenandLadislav Michl3-446/+0 2018-01-12mtd: onenand: omap2: Configure driver from DTLadislav Michl4-139/+301 2018-01-12mtd: onenand: omap2: Decouple DMA enabling from INT pin availabilityLadislav Michl1-31/+21 2018-01-12mtd: onenand: omap2: Do not make delay for GPIO OMAP3 specificLadislav Michl1-5/+2 2018-01-12mtd: onenand: omap2: Convert to use dmaengine for memcpyPeter Ujfalusi1-42/+38 2018-01-12mtd: onenand: omap2: Unify OMAP2 and OMAP3 DMA implementationLadislav Michl1-125/+4 2018-01-12mtd: onenand: omap2: Simplify the DMA setup for various pathsPeter Ujfalusi1-64/+45 2018-01-12mtd: onenand: omap2: Account waiting time as waiting on IOLadislav Michl1-3/+2 2018-01-12mtd: onenand: omap2: Remove partitioning support from platform dataLadislav Michl1-2/+1 2018-01-12mtd: onenand: omap2: Remove skip initial unlocking supportLadislav Michl1-3/+0 2018-01-12mtd: onenand: omap2: Remove regulator supportLadislav Michl1-41/+1 2018-01-12ARM: dts: omap3-igep: Update onenand node timingsLadislav Michl1-15/+15 2018-01-12ARM: dts: OMAP2+: Add compatible property to onenand nodeLadislav Michl4-0/+4 2018-01-12dt-bindings: mtd: gpmc-onenand: Update properties descriptionLadislav Michl1-2/+4 2018-01-12mtd: nand: use reworked NAND controller driver with Marvell EBU SoCsMiquel Raynal2-2/+2 2018-01-12mtd: nand: add reworked Marvell NAND controller driverMiquel Raynal3-0/+2912