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]
Date:   Sun, 13 Sep 2020 12:45:16 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     davem@...emloft.net, kuba@...nel.org, snelson@...sando.io,
        jeffrey.t.kirsher@...el.com, mhabets@...arflare.com,
        yuehaibing@...wei.com, mchehab+huawei@...nel.org,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] net: dl2k: switch from 'pci_' to 'dma_' API

Le 13/09/2020 à 08:55, Leon Romanovsky a écrit :
> On Sun, Sep 13, 2020 at 08:14:17AM +0200, Christophe JAILLET wrote:
 > [...]
>> @@ -504,9 +510,8 @@ static int alloc_list(struct net_device *dev)
>>   						sizeof(struct netdev_desc));
>>   		/* Rubicon now supports 40 bits of addressing space. */
>>   		np->rx_ring[i].fraginfo =
>> -		    cpu_to_le64(pci_map_single(
>> -				  np->pdev, skb->data, np->rx_buf_sz,
>> -				  PCI_DMA_FROMDEVICE));
>> +		    cpu_to_le64(dma_map_single(&np->pdev->dev, skb->data,
>> +					       np->rx_buf_sz, DMA_FROM_DEVICE));
> 
> I'm aware that this was before, but both pci_map_single and
> dma_map_single return an ERROR and it is wrong to set .fraginfo without
> checking result.
> 
> Thanks
> 
Hi,

Nice catch.

I'll try to send patches for such patterns as some follow-ups.
It can be found in several drivers.

But anyone who want to fix it faster than me is welcome ;-)

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ