The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: chenglong ma <longpareto@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Xie Yongji" <xieyongji@bytedance.com>,
	virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/2] vduse: reject imports backed by VDUSE domain files
Date: Wed, 2 Dec 2026 20:41:39 +0000	[thread overview]
Message-ID: <axCCbhn37aBxZFd4@gremlin> (raw)
In-Reply-To: <8c051ac47f91aa3c6583ab306b9b48f39c4a75d2.1796141756.git.longpareto@gmail.com>

On Wed, Dec 02, 2026 at 09:14:16AM +0800, chenglong ma wrote:
> vduse_domain_set_map() rejects the target domain's own file by comparing
> file pointers. Sashiko pointed out that once VDUSE domain mappings can
> be imported through vhost-vdpa, this check would allow one domain to
> take a reference to another domain's file. Two domains could then keep
> each other's files alive.
>
> All VDUSE domain files use the same file operations. Compare the file
> operations at import time to reject any VDUSE domain file before taking
> a reference.
>
> Link: https://lore.kernel.org/r/sashiko-outbox-234880@kernel.org
> Signed-off-by: chenglong ma <longpareto@gmail.com>

Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

But is this not also something to Fix:/Cc: Stable? Or not after all?

> ---
> Changes since v3:
> - Split the import check into its own patch as Lorenzo requested.
>   Apply it before removing VM_IO in patch 2/2.
> v3: https://lore.kernel.org/r/20261130095135.862-1-longpareto@gmail.com
>
> QEMU testing of v3 on v7.4-rc2 rejected imports of both the target
> domain's file and another domain's file. An ordinary memfd mapping
> imported and shared data successfully.
>
> Codex helped split v3 and draft the commit messages for this series.
>
>  drivers/vdpa/vdpa_user/iova_domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/vdpa_user/iova_domain.c b/drivers/vdpa/vdpa_user/iova_domain.c
> index 28a977248a0d..9955d66d9e83 100644
> --- a/drivers/vdpa/vdpa_user/iova_domain.c
> +++ b/drivers/vdpa/vdpa_user/iova_domain.c
> @@ -76,7 +76,7 @@ int vduse_domain_set_map(struct vduse_iova_domain *domain,
>  	for (map = vhost_iotlb_itree_first(iotlb, start, last); map;
>  	     map = vhost_iotlb_itree_next(map, start, last)) {
>  		map_file = (struct vdpa_map_file *)map->opaque;
> -		if (!map_file || map_file->file == domain->file) {
> +		if (!map_file || map_file->file->f_op == domain->file->f_op) {
>  			ret = -EINVAL;
>  			goto err;
>  		}
>
> base-commit: 44293796526f4343639f87b2acc53811c78b5d54
> --
> 2.45.2.windows.1
>

--
Cheers, Lorenzo

      parent reply	other threads:[~2026-12-02 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  1:14 [PATCH v4 1/2] vduse: reject imports backed by VDUSE domain files chenglong ma
2026-12-02  1:15 ` [PATCH v4 2/2] vduse: don't set VM_IO on the domain file mapping chenglong ma
2026-12-02 20:41 ` Lorenzo Stoakes (ARM) [this message]

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=axCCbhn37aBxZFd4@gremlin \
    --to=ljs@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=jasowangio@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longpareto@gmail.com \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xieyongji@bytedance.com \
    --cc=xuanzhuo@linux.alibaba.com \
    /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