]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Prevent buffer overrun in read_tablespace_map().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Mar 2021 20:10:38 +0000 (16:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 17 Mar 2021 20:10:38 +0000 (16:10 -0400)
commit2111b409879eee6900aaa3107987f932524064ca
tree660653d4e7dfec3e60e74647a45bab7eefb1d687
parentb9ed85698f3e101bc84eb9b1adf77f5d04ebe7eb
Prevent buffer overrun in read_tablespace_map().

Robert Foggia of Trustwave reported that read_tablespace_map()
fails to prevent an overrun of its on-stack input buffer.
Since the tablespace map file is presumed trustworthy, this does
not seem like an interesting security vulnerability, but still
we should fix it just in the name of robustness.

While here, document that pg_basebackup's --tablespace-mapping option
doesn't work with tar-format output, because it doesn't.  To make it
work, we'd have to modify the tablespace_map file within the tarball
sent by the server, which might be possible but I'm not volunteering.
(Less-painful solutions would require changing the basebackup protocol
so that the source server could adjust the map.  That's not very
appetizing either.)
doc/src/sgml/ref/pg_basebackup.sgml
src/backend/access/transam/xlog.c