Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Matthias van de Meent <boekewurm+postgres@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Andres Freund <andres@anarazel.de>, Ian Lawrence Barwick <barwick@gmail.com>, Heikki Linnakangas <hlinnaka@iki.fi>, David Zhang <david.zhang@highgo.ca>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2023-04-06T23:35:05Z
Lists: pgsql-hackers
Attachments
- v12-0001-Add-more-protections-in-WAL-record-APIs-against-.patch (text/x-diff) patch v12-0001
On Fri, Apr 07, 2023 at 08:08:34AM +0900, Michael Paquier wrote: > So bumping mainrdata_len to uint64 is actually not entirely in line > with this code. Well, it will work because we'd still fail a couple > of lines down, but perhaps its readability should be improved so as > we have an extra check in this code path to make sure that > mainrdata_len is not higher than PG_UINT32_MAX, then use an > intermediate casted variable before saving the length in the record > data to make clear that the type of the main static length in > xloginsert.c is not the same as what a record has? The v10 I sent > previously blocked this possibility, but not v11. So, I was thinking about something like the attached tweaking this point, the error details a bit, applying an indentation and writing a commit message... Matthias? -- Michael
Commits
-
Add more protections in WAL record APIs against overflows
- 8fcb32db98ed 16.0 landed
-
Add overflow protection for block-related data in WAL records
- ffd1b6bb6f8a 16.0 landed
-
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
- b0a55e43299c 16.0 cited
-
Revamp the WAL record format.
- 2c03216d8311 9.5.0 cited