Thread
Commits
-
Fix use of dangling pointer in heap_delete() when logging replica identity
- 05d24cf7ca7a 9.4.21 landed
- 90f1ba7ecf01 9.5.16 landed
- 014763e97668 9.6.12 landed
- 478e0069fb8b 10.7 landed
- 47412e075266 11.2 landed
- eb8c9f0bc394 12.0 landed
-
XLogInsert() of dangling pointer while logging replica identity
Stas Kelvich <s.kelvich@postgrespro.ru> — 2019-01-31T20:51:36Z
Hi, hackers. It seems that heapam.c:3082 calls XLogRegisterData() with an argument allocated on stack, but following call to XLogInsert() happens after end of context for that variable. Issue spotted by clang's AddressSanitizer. Fix attached. -- Stas Kelvich Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
-
Re: XLogInsert() of dangling pointer while logging replica identity
Michael Paquier <michael@paquier.xyz> — 2019-02-01T01:38:49Z
On Thu, Jan 31, 2019 at 11:51:36PM +0300, Stas Kelvich wrote: > It seems that heapam.c:3082 calls XLogRegisterData() with an argument > allocated on stack, but following call to XLogInsert() happens after > end of context for that variable. > Issue spotted by clang's AddressSanitizer. Fix attached. Oh, good catch. Committed and back-patched down to 9.4. -- Michael
-
Re: XLogInsert() of dangling pointer while logging replica identity
Andres Freund <andres@anarazel.de> — 2019-02-09T11:02:06Z
On 2019-02-01 10:38:49 +0900, Michael Paquier wrote: > On Thu, Jan 31, 2019 at 11:51:36PM +0300, Stas Kelvich wrote: > > It seems that heapam.c:3082 calls XLogRegisterData() with an argument > > allocated on stack, but following call to XLogInsert() happens after > > end of context for that variable. > > Issue spotted by clang's AddressSanitizer. Fix attached. > > Oh, good catch. Committed and back-patched down to 9.4. Thanks Stas and Michael!