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.96) (envelope-from ) id 1wMLk4-002TEP-03 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 May 2026 08:11:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wMLk2-0006b8-2Z for pgsql-hackers@arkaria.postgresql.org; Mon, 11 May 2026 08:11:54 +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.96) (envelope-from ) id 1wMLk2-0006az-1a for pgsql-hackers@lists.postgresql.org; Mon, 11 May 2026 08:11:54 +0000 Received: from fhigh-b2-smtp.messagingengine.com ([202.12.124.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wMLk0-00000001GNR-1SpK for pgsql-hackers@lists.postgresql.org; Mon, 11 May 2026 08:11:53 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id E6B9F7A007B; Mon, 11 May 2026 04:11:50 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 11 May 2026 04:11:51 -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=fm3; t=1778487110; x=1778573510; bh=5AFuqcsuJe Gb0HOp2SepHUcUHg5PfzvnSdymmjUq/sc=; b=UySvciPBBp4ltFoAZrSs+OgOBg 7/awK63tpUOGJ16uKDxb06o++0sBH/Uu9NxXD40c7aXnkkxBN7C82WkLu6dQsDcW /eew/T3aCZv4DzXgwpf8aTkjM6zNVLkR0uO8SikLnF6JfR7w6ooLWbAKYXdVd0jm ZBrCyxFUKnaFTUXmoZBj5M8oVpC86pn29B57QTwgdozEVRmwzbZtY4J7ffSiNGIl wY/0Jazqg1kVw19GYLh9O3v1slFcwXFbZr6wl/p8MnewrOT8sZFLqQn74rvLagPt awQTEXgnRZgsCcjE092gSB4bk/zuwXKWJkbqXf8M5raauoN78ZBMx4awoaCw== 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=fm3; t= 1778487110; x=1778573510; bh=5AFuqcsuJeGb0HOp2SepHUcUHg5PfzvnSdy mmjUq/sc=; b=uGm4Bh+4XivSm6ibqK8hlGpMZ/FD1yCgKSXHaZX/58SeYlOMB8L 90dwb7VSfm048xhaz2pHprY64v9j2bGdrMa5MJk/gxjPP7o0GzVg2e0d2zB8K2qb XWm35EsVreECYk4q91D3t/2WnGbFRUoBVpr/zyKrhPdXzL6JEzLBx9Ooc6Z7beMS BXp0O82kM9NCRRgaNl9spdQhZSTeK3+j1xtU8kM/iYJcWO4Fao0fPwL3PvH7MoY1 ejXnRD1W1C4xkgOTqZo76HiPpiOThF5/QXWXpm+zbJmVXGIHMyQbQzKhD9s6lZbx gw5XrqsGCmm4TTKbBhoHjVFJ/AkEffqfJVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduudekgeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhhird gvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgr tghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 May 2026 04:11:49 -0400 (EDT) Date: Mon, 11 May 2026 17:11:45 +0900 From: Michael Paquier To: Chao Li Cc: PostgreSQL Hackers Subject: Re: Fix unsafe PlannedStmt access in pg_stat_statements Message-ID: References: <2F91906A-F2B5-4A6B-9695-D136957D4545@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H9AT7F9SoEZ4cvb6" Content-Disposition: inline In-Reply-To: <2F91906A-F2B5-4A6B-9695-D136957D4545@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --H9AT7F9SoEZ4cvb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 11, 2026 at 04:07:29PM +0800, Chao Li wrote: > However, commit 3357471cf9f5e470dfed0c7919bcf31c7efaf2b9 added a new > access to pstmt after that point: >=20 > The attached patch fixes this by saving pstmt->planOrigin, following > the same pattern already used for queryId, stmt_location, and > stmt_len. That would be my business. Missing a patch attached perhaps? -- Michael --H9AT7F9SoEZ4cvb6 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmoBj0EACgkQnvQgOdby QH2zrA/+Np9iF+iVHxtO2da6NfhS9bQUluDhQ1U8z2A5exlXbyGGzmGPd1b8hXBX YBEaH5ifVGPbwt9MPIu0mqpGF8LT9O7QozQNyMLki5ig6dKfsm5nLYchYpX6BVeM diabaOJFECU8Rqd+zdt231zVQrPn2hCPNu9RP4Hr3QrEWrsbxB8OYtYgm8oG+Q+f YPHEhSTfAKGEok3AZm+bCMP4S7+Ru3yD4d6gaIW5xjWESrAxDVoTel6ndk7TyeIt uUkrWZx5/vDwzoXTYpVykEyxMtJv8I2r/7rMmqrDI0/hJDtPJmmgOMFpcahXfBhP RMjgsuv6lUis9GvXv2+aO8mbj/EOYIPN1o1djzUsvAfTaZ5j0ZwOCLt0/X9N1PUB 9JZ614WTIbBgumlG+UDNcT7FpH1Y2qExh3AXJ1t+6dyCcjMnZNUPuVepZ+2AJOYw lRMrTYq02AgBPDCESAOdhFuhQfEm9Ow5PPSbIPn42UOVXfbTEWappfItwSMz0aTh cFjjpPhX37de65HTehVTRhmGwnCjIrrayCPJbTYIKEVoR6bF3K6uemCVpk1e6JqE boJgXuk9o2TvQVOUD1ZnQkqRhPKjNG3y5J0d6Nz0MvG8robTLoJ3RijKMixL5wwq rY43edQ6a9MCq4LPQq6Fxb1PybuogpCTe3S+x3k2jKah/58KbMY= =Q2AU -----END PGP SIGNATURE----- --H9AT7F9SoEZ4cvb6--