From nobody Sun Aug 28 09:43:21 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MFpY22Jhgz4bDfV; Sun, 28 Aug 2022 09:43:34 +0000 (UTC) (envelope-from agh@riseup.net) Received: from mx0.riseup.net (mx0.riseup.net [198.252.153.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx0.riseup.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MFpY047Zpz3s2g; Sun, 28 Aug 2022 09:43:32 +0000 (UTC) (envelope-from agh@riseup.net) Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4MFpXy6FH7z9sBk; Sun, 28 Aug 2022 09:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1661679811; bh=3doXzHEzYA4rs52rMpQGRBmbAeDSkGsTsld9btxcjEM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=syB9wQJr7T7s/qZThgNRvCR+cvbfH4BkgQsrhioNisfAowlWn2uCCKCCj9pIep3tL u1e6Trh1crg3Hc78q2Ba+46z83YzcVFzEIC69wR6lZgl+sFCH2eVJN4O7eYUVcbHwH RKos1ynkV2BrywCTubfBZMENJZ1Ug5QHxnmzoE5o= X-Riseup-User-ID: 67E60D59F6D5C73433D63EA6FBE0C536A2E329B60F4F02D86F749C40E9FE73F4 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4MFpXv42G5z1y9N; Sun, 28 Aug 2022 09:43:27 +0000 (UTC) Date: Sun, 28 Aug 2022 17:43:21 +0800 From: Alastair Hogge To: Michael Gmelin Cc: freebsd@oldach.net, Cy.Schubert@cschubert.com, otis@freebsd.org, freebsd@walstatt-de.de, freebsd-current@freebsd.org, freebsd-ports@freebsd.org, yasu@freebsd.org Subject: Re: security/clamav: /ar/run on TMPFS renders the port broken by design Message-ID: <20220828174321.59b23cbc@direwolf.home.arpa> In-Reply-To: <163333B4-76A1-4E46-B7C3-60492D379C6E@freebsd.org> References: <202208280842.27S8gDXn055868@nuc.oldach.net> <163333B4-76A1-4E46-B7C3-60492D379C6E@freebsd.org> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4MFpY047Zpz3s2g X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=riseup.net header.s=squak header.b=syB9wQJr; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (mx1.freebsd.org: domain of agh@riseup.net designates 198.252.153.6 as permitted sender) smtp.mailfrom=agh@riseup.net X-Spamd-Result: default: False [-4.10 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[riseup.net,none]; R_SPF_ALLOW(-0.20)[+a:mx0.riseup.net]; R_DKIM_ALLOW(-0.20)[riseup.net:s=squak]; RCVD_IN_DNSWL_LOW(-0.10)[198.252.153.6:from]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_SEVEN(0.00)[8]; ASN(0.00)[asn:16652, ipnet:198.252.153.0/24, country:US]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org,freebsd-ports@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[riseup.net:+]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[riseup.net:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sun, 28 Aug 2022 11:37:16 +0200 Michael Gmelin wrote: > > On 28. Aug 2022, at 10:42, freebsd@oldach.net wrote: > >=20 > > =EF=BB=BFCy Schubert wrote on Sat, 27 Aug 2022 17:26:38 +0200 (CEST): = =20 > >> As stated before in this thread, replacing /var/run with tmpfs is > >> not a supported configuration. =20 > >=20 > > Not supported? What is the purpose of /etc/rc.d/var then? That > > creates a tmpfs backed /var, populates it through mtree, and makes > > a proper /var/run available. > >=20 > > However it doesn't (yet) create /var/run/clamav of course. > >=20 > > It would be fairly easy to extend /etc/rc.d/var by a logic that > > walks through /usr/local/etc/mtree/* and runs mtree on each of the > > files found as needed. All that the security/clamav port would need > > to do then is to drop an appropriate small mtree file as > > /usr/local/etc/mtree/clamav. From a port's perspective that is the > > same logic as dropping service scripts as > > /usr/local/etc/rc.d/clamav-*. =20 >=20 > From a user's perspective, it would be preferable to have this happen > at service start though, as (unlike in the setup described) reboots > don't happen that frequently, but files in /var/run might get deleted > manually. Maybe some rc framework based solution would make sense, > e.g., a variable `mtree_files`, which, if set, is applied in the > default start_precmd. Besides being more resilient, this would also > have the advantage that all required file systems should be available > at that point and the separation between system and ports would be > more clear. Another advantage would be that directories are only > created for services that are actually enabled/started. Yes, something in the RC framework would be nice.