[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260113074318.941459-1-zhipingz@meta.com>
Date: Mon, 12 Jan 2026 23:43:13 -0800
From: Zhiping Zhang <zhipingz@...a.com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: Leon Romanovsky <leon@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
<linux-rdma@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<netdev@...r.kernel.org>, Keith Busch <kbusch@...nel.org>,
Yochai Cohen
<yochai@...dia.com>, Yishai Hadas <yishaih@...dia.com>,
Zhiping Zhang
<zhipingz@...a.com>
Subject: Re: [RFC 2/2] Set steering-tag directly for PCIe P2P memory access
On 2026-01-06 0:57 Jason Gunthorpe wrote:
> On Thur 2025-12-04 8:10 UTC Zhiping Zhang wrote:
>
> > Happy holidays! I went through the vfio-dmabuf patch series and Jason's
> > comments once more. I think I have a proposal that addresses the concerns.
> >
> > For p2p or dmabuf use cases, we pass in an ID or fd similar to CPU_ID when
> > allocating a dmah, and make a callback to the dmabuf exporter to get the
> > TPH value associated with the fd. That involves adding a new dmabuf operation
> > for the callback to get the TPH/tag value associated.
> >
> > I can start with vfio-dmabuf and add the new dmabuf op/ABI there based on
> > Leon's patch. Pls let me know if you have any concerns or suggestions.
> >
> > Zhiping
> Ah, hum, that approach seems problematic since the dmah could be used
> with something that is not the exporting devices MMIO and this would
> allow userspace to subsitute in a wrong TPH which I think we should
> consider a security problem.
>
> I think you need to have the reg_mr_dmabuf itself enforce a TPH if the
> exporting DMABUF requests it that way we know the TPH and the MMIO
> addresses are properly linked together.
> Jason
Got it, thanks for pointing out the security concern! To address this, I
propose that we still pass the TPH value when allocating the dmah, but we add
a verification callback in the reg_mr_dmabuf flow to the dmabuf exporter. This
callback will ensure that the TPH value is correctly linked to the exporting
device’s MMIO, and only the exporter can authorize the TPH/tag association.
Please let me know if this approach aligns with your suggestion!
Zhiping
Powered by blists - more mailing lists