postgresql/src
Tom Lane 5f93c37805 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:06 -04:00
..
backend Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:06 -04:00
bin Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:06 -04:00
common pgindent run for 9.4 2014-05-06 12:12:18 -04:00
include Add defenses against running with a wrong selection of LOBLKSIZE. 2014-06-05 11:31:06 -04:00
interfaces Revert "Fix bogus %name-prefix option syntax in all our Bison files." 2014-05-28 19:21:01 -04:00
makefiles Flush a stray definition of $(DLLTOOL). 2014-02-11 12:59:48 -05:00
pl Make plpython_unicode regression test work in more database encodings. 2014-06-03 12:01:54 -04:00
port pgindent run for 9.4 2014-05-06 12:12:18 -04:00
template Revert to using --enable-auto-import in Cygwin builds. 2014-02-16 15:14:04 -05:00
test Move regression test listing of builtin leakproof functions to opr_sanity.sql. 2014-06-05 13:54:25 +02:00
timezone pgindent run for 9.4 2014-05-06 12:12:18 -04:00
tools Fix typos in MSVC solution file. 2014-05-30 10:32:52 +03:00
tutorial pgindent run for 9.4 2014-05-06 12:12:18 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Support BSD and e2fsprogs UUID libraries alongside OSSP UUID library. 2014-05-27 19:42:08 -04:00
Makefile.shlib Tweak position of $(DLL_DEFFILE) in shared-library link commands. 2014-02-12 11:22:23 -05:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00