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: <CAAeCc_=Nmh25RDaY4SA2CHsu2mqgdtKEo62b4QKSV4V8icHMMw@mail.gmail.com>
Date: Thu, 22 Aug 2024 09:15:43 +0530
From: Bharat Bhushan <bharatb.linux@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Bharat Bhushan <bbhushan2@...vell.com>, netdev@...r.kernel.org, 
	linux-kernel@...r.kernel.org, sgoutham@...vell.com, gakula@...vell.com, 
	sbhatta@...vell.com, hkelam@...vell.com, davem@...emloft.net, 
	edumazet@...gle.com, pabeni@...hat.com, jerinj@...vell.com, 
	lcherian@...vell.com, richardcochran@...il.com, b@...a-0016f401.pphosted.com
Subject: Re: [net-next,v6 1/8] octeontx2-pf: map skb data as device writeable

On Wed, Aug 21, 2024 at 4:06 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon, 19 Aug 2024 17:53:41 +0530 Bharat Bhushan wrote:
> > Crypto hardware need write permission for in-place encrypt
> > or decrypt operation on skb-data to support IPsec crypto
> > offload. So map this memory as device read-write.
>
> How do you know the fragments are not read only?

IOMMU permission faults will be reported if the DMA_TO_DEVICE direction flag
is used in dma_map_page_attrs(). This is because iommu creates read only mapping
if the DMA_TO_DEVICE direction flag is used.  If the direction flag used in
dma_map_pages() is DMA_BIDIRECTIONAL then iommu creates mapping with
both read and write permission.

>
> (Whatever the answer is it should be part of the commit msg)

Will update commit message to something like:

Crypto hardware needs both read and write permission for in-place
encryption/decryption operation. Iommu creates read only mapping
if the DMA_TO_DEVICE direction flag is used in dma_map_page_attrs().
Use DMA_BIDIRECTIONAL direction flag in dma_map_page_attrs(), so
that iommu mapping is created with both read and write permission.

Is that okay?

Thanks
-Bharat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ