Re: Use-after-free issue in postgres_fdw

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use-after-free issue in postgres_fdw
Date: 2026-04-27 08:07:02
Message-ID: ae8ZJoywDp3Ccsfm@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 24, 2026 at 01:59:22AM -0700, Etsuro Fujita wrote:
> I added a simple SQL test, not an isolation one. Attached is an
> updated patch for that. The basic idea for the test is the same as
> the one I showed upthread, but the test ensures the order by checking
> for the termination by using pg_stat_activity. In the patch I added a
> comment for pgfdw_reject_incomplete_xact_state_change() as well.

Smart.

> Right, this patch delays discarding the failed connection until abort
> cleanup of the top transaction, so it is guaranteed that anyone that
> uses it can safely refer to its PGconn when needed.

+-- test handling of abort-cleanup-failed connections

Perhaps this could be more descriptive, like "test cleanup of failed
connections on abort"?
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jakub Wartak 2026-04-27 08:14:50 Re: question on visibility map
Previous Message Henson Choi 2026-04-27 08:03:26 Re: Row pattern recognition