diff options
author | Josh Boyer <jwboyer@fedoraproject.org> | 2013-09-25 10:17:08 -0400 |
---|---|---|
committer | Josh Boyer <jwboyer@fedoraproject.org> | 2013-09-25 10:17:08 -0400 |
commit | fe05a23be38253f1599cb2deed258a12981ca923 (patch) | |
tree | d8b5e8c801a544dffdb672b5559a2b7082be484a | |
parent | 85a7119fcf3e762bf59edae5038bf2c2470c9545 (diff) | |
download | kernel-fe05a23be38253f1599cb2deed258a12981ca923.tar.gz kernel-fe05a23be38253f1599cb2deed258a12981ca923.tar.xz kernel-fe05a23be38253f1599cb2deed258a12981ca923.zip |
Fix invalid value passed to pci_unmap_single in skge (rhbz 1008323)
-rw-r--r-- | kernel.spec | 9 | ||||
-rw-r--r-- | skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch | 61 |
2 files changed, 70 insertions, 0 deletions
diff --git a/kernel.spec b/kernel.spec index d9f7b66ef..b306492b9 100644 --- a/kernel.spec +++ b/kernel.spec @@ -765,6 +765,9 @@ Patch25107: ntp-Make-periodic-RTC-update-more-reliable.patch #rhbz 1010431 Patch25108: Revert-rt2x00pci-Use-PCI-MSIs-whenever-possible.patch +#rhbz 1008323 +Patch25109: skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch + # END OF PATCH DEFINITIONS %endif @@ -1490,6 +1493,9 @@ ApplyPatch ntp-Make-periodic-RTC-update-more-reliable.patch #rhbz 1010431 ApplyPatch Revert-rt2x00pci-Use-PCI-MSIs-whenever-possible.patch +#rhbz 1008323 +ApplyPatch skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch + # END OF PATCH APPLICATIONS %endif @@ -2294,6 +2300,9 @@ fi # ||----w | # || || %changelog +* Wed Sep 25 2013 Josh Boyer <jwboyer@fedoraproject.org> +- Fix invalid value passed to pci_unmap_single in skge (rhbz 1008323) + * Tue Sep 24 2013 Josh Boyer <jwboyer@fedoraproject.org> - 3.12.0-0.rc2.git0.1 - Linux v3.12-rc2 - Disable debugging options. diff --git a/skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch b/skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch new file mode 100644 index 000000000..908e0c751 --- /dev/null +++ b/skge-fix-invalid-value-passed-to-pci_unmap_sigle.patch @@ -0,0 +1,61 @@ +From 3361dc9538832a2a9150a8c722374ca844bf8dc8 Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka <mpatocka@redhat.com> +Date: Fri, 20 Sep 2013 17:53:22 +0000 +Subject: skge: fix invalid value passed to pci_unmap_sigle + +In my patch c194992cbe71c20bb3623a566af8d11b0bfaa721 ("skge: fix +broken driver") I didn't fix the skge bug correctly. The value of the +new mapping (not old) was passed to pci_unmap_single. + +If we enable CONFIG_DMA_API_DEBUG, it results in this warning: +WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:986 check_sync+0x4c4/0x580() +skge 0000:02:07.0: DMA-API: device driver tries to sync DMA memory it has +not allocated [device address=0x000000023a0096c0] [size=1536 bytes] + +This patch makes the skge driver pass the correct value to +pci_unmap_single and fixes the warning. It copies the old descriptor to +on-stack variable "ee" and unmaps it if mapping of the new descriptor +succeeded. + +This patch should be backported to 3.11-stable. + +Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> +Reported-by: Francois Romieu <romieu@fr.zoreil.com> +Tested-by: Mikulas Patocka <mpatocka@redhat.com> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- +diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c +index 1a9c4f6..ecc7f7b 100644 +--- a/drivers/net/ethernet/marvell/skge.c ++++ b/drivers/net/ethernet/marvell/skge.c +@@ -3086,13 +3086,16 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, + PCI_DMA_FROMDEVICE); + skge_rx_reuse(e, skge->rx_buf_size); + } else { ++ struct skge_element ee; + struct sk_buff *nskb; + + nskb = netdev_alloc_skb_ip_align(dev, skge->rx_buf_size); + if (!nskb) + goto resubmit; + +- skb = e->skb; ++ ee = *e; ++ ++ skb = ee.skb; + prefetch(skb->data); + + if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) { +@@ -3101,8 +3104,8 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, + } + + pci_unmap_single(skge->hw->pdev, +- dma_unmap_addr(e, mapaddr), +- dma_unmap_len(e, maplen), ++ dma_unmap_addr(&ee, mapaddr), ++ dma_unmap_len(&ee, maplen), + PCI_DMA_FROMDEVICE); + } + +-- +cgit v0.9.2 |