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>] [day] [month] [year] [list]
Message-ID: <20070802182130.GM21089@ftp.linux.org.uk>
Date:	Thu, 2 Aug 2007 19:21:30 +0100
From:	Al Viro <viro@....linux.org.uk>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Jeff Garzik <jgarzik@...ox.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] fix s2io regression

	* wrong argument passed to pci_unmap_single() on failure
exit paths
	* leak in the same area
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 2be0a0f..24feb00 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2430,7 +2430,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
 					(rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
 					pci_unmap_single
 						(nic->pdev,
-						(dma_addr_t)skb->data,
+						(dma_addr_t)rxdp3->Buffer2_ptr,
 						dev->mtu + 4,
 						PCI_DMA_FROMDEVICE);
 					goto pci_map_failed;
@@ -6211,7 +6211,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
 			if( (rxdp3->Buffer0_ptr == 0) ||
 				(rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) {
 				pci_unmap_single (sp->pdev,
-					(dma_addr_t)(*skb)->data,
+					(dma_addr_t)rxdp3->Buffer2_ptr,
 					dev->mtu + 4, PCI_DMA_FROMDEVICE);
 				goto memalloc_failed;
 			}
@@ -6224,7 +6224,10 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
 			if( (rxdp3->Buffer1_ptr == 0) ||
 				(rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
 				pci_unmap_single (sp->pdev,
-					(dma_addr_t)(*skb)->data,
+					(dma_addr_t)rxdp3->Buffer0_ptr,
+					BUF0_LEN, PCI_DMA_FROMDEVICE);
+				pci_unmap_single (sp->pdev,
+					(dma_addr_t)rxdp3->Buffer2_ptr,
 					dev->mtu + 4, PCI_DMA_FROMDEVICE);
 				goto memalloc_failed;
 			}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ