Skip to content

ext/pdo_pgsql: Clear persistent notice callbacks at shutdown - #380

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-pdo-pgsql-persistent-notice-uaf-90ax-84-work
Closed

iliaal wants to merge 1 commit into
PHP-8.4from
fix/aph-pdo-pgsql-persistent-notice-uaf-90ax-84-work

Conversation

@iliaal

@iliaal iliaal commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Release request-owned PostgreSQL notice callbacks when the last request wrapper for a persistent handle is destroyed.

…released

Pdo\Pgsql::setNoticeCallback() stores a request-allocated fcall cache on the
driver handle. A persistent handle outlives the request, so the next request
on the same connection uses freed memory as soon as it receives a notice or
sets a new callback. Drop the callback from the persistent_shutdown hook,
which pdo_sqlite also uses for its user functions, once the last object of
the request releases the handle.
@iliaal
iliaal force-pushed the fix/aph-pdo-pgsql-persistent-notice-uaf-90ax-84-work branch from 06f3fc0 to fd4136d Compare November 2, 2026 14:02
@iliaal

iliaal commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream: php#25156

@iliaal iliaal closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant