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 1wr0kN-0005th-0f for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Aug 2026 22:02:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wr0jM-001iau-1K for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Aug 2026 22:01:56 +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 1wr0jM-001ial-03 for pgsql-bugs@lists.postgresql.org; Mon, 03 Aug 2026 22:01:56 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wr0jJ-0000000048q-0faM for pgsql-bugs@lists.postgresql.org; Mon, 03 Aug 2026 22:01:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 673M1oaH752053; Mon, 3 Aug 2026 18:01:50 -0400 From: Tom Lane To: Andrey Rachitskiy cc: 1217816127@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19601: Vuln45: Unbounded recursion via self-retying Perl scalar in bool_plperl's SvTRUE call causes backend In-reply-to: References: <19601-92d59d2242c00966@postgresql.org> Comments: In-reply-to Andrey Rachitskiy message dated "Tue, 04 Aug 2026 02:10:50 +0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <752051.1785794510.1@sss.pgh.pa.us> Date: Mon, 03 Aug 2026 18:01:50 -0400 Message-ID: <752052.1785794510@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrey Rachitskiy writes: > Thanks for the report. I can reproduce the SIGSEGV on current master > (with --with-perl). I can't get excited about this. A plperl user who wishes to cause recursion to stack overflow can do so far more simply than what is proposed here: just write an indefinitely-recursive Perl function and call it. That recursion will be totally inside libperl, so we can do nothing about it. The same holds for every other PL that exposes a general-purpose programming language. I certainly wouldn't add the amount of code you propose here to close off just one route to that, even if I trusted the patch which I don't. (It seems far too much in-bed with details of libperl's innards, and hence likely to fail on other Perl versions than what you tested.) regards, tom lane