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-next>] [day] [month] [year] [list]
Message-ID: <1250005381-17903-1-git-send-email-joerg.roedel@amd.com>
Date:	Tue, 11 Aug 2009 17:43:01 +0200
From:	Joerg Roedel <joerg.roedel@....com>
To:	Ingo Molnar <mingo@...hat.com>, David Miller <davem@...emloft.net>
CC:	linux-kernel@...r.kernel.org, Joerg Roedel <joerg.roedel@....com>
Subject: [PATCH] dma-debug: Allow archs to override check_for_illegal_area

For some architectures (like sparc32) the default
check_for_illegal_area function does not work reliable. This patch
makes this function a weak symbol allowing architectures to override
it if necessary.

Signed-off-by: Joerg Roedel <joerg.roedel@....com>
---
 lib/dma-debug.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 65b0d99..4f6ad34 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -866,7 +866,9 @@ static inline bool overlap(void *addr, unsigned long len, void *start, void *end
 	return !(b1 <= a2 || a1 >= b2);
 }
 
-static void check_for_illegal_area(struct device *dev, void *addr, unsigned long len)
+void __weak dma_debug_check_for_illegal_area(struct device *dev,
+					     void *addr,
+					     unsigned long len)
 {
 	if (overlap(addr, len, _text, _etext) ||
 	    overlap(addr, len, __start_rodata, __end_rodata))
@@ -971,7 +973,7 @@ void debug_dma_map_page(struct device *dev, struct page *page, size_t offset,
 		void *addr = page_address(page) + offset;
 
 		check_for_stack(dev, addr);
-		check_for_illegal_area(dev, addr, size);
+		dma_debug_check_for_illegal_area(dev, addr, size);
 	}
 
 	add_dma_entry(entry);
@@ -1025,7 +1027,8 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg,
 
 		if (!PageHighMem(sg_page(s))) {
 			check_for_stack(dev, sg_virt(s));
-			check_for_illegal_area(dev, sg_virt(s), sg_dma_len(s));
+			dma_debug_check_for_illegal_area(dev, sg_virt(s),
+							 sg_dma_len(s));
 		}
 
 		add_dma_entry(entry);
-- 
1.6.3.3


--
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