Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xC47S-00000003XMH-208n for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2026 23:53:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xC47R-00000004Sye-19CN for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Sep 2026 23:53:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xC47Q-00000004SyV-48ba for pgsql-hackers@lists.postgresql.org; Wed, 30 Sep 2026 23:53:48 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xC47O-00000002BO1-2x7t for pgsql-hackers@lists.postgresql.org; Wed, 30 Sep 2026 23:53:48 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id C09D47A0081; Wed, 30 Sep 2026 19:53:44 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Wed, 30 Sep 2026 19:53:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1790812424; x=1790898824; bh=ZvFAfZtDUI 3IOKLT7cgXHmCg9YucZaJWU/HtAwQUNl0=; b=noCOXFNYPRXEJ+sR+QYZrSzOEe TalWumWVim2i4o89fgoTT4pGD0dDBno9V5EEjcR2nCwr8uxfQUsi4rrmPaMzO+1N wQIXVH+JQ+vwBG1CWHVu7N48bsTqRkj7QPKZiqOzYL0tFiSef0cmovfvMCCVgcwz TwxDaO+QwYnp/p/gSFl8Bi4mzEh/BLZ8ZFYnDOrbtahDnO9P52g+kdbGo/SOGK5y jtOgmpmwfvUnflAWiaZrbe8p1WeUSNusbirtlPoGvyKaVQLuRZT0ICly5mWCVROe mvjC1xBWF1yiWsSViD2FbqXDpXIrsSTLY0RMpDcrzuyUjK4ztajVRuckj+nA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1790812424; x=1790898824; bh=ZvFAfZtDUI3IOKLT7cgXHmCg9YucZaJWU/H tAwQUNl0=; b=mshAzk9r6U69fajrC26gupjHOOEHMjVeIRHbUGFkoXkzwaqZJUy xobEqo76EixhqqzeRusaS7NuGcNDVOaEELkszRO86pR4VWMY9Rv+n5QUTNebOYft 3t5aogLORDJJrcUyiM25FOU2VhUuVdhww7X0BdxH+67/y0exQVW+D+RkB8mU8qrw xftb0FrWlYLkmyGlI7ahPpcbxqYTz1xbh5kGowbL41WEGxuGq/i++59kQ+qHsNfC 90X8sx300i+tP6RIyUKZ4NmaMXlxZFpu1qqWCb3uKIW0FOc+aWcyjp0ZbSck8EEi rZIKH8eWaEL2PTQi3fxJr3EUfgBA33K+yyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTER+juN9DaCE7g8/4MMfeeHctTbthgD54dnEB9iMubV8MLYDX6we9SU+AsOr2sM6L 1TA6IOmOVROLNGGmSNKuqbG8xe5Qz++h4YYSdwraEEABJuuktKSV0TatgNExipJbMBuuDo 90YTbO7n7hKZ/gu0LImkHv1jbMcif8uyx0/NogH6L4RwrcFpFMawwK7iV/7Q13Nq98iaFF oCdvOApR9f8rdZlu0diu1978b7cZdKu1ybeuUPl/1T8f6tPK05Vq8Kadntc6Gz0guKI5L/ po3fJb98uKhZbWI5sYrimuU2Kq0Ei6L/jUvx245CxLSwWCYWAAmBLEXOuOTMq9L001eRNE SjttNIZolApYCPQaJT1cAE27dPg/B45HUTx5NOv8l9sOW9WRvJ7cpY4fH+roZulhsYdYFB VKhwWCM5+ZZE19FXgiPWmKxIVmfyybZws4X1Dj9O4b1wis0JktVrvytx1W/cac7HRqMghs u7ys/qLA5wbKW4db3hzOTvOTV/8uQhdnTp1flCWrGnJma5iMbbJ/4t2gXi+zW9bmxhx4D2 IqEUTMYzI6Ypvf+GiQdiFpqSe3pTrZ5lkzadJtaQIXzI1vZi7mgPRreCKR0dKBsEIc+CMp BtBGSfWtLnGnKd71DxwE1Vk3042lC7jd0Zqw/AgZULKvO1qhZ6Mpgk8Kha2w X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 30 Sep 2026 19:53:42 -0400 (EDT) Date: Thu, 1 Oct 2026 08:53:40 +0900 From: Michael Paquier To: Grigorev Jurij Cc: Rahul Yadav , "pgsql-hackers@lists.postgresql.org" Subject: Re: BUG #19599: RestoreBlockImage: the decode cross-checks never bound hole_offset + hole_length against BLCKSZ Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mNNfTG3JkWehe1tI" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mNNfTG3JkWehe1tI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 29, 2026 at 08:37:02AM +0000, Grigorev Jurij wrote: > Thank you very much for the thorough review and testing -- the > crash-recovery matrix (pglz/lz4/zstd/off + consistency checking) and > especially the crafted-record repro with pg_waldump --save-fullpage > crashing without the patch are super convincing. And thanks for > confirming the back-patch safety argument. >=20 > v2 attached, addressing all your points: XLogRecordAssemble() in xloginsert.c enforces a size policy already when a page image needs to be included in a record (REGBUF_STANDARD case, for both the "lower" and "upper" cases). The argument of a corrupted record does not stand, a CRC32 check would complain before we ever reach this path. The hand-made record record argument is also something I have a hard time to buy, because WAL data is trusted. So, I don't understand what this patch buys us at all, except more complexity in the replay path. There may be an argument for the xlogreader facility, but this relies on the premise that incorrect WAL records are a thing out there. Again here comes the CRC check in the record header and the WAL insertion enforcing already some bounds. This feels like test bloat to me. -- Michael --mNNfTG3JkWehe1tI Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmq9oQQACgkQnvQgOdby QH3S1hAAj/+YhVI2sxJmLuo7rD5w43r6MeQxeKSsKvPxM3cydxxivreN7o9tQz8G Q2xBe+6lc+47uDkvaFHPU9XJalo0rd/1FeFg5p6stE3ohXLchr0WoKgrkzrG+c8/ ApDHhEOSdnl7r7VAA+EY83dod5pfVffGIFG/bY8wi6aOeNmpNB0cY8H76CwfaSWy +CuDbf8Y1hiZbiY876oRDCHWOt31mkehbHkwWrgzDwBuKXGBOB/4UoROECzTGvzV EiN4oTJpL3hnNgrPXC6kihiQcwR06OlAugUsuqzl7NHAXyRmuh84We+lbyZv6G5O xLyqDHBj7TqavZPWS2ivHPKG12OiNkCthP9LeFb4JVihudGR7IjzBjeRHOhYXWyM DRXkPSnl3nzu6z0froEKnDkiQ1GlgZ/090h6skjEhNF4G9z5VAAKxi+F4r2k+OSE Zs1GzdZaoIEUylV9PQJvrvhrJmaBayN99Eqk1IZO0rzyuM/JYQfgcnWDkjw50+xp VVvFd39wL998EhZHXIbnB9U6QU9vzJRXvlzLidLWpAg0dtwn6n8zmBYHiw4NRfj+ fp0og55Gx6h8neKDvdUWi17OSaxS+fHskK4nqiwsccj1hFOV+dwQPk6aZ+nFJZA0 btRBgd2Jk4eD2wWZ0DZ3LGKjTePxPdWIEeqo5a9Rt1msNNuk8Yk= =X0TE -----END PGP SIGNATURE----- --mNNfTG3JkWehe1tI--