pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Berg <myon@debian.org>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Michael Paquier <michael@paquier.xyz>
Subject: Re: pgsql: Don't trust unvalidated xl_tot_len.
Date: Sat, 11 Nov 2023 21:03:27 +0100
Message-ID: <ZU_eD-JQCNA1tPSp@msg.df7cb.de> (raw)
In-Reply-To: <CA+hUKGL=9x4G6FMDDa9p-BCndjMhbrh05_vYhMj9WyyriNN08Q@mail.gmail.com>
References: <E1qjozv-005NY4-Rr@gemulon.postgresql.org>
	<ZU5yKecW5yMKKhtp@msg.df7cb.de>
	<ZU6jwsm4XvmAUUTN@msg.df7cb.de>
	<CA+hUKGLm3+2NZX1pEv+2Ky+MmD+nLeBxsNxKYtowepHUnbg8FQ@mail.gmail.com>
	<ZU9rQYbAenlvgpsg@msg.df7cb.de>
	<CA+hUKGJrpmenQWXhTPQ4zqcqzT7e8gKFxrQLL3-9a+Wf1zrxtQ@mail.gmail.com>
	<ZU_Hc8aIvKynfYS2@msg.df7cb.de>
	<CA+hUKGL=9x4G6FMDDa9p-BCndjMhbrh05_vYhMj9WyyriNN08Q@mail.gmail.com>

That's a lot of questions :). Let me try:

> In your chroot after it fails, can you please find xlog_internal.h
> somewhere under tmp_install and tell us the full path, and can you

./build/tmp_install/usr/include/postgresql/13/server/access/xlog_internal.h
./src/include/access/xlog_internal.h

> find pg_config (however many of them there might be, I'm a little
> confused on where and when Debian creates extra versioned variants)

That's only after testing and `make install`:
https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/server/postgresql.mk#L219-225

> and tell us the full path,

./build/tmp_install/usr/lib/postgresql/13/bin/pg_config
./build/src/bin/pg_config/pg_config

> and also what --includedir-server prints,

$ ./build/tmp_install/usr/lib/postgresql/13/bin/pg_config --includedir-server
/usr/include/postgresql/13/server

> and can you also find regress_log_039_end_of_wal and confirm that it
> contains a complaint about being unable to open a file, not a
> complaint about being unable to execute pg_config?

$ cat ./build/src/test/recovery/tmp_check/log/regress_log_039_end_of_wal 
No such file or directory at /home/myon/projects/postgresql/debian/13/build/../src/test/perl/TestLib.pm line 655.


The 13-bullseye version of the package still has the "don't relocate
me" patch:

https://salsa.debian.org/postgresql/postgresql/-/blob/13-bullseye/debian/patches/50-per-version-dirs...

The PGBINDIR mangling is exactly what is breaking the use case now.
The commit that removed that bit in the 15 branch explains why it was
there:

https://salsa.debian.org/postgresql/postgresql/-/commit/a249c75e86fe8733b11c47630e4931c5c196e8da

I can (and should) do the change also in the other branches, but from
the 2022 discussion, I had the impression there were more reasons to
prefer static paths instead of calling pg_config from tmp_install.

After all, this seems to be the only 2nd case of actually calling
pg_config from tests if I'm grepping for the right things - the other
is check_pg_config() called from test/ssl/t/002_scram.pl. (I wonder
why that's not failing as well.)

Christoph





view thread (13+ messages)  latest in thread

Message-ID: <ZU_eD-JQCNA1tPSp@msg.df7cb.de>
Permalink:  ../ZU_eD-JQCNA1tPSp@msg.df7cb.de/
Also on:    postgresql.org/message-id/ZU_eD-JQCNA1tPSp@msg.df7cb.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: myon@debian.org, thomas.munro@gmail.com, michael@paquier.xyz
  Subject: Re: pgsql: Don't trust unvalidated xl_tot_len.
  In-Reply-To: <ZU_eD-JQCNA1tPSp@msg.df7cb.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox