All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leon Romanovsky" <leon@kernel.org>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 08/18] PCI: Account for Direct Translated P2P in ACS isolation checks
Date: Fri, 21 Aug 2026 19:54:29 +0000	[thread overview]
Message-ID: <20260821195430.1447E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260821-fix-p2p-acs-v4-0-v4-8-94426b96de73@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Incomplete isolation check fix for Intel RCiEPs allowing Direct Translated P2P.
--

--- Patch [8]: [PATCH v4 08/18] PCI: Account for Direct Translated P2P in ACS isolation checks ---
commit 9a6d73ba8f155a4921ede8386e7c653f5cc4bd35
Author: Leon Romanovsky <leon@kernel.org>

PCI: Account for Direct Translated P2P in ACS isolation checks

This commit fixes ACS isolation checks by accounting for Direct Translated
P2P bypassing Request Redirect. It introduces a scope parameter to allow
callers to specify whether peer-to-peer Requests must be isolated.

> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c

[ ... ]

> -static int pci_quirk_rciep_acs(struct pci_dev *dev, u16 acs_flags)
> +static int pci_quirk_rciep_acs(struct pci_dev *dev, u16 acs_flags,
> +			       enum pci_acs_scope scope)
>  {
>  	/*
>  	 * Intel RCiEP's are required to allow p2p only on translated
>  	 * addresses.  Refer to Intel VT-d specification, r3.1, sec 3.16,
>  	 * "Root-Complex Peer to Peer Considerations".
>  	 */
>  	if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END)
>  		return -ENOTTY;
>  
>  	return pci_acs_ctrl_enabled(acs_flags,
>  		PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
>  }

[Severity: High]
This isn't a bug introduced by this patch, but should pci_quirk_rciep_acs()
account for the new scope parameter when evaluating PCI_ACS_RR?

The comment in pci_quirk_rciep_acs() notes that Intel RCiEPs allow P2P on
translated addresses, which means Request Redirect does not actually isolate
them from each other for translated requests.

If a caller passes PCI_ACS_SCOPE_ALL, does unconditionally returning success
here allow a malicious VM assigned a multifunction Intel RCiEP to forge
translated requests (AT=Translated) to perform peer-to-peer DMA to another
function, bypassing the IOMMU?

Since this patch introduces pci_acs_rr_ineffective() to handle this exact
scenario for standard ACS capabilities and the Intel SPT PCH quirk, would
it make sense to apply similar scope checking here?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821-fix-p2p-acs-v4-0-v4-0-94426b96de73@nvidia.com?part=8

  reply	other threads:[~2026-08-21 19:54 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 19:38 [PATCH v4 00/18] PCI/P2PDMA: Fix ACS egress control handling Leon Romanovsky
2026-08-21 19:38 ` [PATCH v4 01/18] PCI/P2PDMA: Do not tear down the allocate attribute on registration failure Leon Romanovsky
2026-08-21 19:53   ` sashiko-bot
2026-08-21 23:08   ` Logan Gunthorpe
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 02/18] PCI/P2PDMA: Wait for RCU readers before freeing state Leon Romanovsky
2026-08-21 19:48   ` sashiko-bot
2026-08-21 23:10   ` Logan Gunthorpe
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 03/18] PCI/P2PDMA: Restrict the p2pmem search to pool backed providers Leon Romanovsky
2026-08-21 19:59   ` sashiko-bot
2026-08-21 23:14   ` Logan Gunthorpe
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 04/18] PCI/P2PDMA: Safely terminate ACS redirect lists Leon Romanovsky
2026-08-21 19:47   ` sashiko-bot
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 05/18] PCI/P2PDMA: Document the pdev->p2pdma lifetime and RCU rules Leon Romanovsky
2026-08-21 19:56   ` sashiko-bot
2026-08-24 20:29   ` I Logan Gunthorpe
2026-08-30  9:14     ` I Leon Romanovsky
2026-08-21 19:38 ` [PATCH v4 06/18] PCI/P2PDMA: Gate the host bridge whitelist warning on verbose Leon Romanovsky
2026-08-21 19:47   ` sashiko-bot
2026-08-24 21:08   ` Logan Gunthorpe
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 07/18] PCI/P2PDMA: Document the Address Type assumption Leon Romanovsky
2026-08-21 19:43   ` sashiko-bot
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 08/18] PCI: Account for Direct Translated P2P in ACS isolation checks Leon Romanovsky
2026-08-21 19:54   ` sashiko-bot [this message]
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-25 15:59   ` Logan Gunthorpe
2026-08-21 19:38 ` [PATCH v4 09/18] PCI: Add ACS egress control vector accessor Leon Romanovsky
2026-08-21 19:50   ` sashiko-bot
2026-08-21 19:38 ` [PATCH v4 10/18] PCI: Account for ACS egress control in isolation checks Leon Romanovsky
2026-08-21 19:51   ` sashiko-bot
2026-08-24 23:22   ` Jason Gunthorpe
2026-08-30  9:20     ` Leon Romanovsky
2026-08-31 12:02       ` Jason Gunthorpe
2026-08-21 19:38 ` [PATCH v4 11/18] PCI/P2PDMA: Derive peer-to-peer routing from ACS control bits Leon Romanovsky
2026-08-21 19:54   ` sashiko-bot
2026-08-22 13:31     ` Leon Romanovsky
2026-08-25 19:17   ` Logan Gunthorpe
2026-08-21 19:38 ` [PATCH v4 12/18] PCI/P2PDMA: Honor ACS egress control vectors Leon Romanovsky
2026-08-21 19:56   ` sashiko-bot
2026-08-25 19:25   ` Logan Gunthorpe
2026-08-21 19:38 ` [PATCH v4 13/18] PCI/P2PDMA: Document ACS egress control handling Leon Romanovsky
2026-08-21 19:44   ` sashiko-bot
2026-08-25 19:52   ` Logan Gunthorpe
2026-08-21 19:38 ` [PATCH v4 14/18] PCI/P2PDMA: Extract pure ACS routing decision helpers Leon Romanovsky
2026-08-21 19:49   ` sashiko-bot
2026-08-25 19:55   ` Logan Gunthorpe
2026-08-21 19:38 ` [PATCH v4 15/18] PCI/P2PDMA: Add KUnit tests for ACS routing decisions Leon Romanovsky
2026-08-21 19:50   ` sashiko-bot
2026-08-21 19:38 ` [PATCH v4 16/18] PCI/P2PDMA: Add KUnit coverage for the ACS P2P routing walk Leon Romanovsky
2026-08-21 19:51   ` sashiko-bot
2026-08-21 19:38 ` [PATCH v4 17/18] PCI: Add KUnit coverage for ACS isolation checks Leon Romanovsky
2026-08-21 19:52   ` sashiko-bot
2026-08-21 19:38 ` [PATCH v4 18/18] PCI/P2PDMA: Log detailed ACS routing diagnostics Leon Romanovsky
2026-08-21 20:02   ` sashiko-bot
2026-08-22 13:28     ` Leon Romanovsky
2026-08-25 20:02   ` Logan Gunthorpe
2026-08-30  8:37     ` Leon Romanovsky
2026-08-24 23:22 ` [PATCH v4 00/18] PCI/P2PDMA: Fix ACS egress control handling Jason Gunthorpe
2026-08-30  9:02   ` Leon Romanovsky
2026-08-31 12:00     ` Jason Gunthorpe

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=20260821195430.1447E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.