[php-src] PR #22083: Fix GH-22063: stream filter chain UAF on self-removal during callback

From: Date: Mon, 18 May 2026 11:18:55 +0000
Subject: [php-src] PR #22083: Fix GH-22063: stream filter chain UAF on self-removal during callback
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-36161@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/22083 Author: iliaal A php_user_filter that calls stream_filter_remove on its own resource from inside filter() frees the php_stream_filter struct while userfilter_filter still dereferences &thisfilter->abstract and while the chain walks in _php_stream_filter_flush, _php_stream_write_filtered, and _php_stream_fill_read_buffer still need current->next. Two new fields on php_stream_filter, in_callback and deferred_dtor, carry the deferral: php_stream_filter_remove(filter, true) unlinks and runs zend_list_delete immediately but defers the pefree.

« previous php.git-pulls (#36161) next »