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: <20130525165437.GD30204@redacted.bos.redhat.com>
Date:	Sat, 25 May 2013 12:54:38 -0400
From:	Kyle McMartin <kyle@...hat.com>
To:	djbw@...com
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] ioatdma: check dma_mapping_error in ioat_dma_self_test

Not checking dma_mapping_error on these dma_map_single uses keeps
showing up in our test runs with DMA-API debugging enabled.

[   19.744756] ioatdma: Intel(R) QuickData Technology Driver 4.00 
[   19.748979] ------------[ cut here ]------------ 
[   19.748991] WARNING: at lib/dma-debug.c:933 check_unmap+0x407/0x8a0() 

Signed-off-by: Kyle McMartin <kyle@...hat.com>

--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -832,7 +832,17 @@ int ioat_dma_self_test(struct ioatdma_device *device)
 	}
 
 	dma_src = dma_map_single(dev, src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
+	if (dma_mapping_error(dev, dma_src)) {
+		err = -ENODEV;
+		goto free_resources;
+	}
 	dma_dest = dma_map_single(dev, dest, IOAT_TEST_SIZE, DMA_FROM_DEVICE);
+	if (dma_mapping_error(dev, dma_dest)) {
+		err = -ENODEV;
+		dma_unmap_single(dev, dma_src, IOAT_TEST_SIZE, DMA_TO_DEVICE);
+		goto free_resources;
+	}
+
 	flags = DMA_COMPL_SKIP_SRC_UNMAP | DMA_COMPL_SKIP_DEST_UNMAP |
 		DMA_PREP_INTERRUPT;
 	tx = device->common.device_prep_dma_memcpy(dma_chan, dma_dest, dma_src,
--
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