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: <c64a4414-f04a-fc75-0f54-ee8026ae63c4@oracle.com>
Date:   Fri, 19 Aug 2022 19:50:12 -0700
From:   Dongli Zhang <dongli.zhang@...cle.com>
To:     Chao Gao <chao.gao@...el.com>
Cc:     linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
        hch@...radead.org, m.szyprowski@...sung.com, robin.murphy@....com,
        jxgao@...gle.com, konrad.wilk@...cle.com
Subject: Re: [PATCH v2] swiotlb: avoid potential left shift overflow



On 8/19/22 6:42 PM, Chao Gao wrote:
> On Fri, Aug 19, 2022 at 06:44:05AM -0700, Dongli Zhang wrote:
>> I also encountered this when sending out another version of the 64-bit swiotlb.
>>
>> https://urldefense.com/v3/__https://lore.kernel.org/all/20220609005553.30954-8-dongli.zhang@oracle.com/__;!!ACWV5N9M2RV99hQ!O-2m8d_6yG-OJx1eoiF-wmpJy13HaSz884huJjbeRA9tUdXnUbWsD34MAoY21pSYMdS8tKOM0_7teFvOa3w$  
>>
>> Unfortunately, I could not find an environment (e.g., powerpc) to allocate more
>> than 4G until swiotlb supports 64-bit.
>>
>> Although xen supports 64-bit, but the hypervisor side limits the max to < 4G.
> 
> Sorry. I didn't notice your series before. I agree that the overflow
> isn't an issue if swiotlb size cannot be larger than 4GB. That's why
> I said the overflow is a potential issue.
> 
> In an internal effort to measure the impact of swiotlb size to IO
> performance of confidential VM (e.g., TDX VM), we simply added
> SWIOTLB_ANY to the default io_tlb_mem to lift the restriction on swiotlb
> size. Then we hit this issue and worked out this fix. I posted this
> fix because I think the fix by itself is helpful because it removes the
> implicit dependency of the left-shift in slot_addr() on swiotlb size and
> then someone trying to lift the size limitation won't hit the same issue.
> 

Thank you very much for the explanation! I was just curious how to test this
without code modification or powerpc hardware.

Although my RB may not count much:

Reviewed-by: Dongli Zhang <dongli.zhang@...cle.com>

Dongli Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ