Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4rAl-0001sj-9R for pgsql-general@arkaria.postgresql.org; Tue, 04 Jan 2022 21:16:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4rAk-0001io-3X for pgsql-general@arkaria.postgresql.org; Tue, 04 Jan 2022 21:16:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4rAj-0001if-Pa for pgsql-general@lists.postgresql.org; Tue, 04 Jan 2022 21:16:45 +0000 Received: from smtp.burggraben.net ([2a01:4f8:140:510a::3]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4rAd-0001HV-GB for pgsql-general@lists.postgresql.org; Tue, 04 Jan 2022 21:16:45 +0000 Received: from elch.exwg.net (elch.exwg.net [IPv6:2001:470:7120:1:127b:44ff:fe4f:148d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "elch.exwg.net", Issuer "R3" (not verified)) by smtp.burggraben.net (Postfix) with ESMTPS id 8720FC0030C; Tue, 4 Jan 2022 22:16:37 +0100 (CET) Received: by elch.exwg.net (Postfix, from userid 1000) id C927D3AB09; Tue, 4 Jan 2022 22:16:36 +0100 (CET) Date: Tue, 4 Jan 2022 22:16:36 +0100 From: Christoph Moench-Tegeder To: Michael Paquier Cc: Michael =?utf-8?Q?M=C3=BChlbeyer?= , "pgsql-general@lists.postgresql.org" Subject: Re: md5 issues Postgres14 on OL7 Message-ID: References: <89B7F072-5BBE-4C92-903E-D83E865D9367@trivadis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ## Michael Paquier (michael@paquier.xyz): > On Mon, Dec 20, 2021 at 03:22:31PM +0100, Christoph Moench-Tegeder wrote: > > Active FIPS mode (/proc/sys/crypto/fips_enabled => 1) on the server does > > produce this behaviour. > > Most likely, this is a build linked with OpenSSL? The way MD5 hashes > are computed in Postgres has largely changed in 14, and the code has > been refactored so as we rely on the EVP APIs from OpenSSL when > building with --with-ssl=openssl, having as direct consequence to > allocate a bit more memory every time a hash is computed. You can reproduce that behaviour with the PGDG-RPMs on CentOS 7. Enable FIPS-mode, reboot, and immediately md5() fails. The PGDG-RPMS are built with openssl ("--with-openssl" in pg_config output), as of course you need SSL today. "Supports FIPS mode" is one of the selling points for your cryptohash patches in the Release Notes, and that means no md5 when FIPS is enforced (I think FIPS is a little too strict in this regard, as people do invent horrid workarounds, which does not really improve matters; but that's another can of worms). Anyway, it's not the memory, but "out of memory" is all PostgreSQL reports when anything in the hashing operations returns a failure. Regards, Christoph -- Spare Space