From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13202 invoked from network); 15 Aug 2022 11:02:20 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 15 Aug 2022 11:02:20 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob0.topicbox.com (Postfix) with ESMTP id 965B3287B9 for ; Mon, 15 Aug 2022 07:02:18 -0400 (EDT) (envelope-from bounce.mM52976e87f40d78ae095f576e.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 900663135B9B; Mon, 15 Aug 2022 07:02:18 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:from:date:mime-version :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:subject:list-unsubscribe; s= sysmsg-1; t=1660561338; bh=d6hK27ZeMMrjYxbCAviWmXhy2oEBCJhZOVcu2 Z59qYY=; b=BTkGERLWMnECt3PkmDdxa/3T6YXlGlZ9LNFXAgkSXAVDvfq7TW0f8 rRPrrpIvXFLd9XGoelfawGn+tu8+/X01u7TGZlZ8QHKkBS0lwusObK+lME9CvxSJ +v+jp9stgpUwUrqlzAB8TGcP+IxHanQnV2SVQaDN2Pu6QQ+CmszUiI= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1660561338; b=V/qXihTc6tE6VW9wqASceE+hnXSsbQxOGvbi6Ft3sZNFJ2fRid ll20ELkGuOxIru9Fn3vr+1x2ZShFFZSLm+rLiIxtvYR6uBB6X3IwrVVTwGxeipnQ mplQkngu7ufOyQxQi6HueVqLGPSlNKb3pZny73H1h9A2hgKUuoefw8y8U= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; iprev=pass smtp.remote-ip=46.235.227.24 (mx2.mythic-beasts.com); spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-aligned-from=domain_pass (Domain match); x-me-sender=none; x-ptr=pass smtp.helo=mx2.mythic-beasts.com policy.ptr=mx2.mythic-beasts.com; x-return-mx=pass header.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-return-mx=pass smtp.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=message-id :to:from:date:mime-version:content-type :content-transfer-encoding:list-help:list-id:list-post :list-subscribe:reply-to:subject:list-unsubscribe; s=dkim-1; t= 1660561338; x=1660647738; bh=d6hK27ZeMMrjYxbCAviWmXhy2oEBCJhZOVc u2Z59qYY=; b=ZHmNHtCYFlkjTbKThhFt2CRd6g+bS5nzBNRd7LAZagaHh8J+Xc4 je2CLmJgojAMTDCpiHpOmgwn5z12Kb24ilkwu4YxXEFPdIH0ep9P+SFxm0d5Kl/e E7ehzOzEaozoQoGWo1Kv2VtLFGQ5HRZNgyNWskNJ4FNLFGDw+7Qjqq2w= Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id F2D14169FB7B for <9fans@9fans.net>; Mon, 15 Aug 2022 07:02:06 -0400 (EDT) (envelope-from miller@hamnavoe.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 74A4C212ED2; Mon, 15 Aug 2022 07:02:06 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1660561326; b=XEB5so5kfaWevTEv/NGwuBNiAd/Tld9qj6tMveVcANjHfLNycr 8/FMxm4YUv6sNdyjtfjfGCaNwkmbx1qIQdlCsxxlPII6pBTVc9MDlT29qmiPOk+y Ng0QfRcAy1q7OkTgWB2x6zJnSdCp80WO5XeKXr13ml5jeG5OBcJDT44cTlUqHZWz 4IOLphmhP5PcdjNIMKHbiY68omWqfRLH+eSTYAgUgwSYRGHDXqNXRP7fmn+QJiA8 Xdwi6l0JAm8MPpbzterixBkJlsisX6up+GC3JluGe/BJ4kXRZBYkAZEq8HhOIjN2 EEGNxbChVdS/sSf4dOMmlbSfP5xYT4vXPN+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:from:date:mime-version :content-type:content-transfer-encoding; s=arcseal; t= 1660561326; bh=BWhtNaIW2IzvbABLtX3Z+D7xmFDgWXGPxV6EqCiqAeA=; b=g yVWZ902lg12+4ui0yzqNHbVkR18HP1irxFTa7pmmHBt/cr2IsnrfzDttruRGeUOS AKaQ0cEHi1sprBuvj1puV4TwCJz5LHDwz8mH4l2SUmODAn3Mrpv8sE7vSx50ewn7 pJNEOFDOZ7hC9GGEzcYoX1g35CbuCjVZppYwKEXcrXz0kpjwMEGrxpbDvyft0Ys1 MVJsQEnG9j/YGMhvUZJo2DOVT/8i2BzYJjPCnCYcm2SjDI+auSeEcNNwviO6IzYH VdjrzeLkngJsAIN2gFMcm4FxRK2mmaSSjuH5xge70zVEKiqIldC1XF5hmhGjZ2PB QprUsrNRi6bMxk6F10xjA== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; iprev=pass smtp.remote-ip=46.235.227.24 (mx2.mythic-beasts.com); spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-aligned-from=domain_pass (Domain match); x-me-sender=none; x-ptr=pass smtp.helo=mx2.mythic-beasts.com policy.ptr=mx2.mythic-beasts.com; x-return-mx=pass header.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-return-mx=pass smtp.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehvddgfeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkvffuhf ffgggtgfesthejjhdttddtvdenucfhrhhomheptfhitghhrghrugcuofhilhhlvghruceo lehfrghnsheshhgrmhhnrghvohgvrdgtohhmqeenucggtffrrghtthgvrhhnpeelfedtud fhgeeujeeluefhtdeuieeivdeuieeiveeluddvgfelveetudelkeehheenucfkphepgeei rddvfeehrddvvdejrddvgedpkeekrdeljedrvdejrdekfeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepihhnvghtpeegiedrvdefhedrvddvjedrvdegpdhhvghlohep mhigvddrmhihthhhihgtqdgsvggrshhtshdrtghomhdpmhgrihhlfhhrohhmpeeomhhilh hlvghrsehhrghmnhgrvhhovgdrtghomheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (hamnavoe.com: Sender is authorized to use 'miller@hamnavoe.com' in 'mfrom' identity (mechanism 'include:_spf.mythic-beasts.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="miller@hamnavoe.com"; helo=mx2.mythic-beasts.com; client-ip=46.235.227.24 Received: from mx2.mythic-beasts.com (mx2.mythic-beasts.com [46.235.227.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Mon, 15 Aug 2022 07:02:05 -0400 (EDT) (envelope-from miller@hamnavoe.com) Received: from [88.97.27.83] (port=64492 helo=hamnavoe.com) by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.2) tls TLS_RSA_WITH_AES_256_CBC_SHA (Exim 4.94.2) (envelope-from ) id 1oNXrA-00CW9Q-6Y for 9fans@9fans.net; Mon, 15 Aug 2022 12:02:04 +0100 Message-ID: To: 9fans@9fans.net From: Richard Miller <9fans@hamnavoe.com> Date: Mon, 15 Aug 2022 12:02:02 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BlackCat-Spam-Score: 1 Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: b6cf4072-1c89-11ed-9d2b-850e74f8e064 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UYzM2NGI3NjZmZjY0NzNiYy1NNTI5NzZlODdmNDBkNzhhZTA5NWY1?= =?UTF-8?B?NzZlPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] ramfs bug List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M52976e87f40d78ae095f576e:1:lm_7tOfo194Jr159TwnLFMDV04SUA-bUDX8eg5k8qIg Deleting an open file on ramfs(4) can have surpising results. Here's how it's supposed to behave. When a file is removed, the Ram struct which represents the in-memory file has its busy flag reset, so a subsequent i/o will see that it's been deleted. cpu% ramfs cpu% echo this is x >/tmp/x cpu% { sleep 10; cat } : file does not exist However, before the i/o takes place, it's possible for another file to be created and re-use the same Ram struct, setting the busy flag again. The process which had the deleted file open is now doing i/o to a different file, without any checks on its permissions, exclusive use flag, etc. cpu% ramfs cpu% echo this is x >/tmp/x cpu% { sleep 10; cat } /tmp/y cpu% actually this is y A simple fix is to add a reference count to the Ram struct, to keep track of how many Fids point to it, and only allow a Ram to be re-used if both busy=3D=3D0 and ref=3D=3D0. The new 9legacy patch ramfs-refcount makes this change. Note to 9front users: don't worry, your ramfs is a completely different program using the 9p(2) library, which doesn't have this flaw. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tc364b766ff6473bc-M52976= e87f40d78ae095f576e Delivery options: https://9fans.topicbox.com/groups/9fans/subscription