diff options
author | Andres Freund <andres@anarazel.de> | 2025-04-25 12:03:41 -0400 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2025-04-25 13:31:13 -0400 |
commit | 0d9114b7040d7503096e2897f4c856b17d461f6a (patch) | |
tree | 47ce4c3de14de234152deee6dd76d1ed1a216eeb /contrib/jsonb_plpython/jsonb_plpython.c | |
parent | 76d52e71659149d20d616c8a94c02793cedce066 (diff) | |
download | postgresql-0d9114b7040d7503096e2897f4c856b17d461f6a.tar.gz postgresql-0d9114b7040d7503096e2897f4c856b17d461f6a.zip |
aio: Fix crash potential for pg_aios views due to late state update
pgaio_io_reclaim() reset the fields in PgAioHandle before updating the state
to IDLE or incrementing the generation. For most things that's OK, but for
pg_get_aios() it is not - if it copied the PgAioHandle while fields were being
reset, we wouldn't detect that and could call
pgaio_io_get_target_description() with ioh->target == PGAIO_TID_INVALID,
leading to a crash.
Fix this issue by incrementing the generation and state earlier, before
resetting.
Also add an assertion to pgaio_io_get_target_description() for the target to
be valid - that'd have made this case a bit easier to debug. While at it,
add/update a few related assertions.
Author: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/062daca9-dfad-4750-9da8-b13388301ad9@gmail.com
Diffstat (limited to 'contrib/jsonb_plpython/jsonb_plpython.c')
0 files changed, 0 insertions, 0 deletions