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 1u2CvZ-00Ego5-QU for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 08 Apr 2025 17:40:01 +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 1u2CvY-00DBln-4S for pgsql-pkg-debian@arkaria.postgresql.org; Tue, 08 Apr 2025 17:40:00 +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.94.2) (envelope-from ) id 1u2CvX-00DBlg-Ua for pgsql-pkg-debian@lists.postgresql.org; Tue, 08 Apr 2025 17:40:00 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2CvV-004BBR-1J for pgsql-pkg-debian@postgresql.org; Tue, 08 Apr 2025 17:39:59 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-ac34257295dso1179840566b.2 for ; Tue, 08 Apr 2025 10:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seiler-us.20230601.gappssmtp.com; s=20230601; t=1744133995; x=1744738795; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=MwEcFrShNZqJuVMyEWimEy/zpOuGUOI/ktFt6oaJHLU=; b=FIExUYqGyXjEVkdL7p9VMnp6Ny5CXszXT388StbtH1ov+ZRZ2+CG00eUj2DQPuZe4Y tuJMQc/mfL1YDop0k8Eu4VqmdZK2DIX9G03NzW6Om7t4E9Z/CcVd59SGLtNeBxqS4cQu 8Bnp/agI1Jgv9IHLp4SRzjC1PG3F8mv5cTnhhNo2exnWsPI0utuAH/W7ySrd/Ymp4bce 86dpI+q4P7zwSWJ8QoBZp7WfDd+nGjwQ27UHGiFrqSuz0w+Y3u3Qw+ocvFqJ3ffyHvU9 90bg3fCH6KBFz+AUwAWtKit7UDx2wYCGmo+SLzOhrIElrwNOaq4NFAb4xKyxmM+TsRiJ 6hGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744133995; x=1744738795; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MwEcFrShNZqJuVMyEWimEy/zpOuGUOI/ktFt6oaJHLU=; b=bY6RH53fJ56F5qnzdBU948CEFkNLLbXsnxjRAlslDiplUo4EcYCG95L5Q/7T0uBdt+ bWgvLQ0BZdiuDT6Oqodet2UD6gKw1sv5Sy0YixuZ60zLYOYdIPYhrwFJIvH5HYnAgq4L oaEWZ3gkyxIQPdvi9kq6ZknYWo8eVNkdYkeFvojT32s6kHXDBRHMAXMTYliMuO0who5i 0Owb2BhS4VZIBPHFZCNkbr5yt3Yv+F/f3u6oNP1Ahls0LE7gYpV0LH+bSlsHknT9WzMG ASSgUFXHarjp3C1JoIlz1nk8j1cMyAVEImrQOYtCfqDPLZfiFsOgn9/uAnxiQd0+kmc6 ycYA== X-Gm-Message-State: AOJu0YzHAORkqH5fqtLOb4TuuGQL2Aay6kF6ElNSxEm5aO1Fv6RcAU2D upnZAjdO91rvF6i2Aa6ZUrmFNBCn8QGHTio1s+uShQqXM09vFl2ByCTobXSFun3Omczg7sflIKv W8eYozY5pe/EnvC+dVro93VFZWXSi+NSTibIitPITTvqMMZw6TW/J2w== X-Gm-Gg: ASbGncsZLBM2VGK0YZrAtQbANErxnxZ9G8zcFoz8GMs4jccBzZYrgf4Y+Zg5yV0MhFx k0d0/u6f/1oQOPShOb9DLScrQZ67too8id5tiZ5MOR732BBHlRsahAyr+aI1LpnwaYC1wIJ4+hA P8Ra8Gmwv/J6kHOw9NoXEw5S10fJDOls0i5IydwzNOMBJjkNq6qG92dIUAop0= X-Google-Smtp-Source: AGHT+IHdnh2CZwcLOukGBTBOl/rbfWi+uMllXo84yviP61cPPLz1DsetagrM95kCvcrnTEyGDDdHpRiqAIxssK/Gk0k= X-Received: by 2002:a17:906:f587:b0:ac1:da09:5d32 with SMTP id a640c23a62f3a-aca9b5b3623mr12135666b.6.1744133994544; Tue, 08 Apr 2025 10:39:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Don Seiler Date: Tue, 8 Apr 2025 12:39:42 -0500 X-Gm-Features: ATxdqUGori_xHMcNxljBFvBy8ZeY8Hw6ffZEN8C5C7BrHhaK15LETh64bAtshNA Message-ID: Subject: Re: Errors installing/updating postgresql when /tmp has noexec To: pgsql-pkg-debian@postgresql.org Content-Type: multipart/alternative; boundary="0000000000002f9cde063247d747" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002f9cde063247d747 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 8, 2025 at 12:21=E2=80=AFPM Don Seiler wrote: > After some recent system hardening, I'm now getting these errors when > running apt to update our PGDG postgresql packages. In this case we are > running postgresql-15 on Ubuntu 22.04 LTS. > > Preconfiguring packages ... > Can't exec "/tmp/postgresql-15.config.rOsJHJ": Permission denied at > /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.pm line 178. open2: exec of > /tmp/postgresql-15.config.rOsJHJ configure 15.8-1.pgdg22.04+1 failed: > Permission denied at /usr/share/perl5/Debconf/ConfModule.pm line 59. > > This doesn't cause the install the fail though, and postgresql gets > updated to 15.12 and starts up just fine. It's not clear to me if there i= s > now some danger/flaw in my installation or if this is something that can = be > ignored. > > It doesn't appear that I can just set an environment variable like TMP, > TEMP, TEMPDIR etc to change this. I see that it can be changed via an apt > config change[1]. > > However, I'm wondering if this is something that's better changed in the > packaging. Setting noexec on /tmp (and /var) is a standard CIS/DISA > security requirement now. > > 1. > https://askubuntu.com/questions/1452390/install-packages-on-systems-with-= secured-tmp-and-var-noexec > For what it's worth, setting this apt config to specify a non-/tmp path works around the problem: $ cat /etc/apt/apt.conf.d/99tempdir.conf APT::ExtractTemplates::TempDir "/some/other/tmp"; However it seems like we still shouldn't be trying to exec from /tmp by default either. In the meantime we'll see how best to quickly deploy this workaround to our fleet of machines. Don. --=20 Don Seiler www.seiler.us --0000000000002f9cde063247d747 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Tue, Apr 8, 2025 at 12:21=E2=80=AFPM Do= n Seiler <don@seiler.us> wrote:<= br>
After some recent system hardening, I'm now getting these errors = when running apt to update our PGDG postgresql packages. In this case we ar= e running postgresql-15 on Ubuntu 22.04 LTS.

Preconfigu= ring packages ...
Can't exec "/tmp/postgresql-15.config.rOsJHJ&= quot;: Permission denied at /usr/lib/x86_64-linux-gnu/perl-base/IPC/Open3.p= m line 178. open2: exec of /tmp/postgresql-15.config.rOsJHJ configure 15.8-= 1.pgdg22.04+1 failed: Permission denied at /usr/share/perl5/Debconf/ConfMod= ule.pm line 59.

This doesn't cause the install the f= ail though, and postgresql gets updated to 15.12 and starts up just fine. I= t's not clear to me if there is now some danger/flaw in my installation= or if this is something that can be ignored.

It d= oesn't appear that I can just set an environment variable like TMP, TEM= P, TEMPDIR etc to change this. I see that it can be changed via an apt conf= ig change[1].

However, I'm wondering if this i= s something that's better changed in the packaging. Setting noexec on /= tmp (and /var) is a standard CIS/DISA security requirement now.
<= br>

For what it's worth, setting thi= s apt config to specify a non-/tmp path works around the problem:

$ cat /etc/apt/apt.co= nf.d/99tempdir.conf
APT::ExtractTemplates::TempDir "/some/other/tmp= ";

However it seems like we still shou= ldn't be trying to exec from /tmp by default either. In the meantime we= 'll see how best to quickly deploy this workaround to our fleet of mach= ines.

Don.

--
Don Seiler
www.seiler.us
--0000000000002f9cde063247d747--