pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Naylor <john.naylor@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix reuse-after-free hazard in dead_items_reset
Date: Fri, 03 Oct 2025 09:19:04 +0000
Message-ID: <E1v4bwN-001EwN-2A@gemulon.postgresql.org> (raw)

Fix reuse-after-free hazard in dead_items_reset

In similar vein to commit ccc8194e427, a reset instance of a shared
memory TID store happened to occupy the same private memory as the old
one for the entry point, since the chunk freed after the last round
of index vacuuming was put on the context's freelist. The failure
to update the vacrel->dead_items pointer was evident by nudging the
system to allocate memory in a different area. This was not discovered
at the time of the earlier commit since our regression tests didn't
cover multiple index passes with parallel vacuum.

Backpatch to v17, when TidStore came in.

Author: Kevin Oommen Anish <kevin.o@zohocorp.com>
Reviewed-by: Richard Guo <guofenglinux@gmail.com>
Tested-by: Richard Guo <guofenglinux@gmail.com>
Discussion: https://postgr.es/m/199a07cbdfc.7a1c4aac25838.1675074408277594551%40zohocorp.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/76613b539ac5d87d26f8026ec1e2cd11d0583b3d

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 2 ++
1 file changed, 2 insertions(+)



view thread (3+ messages)  latest in thread

Message-ID: <E1v4bwN-001EwN-2A@gemulon.postgresql.org>
Permalink:  ../E1v4bwN-001EwN-2A@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v4bwN-001EwN-2A@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: john.naylor@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix reuse-after-free hazard in dead_items_reset
  In-Reply-To: <E1v4bwN-001EwN-2A@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox