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.94.2) (envelope-from ) id 1rukAf-007N3z-Ip for pgsql-committers@arkaria.postgresql.org; Thu, 11 Apr 2024 02:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rukAe-00Bvhg-LU for pgsql-committers@arkaria.postgresql.org; Thu, 11 Apr 2024 02:28:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rukAe-00BvhY-Dv for pgsql-committers@lists.postgresql.org; Thu, 11 Apr 2024 02:28:12 +0000 Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rukAb-002HIB-Oz for pgsql-committers@lists.postgresql.org; Thu, 11 Apr 2024 02:28:11 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.west.internal (Postfix) with ESMTP id B828E1800135; Wed, 10 Apr 2024 22:28:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 10 Apr 2024 22:28:06 -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=fm2; t=1712802486; x=1712888886; bh=mzq8TzsvEA ixMDJ+X82/YLSsh/BfGCjd7uwKVJ4Lqn0=; b=fBeafN3Rh6oHv8rew6I+KL9x8p sEf28IEtyepY71LHFZeF4FRK07DJTfcujedacKoDf0UZaifWrebeF5jj5SLK+Zrj Vhik5L0Db8DwDGgxu9w4T7VoPFrWBZZZSZPK58030xPbUz+8N5x89FaU31GoBXdM uR0/MfuTAKJLxBYczqbenSJEur7NLBuXWCgK9O0a9CMkk0e3/ikQ3Pxrjcn7Jloi 3oz5sRxfo/vAJKDR+n4fmsAXBeAKv+QQTkQ/Jy0BtUenLf4FGtW2ET72QIAL3bZE 1dV8JcBi5GcOG8NW3K2vxDOJ0RgsZb0g/JOXqwknDIbUEOAWAqbwgRPLBxZg== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712802486; x=1712888886; bh=mzq8TzsvEAixMDJ+X82/YLSsh/Bf GCjd7uwKVJ4Lqn0=; b=a9oY6/+4k5+y0ZVkLuzIj6nz5m3bXmd9pED8hqQZSA9Q HPYJVAgfVzNzsfWneXYPdW3unaV+87tfhz6jvw9PUCKUKqcQjDG7h75dxZga5HPK iPCLa3lmXHuj9eoK5NyRlF2UJ1oV27g9ErqWa4q+Hf4D4ezoE1h7NwOV3dVhvH8+ zOMeFCLw5s2kjWO2vdlW/irMg7ztkoI2LEFMiwQWRcY/zjVb/VU6eOdrj3TMgnfz iFnFTqA4VWXeJJmweH5O0AJ0N1d5HBe+g2h0nUFxQe+SlyJmwmFPgiqi+H+6dMGb kA+UQZ/z3ehD4pQINHPBB/F8uYVF+3H88jaG+4J7eA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehjedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Apr 2024 22:28:04 -0400 (EDT) Date: Thu, 11 Apr 2024 11:27:54 +0900 From: Michael Paquier To: Thomas Munro Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Fix potential stack overflow in incremental backup. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2kWyegQk2T1J3t3O" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --2kWyegQk2T1J3t3O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thomas, On Thu, Apr 11, 2024 at 01:53:24AM +0000, Thomas Munro wrote: > Fix potential stack overflow in incremental backup. >=20 > The user can set RELSEG_SIZE to a high number at compile time, so we > can't use it to control the size of an array on the stack: it could be > many gigabytes in size. On closer inspection, we don't really need that > intermediate array anyway. Let's just write directly into the output > array, and then perform the absolute->relative adjustment in place. > This fixes new code from commit dc212340058. + * file just as if this were not an incremental backup. The contents of t= he + * relative_block_numbers array is unspecified in this case.=20 Perhaps you mean s/is/are/ here? The contents are what's not specified. -- Michael --2kWyegQk2T1J3t3O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmYXSqoACgkQnvQgOdby QH1ezA//cpIiVNrHqEeUKNpzHgBuss9zFxakUIej4UPP6+VhhCDzk5YkOI590Ij/ R5KJ6izxIpVF454BA8R8T76dQ8tkoc1/zLH5HOrimj9nQElZY4eAQ4RDqvZ/RvPm CUIe1MHDnllBl/h4jnrx+lw8H/VFet+mriD2qPBZTPmPnzsyJedq0h3QtI5v3Oe2 8Y4EJtJ5buXEIq4nxZ5Cg9zNbMOIV1gEzZu+BzpELwYyj0SGxgYM1C0NYn/TLewe 1OKsIml89y50JL1scFxIMTbEWXquV5HXvh9Q8dSPo/MPqV8Dxrz3SXjSF/LPtcam LCkoNqF/Huoo/amwtFB1wrug5suNBaRrSm0LNrqMTxjg59mt3GR03zCsFzp2xTEb j/nDaFLNxUwz+Z+nifeYdqUL6TEZQyLRtEQExskEYT6oSFh5o9U8o0bqMSwhTAuE gNhVNDoRQfLqCsXnK8H5vvubeVP3X0ZXELO/J2KHnRvVFO0i63yAf92SdaxJbnoi HsxQzSlkIdmVN4jvVt1/T3Bftv3mjfYSG3Tejd6iV+6cIrdo8k7XC8A9PKhDAFrN Z/50EWA1AuK80EnuFERZRsCm+wNMZzgktX0gWs7zhbsvd1bmTezq0SHt/Xz2GUfd f0cP1k6/pPxvvXMTYG8uu3yG2KYNjmPgaWQEN89IjCBcMBnKaQk= =hn5l -----END PGP SIGNATURE----- --2kWyegQk2T1J3t3O--