lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e1f9013d-f520-44de-b961-bf60bdee8181@kernel.org>
Date: Tue, 20 Aug 2024 08:12:14 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Rick Wertenbroek <rick.wertenbroek@...il.com>, rick.wertenbroek@...g-vd.ch
Cc: alberto.dassatti@...g-vd.ch,
 Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
 Krzysztof WilczyƄski <kw@...ux.com>,
 Kishon Vijay Abraham I <kishon@...nel.org>,
 Bjorn Helgaas <bhelgaas@...gle.com>, Niklas Cassel <cassel@...nel.org>,
 Frank Li <Frank.Li@....com>, Lars-Peter Clausen <lars@...afoo.de>,
 linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] PCI: endpoint: pci-epf-test: Move DMA check into
 read/write/copy functions

On 8/19/24 21:01, Rick Wertenbroek wrote:
> The pci-epf-test PCI endpoint function /drivers/pci/endpoint/function/pci-epf_test.c
> is meant to be used in a PCI endpoint device inside a host computer with
> the host side driver: /drivers/misc/pci_endpoint_test.c.
> 
> The host side driver can request read/write/copy transactions from the
> endpoint function and expects an IRQ from the endpoint function once
> the read/write/copy transaction is finished. These can be issued with or
> without DMA enabled. If the host side driver requests a read/write/copy
> transaction with DMA enabled and the endpoint function does not support
> DMA, the endpoint would only print an error message and wait for further
> commands without sending an IRQ because pci_epf_test_raise_irq() is
> skipped in pci_epf_test_cmd_handler(). This results in the host side
> driver hanging indefinitely waiting for the IRQ.
> 
> Move the DMA check into the pci_epf_test_read()/write()/copy() functions
> so that they report a transfer (IO) error and that pci_epf_test_raise_irq()
> is called when a transfer with DMA is requested, even if unsupported.
> 
> The host side driver will no longer hang but report an error on transfer
> (printing "NOT OKAY") thanks to the checksum because no data was moved.
> 
> Signed-off-by: Rick Wertenbroek <rick.wertenbroek@...il.com>

Looks good.

Reviewed-by: Damien Le Moal <dlemoal@...nel.org>

-- 
Damien Le Moal
Western Digital Research


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ