postgresql/src/backend
Tom Lane 4fb6478275 Add defenses against running with a wrong selection of LOBLKSIZE.
It's critical that the backend's idea of LOBLKSIZE match the way data has
actually been divided up in pg_largeobject.  While we don't provide any
direct way to adjust that value, doing so is a one-line source code change
and various people have expressed interest recently in changing it.  So,
just as with TOAST_MAX_CHUNK_SIZE, it seems prudent to record the value in
pg_control and cross-check that the backend's compiled-in setting matches
the on-disk data.

Also tweak the code in inv_api.c so that fetches from pg_largeobject
explicitly verify that the length of the data field is not more than
LOBLKSIZE.  Formerly we just had Asserts() for that, which is no protection
at all in production builds.  In some of the call sites an overlength data
value would translate directly to a security-relevant stack clobber, so it
seems worth one extra runtime comparison to be sure.

In the back branches, we can't change the contents of pg_control; but we
can still make the extra checks in inv_api.c, which will offer some amount
of protection against running with the wrong value of LOBLKSIZE.
2014-06-05 11:31:12 -04:00
..
access Use 0-based numbering in comments about backup blocks. 2014-05-19 13:27:21 +03:00
bootstrap Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:29:05 -04:00
catalog Fix longstanding bug in HeapTupleSatisfiesVacuum(). 2014-06-04 23:25:52 +02:00
commands Prevent auto_explain from changing the output of a user's EXPLAIN. 2014-05-20 12:20:57 -04:00
executor Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
foreign Add GetForeignColumnOptions() to foreign.c, and add some documentation. 2012-03-07 18:20:58 -05:00
lib Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
libpq Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
main Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
nodes Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
optimizer Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
parser Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:29:05 -04:00
po Translation updates 2014-03-16 21:57:51 -04:00
port Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
postmaster Fix unportable setvbuf() usage in initdb. 2014-05-15 15:58:01 -04:00
regex Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
replication Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:29:05 -04:00
rewrite Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:12 -04:00
tcop Set the process latch when processing recovery conflict interrupts. 2014-06-03 14:18:04 +02:00
tsearch Remove tabs after spaces in C comments 2014-05-06 11:26:27 -04:00
utils Fix longstanding bug in HeapTupleSatisfiesVacuum(). 2014-06-04 23:25:52 +02:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile Fix PGXS support for building loadable modules on AIX. 2012-10-09 21:04:11 -04:00
nls.mk Translation updates 2013-02-04 00:01:19 -05:00