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
| ||
|
Date: Thu, 22 Jan 2015 12:40:25 +0000 From: David Laight <David.Laight@...LAB.COM> To: 'Ezequiel Garcia' <ezequiel.garcia@...e-electrons.com>, David Miller <davem@...emloft.net>, Russell King <linux@....linux.org.uk> CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "B38611@...escale.com" <B38611@...escale.com>, "fabio.estevam@...escale.com" <fabio.estevam@...escale.com> Subject: RE: [PATCH v2] net: mv643xx_eth: Fix highmem support in non-TSO egress path From: Ezequiel Garcia > Commit 69ad0dd7af22b61d9e0e68e56b6290121618b0fb > Author: Ezequiel Garcia <ezequiel.garcia@...e-electrons.com> > Date: Mon May 19 13:59:59 2014 -0300 > > net: mv643xx_eth: Use dma_map_single() to map the skb fragments > > caused a nasty regression by removing the support for highmem skb > fragments. By using page_address() to get the address of a fragment's > page, we are assuming a lowmem page. However, such assumption is incorrect, > as fragments can be in highmem pages, resulting in very nasty issues. > > This commit fixes this by using the skb_frag_dma_map() helper, > which takes care of mapping the skb fragment properly. Additionally, > the type of mapping is now tracked, so it can be unmapped using > dma_unmap_page or dma_unmap_single when appropriate. > > Fixes: 69ad0dd7af22 ("net: mv643xx_eth: Use dma_map_single() to map the skb fragments") > Reported-by: Russell King <rmk+kernel@....linux.org.uk> > Signed-off-by: Ezequiel Garcia <ezequiel.garcia@...e-electrons.com> ... > @@ -2048,6 +2068,11 @@ static int txq_init(struct mv643xx_eth_private *mp, int index) > nexti * sizeof(struct tx_desc); > } > > + txq->tx_desc_mapping = kcalloc(txq->tx_ring_size, sizeof(char), > + GFP_KERNEL); > + if (!txq->tx_desc_mapping) > + return -ENOMEM; > + > /* Allocate DMA buffers for TSO MAC/IP/TCP headers */ > txq->tso_hdrs = dma_alloc_coherent(mp->dev->dev.parent, > txq->tx_ring_size * TSO_HEADER_SIZE, I'm guessing there is an error path for dma_alloc_coherent() failing. You've not modified it to free tx_desc_mapping. David -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists