postgresql/src
John Naylor 83ce20d671 Fix use-after-free in parallel_vacuum_reset_dead_items
parallel_vacuum_reset_dead_items used a local variable to hold a
pointer from the passed vacrel, purely as a shorthand. This pointer
was later freed and a new allocation was made and stored to the
struct. Then the local pointer was mistakenly referenced again.

This apparently happened not to break anything since the freed chunk
would have been put on the context's freelist, so it was accidentally
the same pointer anyway, in which case the DSA handle was correctly
updated. The minimal fix is to change two places so they access
dead_items through the vacrel. This coding style is a maintenance
hazard, so while at it get rid of most other similar usages, which
were inconsistently used anyway.

Analysis and patch by Vallimaharajan G, with further defensive coding
by me

Backpath to v17, when TidStore came in

Discussion: https://postgr.es/m/1936493cc38.68cb2ef27266.7456585136086197135@zohocorp.com
2024-12-04 16:59:12 +07:00
..
backend Fix use-after-free in parallel_vacuum_reset_dead_items 2024-12-04 16:59:12 +07:00
bin psql: Add tab completion for COPY (MERGE ... 2024-11-28 12:09:53 +01:00
common Clean up newlines following left parentheses 2024-11-26 17:10:07 +01:00
fe_utils Prevent mis-encoding of "trailing junk after numeric literal" errors. 2024-09-05 12:42:33 -04:00
include Clean up newlines following left parentheses 2024-11-26 17:10:07 +01:00
interfaces Fix broken list-munging in ecpg's remove_variables(). 2024-12-01 14:15:37 -05:00
makefiles Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pl Add support for Tcl 9 2024-11-25 12:27:10 +01:00
port Fix overflow in bsearch_arg() with more than INT_MAX elements 2024-10-28 14:07:57 +02:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Avoid mislabeling of lateral references, redux. 2024-11-30 12:42:20 -05:00
timezone Update time zone data files to tzdata release 2024b. 2024-10-29 11:49:50 -04:00
tools Avoid mislabeling of lateral references, redux. 2024-11-30 12:42:20 -05:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Update Unicode data to CLDR 45 2024-04-22 09:16:33 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00