public inbox for v9fs@lists.linux.dev
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Ariadne Conill <ariadne@ariadne.space>
Cc: v9fs@lists.linux.dev, xen-devel@lists.xenproject.org,
	asmadeus@codewreck.org, linux_oss@crudebyte.com,
	lucho@ionkov.net, ericvh@kernel.org,
	Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alex Zenla <alex@edera.dev>
Subject: Re: [PATCH] 9p/xen: mark 9p transport device as closing when removing it
Date: Tue, 9 Dec 2025 12:12:25 -0500	[thread overview]
Message-ID: <efbab440-cb84-4900-989c-43d0d69b60f2@gmail.com> (raw)
In-Reply-To: <BD7157CB-3064-4194-ABD9-8A4D9F57E908@ariadne.space>


[-- Attachment #1.1.1: Type: text/plain, Size: 1923 bytes --]

On 12/9/25 12:09, Ariadne Conill wrote:
> Hello,
> 
>> On Dec 9, 2025, at 2:43 AM, Demi Marie Obenour <demiobenour@gmail.com> wrote:
>>
>> On 12/8/25 14:51, Ariadne Conill wrote:
>>> We need to do this so that we can signal to the other end that the
>>> device is being removed, so that it will release its claim on the
>>> underlying memory allocation.  Otherwise releasing the grant-table
>>> entries is deferred resulting in a kernel oops since the pages have
>>> already been freed.
>>
>> I don't think this is sufficient.  The backend can simply refuse
>> to release the grants.  The frontend needs to ensure that the pages
>> are not freed until the grant table entries are freed.  Right now,
>> the backend can cause a use-after-free in the frontend, and my
>> understanding of the Xen Project's security policy is that this is
>> a security vulnerability in the frontend code.
>>
>> My instinct is that the core Xen code should take a reference on
>> each page before granting it to another domain, and not release that
>> reference until the pages are no longer granted.  This should prevent
>> any use-after-free problems if I understand Linux core MM correctly.
> 
> Yes, there are other issues in the 9p transport that are likely in play here.  In our internal testing, we confirm this is not a full fix for hotplugging 9p transport devices, but no such claim of a complete fix has been made here or in the Matrix thread.
> 
> However, this is one defect that is contributing to the overall hotplugging problem and should be merged regardless: if the driver isn’t telling the other side to disconnect, the other side will never release the grants to begin with.
> 
> Ariadne

I definitely agree that this should be merged!

Is this code-path triggerable by the backend at will, or only during
teardown by the toolstack?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-12-09 17:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 19:51 [PATCH] 9p/xen: mark 9p transport device as closing when removing it Ariadne Conill
2025-12-09 10:41 ` Demi Marie Obenour
2025-12-09 17:09   ` Ariadne Conill
2025-12-09 17:12     ` Demi Marie Obenour [this message]
2025-12-09 17:18       ` Ariadne Conill
2025-12-18  8:14   ` Jürgen Groß
2025-12-20  2:02     ` Demi Marie Obenour
2025-12-09 20:45 ` Marek Marczykowski-Górecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efbab440-cb84-4900-989c-43d0d69b60f2@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=alex@edera.dev \
    --cc=ariadne@ariadne.space \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@kernel.org \
    --cc=jgross@suse.com \
    --cc=linux_oss@crudebyte.com \
    --cc=lucho@ionkov.net \
    --cc=sstabellini@kernel.org \
    --cc=v9fs@lists.linux.dev \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox