aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-11-16 20:00:59 -0800
committerAndres Freund <andres@anarazel.de>2022-11-19 12:22:04 -0800
commit8c954168cff4630ae94df649b458f4a3aad6d9a7 (patch)
tree5242dc180b0594da6d83cf7040f89500d1dbcd1b /src/backend/parser/parse_expr.c
parent3efc82e28951c6eee24aead056b8478cb424af2e (diff)
downloadpostgresql-8c954168cff4630ae94df649b458f4a3aad6d9a7.tar.gz
postgresql-8c954168cff4630ae94df649b458f4a3aad6d9a7.zip
Fix mislabeling of PROC_QUEUE->links as PGPROC, fixing UBSan on 32bit
ProcSleep() used a PGPROC* variable to point to PROC_QUEUE->links.next, because that does "the right thing" with SHMQueueInsertBefore(). While that largely works, it's certainly not correct and unnecessary - we can just use SHM_QUEUE* to point to the insertion point. Noticed when testing a 32bit of postgres with undefined behavior sanitizer. UBSan noticed that sometimes the supposed PGPROC wasn't sufficiently aligned (required since 46d6e5f5679, ensured indirectly, via ShmemAllocRaw() guaranteeing cacheline alignment). For now fix this by using a SHM_QUEUE* for the insertion point. Subsequently we should replace all the use of PROC_QUEUE and SHM_QUEUE with ilist.h, but that's a larger change that we don't want to backpatch. Backpatch to all supported versions - it's useful to be able to run postgres under UBSan. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/20221117014230.op5kmgypdv2dtqsf@awork3.anarazel.de Backpatch: 11-
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions