Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-23 Thread Peter Maydell
On Tue, 23 Apr 2024 at 11:23, Alexandra Diupina wrote: > 17/04/24 13:05, Konrad, Frederic пишет: > > Peter Maydell wrote: > >> Also, this device looks like it has a host-endianness bug: the > >> DPDMADescriptor struct is read directly from guest memory in > >> dma_memory_read(), but the device nev

Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-23 Thread Alexandra Diupina
...@nongnu.org; sdl.q...@linuxtesting.org Subject: Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address() On Fri, 12 Apr 2024 at 09:13, Alexandra Diupina wrote: Overflow can occur in a situation where desc->source_address has a maximum value (pow(2, 32) - 1), so add a cast t

RE: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-17 Thread Konrad, Frederic
gt; de...@nongnu.org; sdl.q...@linuxtesting.org > Subject: Re: [PATCH RFC] prevent overflow in > xlnx_dpdma_desc_get_source_address() > > On Fri, 12 Apr 2024 at 09:13, Alexandra Diupina > wrote: > > > > Overflow can occur in a situation where desc->source_address > > has

Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-16 Thread Edgar E. Iglesias
+ To: Fred On Tue, 16 Apr 2024 at 19:56, Alexandra Diupina wrote: > Peter, thank you! I agree with you that > as mentioned in the documentation > https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/ADDR_EXT-Field, > we should take 32 bits of the address from one field > (for example, case 1,

Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-16 Thread Alexandra Diupina
Peter, thank you! I agree with you that as mentioned in the documentation https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/ADDR_EXT-Field, we should take 32 bits of the address from one field (for example, case 1, SRC_ADDR2_EXT - in code it is desc->source_address2) and 16 bits (high or low

Re: [PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-12 Thread Peter Maydell
On Fri, 12 Apr 2024 at 09:13, Alexandra Diupina wrote: > > Overflow can occur in a situation where desc->source_address > has a maximum value (pow(2, 32) - 1), so add a cast to a > larger type before the assignment. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: d

[PATCH RFC] prevent overflow in xlnx_dpdma_desc_get_source_address()

2024-04-12 Thread Alexandra Diupina
Overflow can occur in a situation where desc->source_address has a maximum value (pow(2, 32) - 1), so add a cast to a larger type before the assignment. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: d3c6369a96 ("introduce xlnx-dpdma") Signed-off-by: Alexandra Diupina -