archive mirror
 help / color / mirror / Atom feed
From: Jan Luebbe <>
To: Joerg Roedel <>
Cc:, Jan Luebbe <>
Subject: [PATCH v2] lib/dma-debug: check for vmalloc and module addresses used with the DMA-API
Date: Wed, 19 Sep 2012 17:28:36 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Signed-off-by: Jan Luebbe <>

Changes since v1:
 - As recommended by Joerg Roedel, check for overlap with vmalloc and
   module address ranges.

 lib/dma-debug.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 66ce414..b35992b 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -944,6 +944,14 @@ static void check_for_illegal_area(struct device *dev, void *addr, unsigned long
 	if (overlap(addr, len, _text, _etext) ||
 	    overlap(addr, len, __start_rodata, __end_rodata))
 		err_printk(dev, NULL, "DMA-API: device driver maps memory from kernel text or rodata [addr=%p] [len=%lu]\n", addr, len);
+#ifdef CONFIG_MMU
+	if (overlap(addr, len, (void *)VMALLOC_START, (void *)VMALLOC_END))
+		err_printk(dev, NULL, "DMA-API: device driver maps memory from vmalloc address range [addr=%p] [len=%lu]\n", addr, len);
+#if defined(CONFIG_MODULES) && defined(MODULES_VADDR)
+	if (overlap(addr, len, (void *)MODULES_VADDR, (void *)MODULES_END))
+		err_printk(dev, NULL, "DMA-API: device driver maps memory from kernel module address range [addr=%p] [len=%lu]\n", addr, len);
 static void check_sync(struct device *dev,

      reply	other threads:[~2012-09-19 15:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 11:00 [PATCH] lib/dma-debug: check for vmalloc buffers used with the DMA-API Jan Luebbe
2012-09-18 13:18 ` Joerg Roedel
2012-09-19 15:28   ` Jan Luebbe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).