Kobjsize issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Many embedded systems are using their own algorithm to mange one block
of memory for DMA ops, which is uncached and usually behind of the
kernel memory heap.

So, here, kobjsize will run into kernel BUGs, too.
Because the allocated memory comes from behind memory_end, and doesn't
have the appropriate structures initialized used by the kernel to
maintain memory. And then, kobjsize triggers BUG_ON(page->index
=MAX_ORDER);

My current solution is a patch as follows. That's really an ugly
workaround, evey kobjsize call will return 0 if the address is behind
of the kernel system memory heap.
What's your thoughts?

Thanks,
-Aubrey
=============================================================
diff --git a/mm/nommu.c b/mm/nommu.c
index c576df7..f4cc8a9 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -109,7 +109,7 @@ unsigned int kobjsize(const void *objp)
{
       struct page *page;

-       if (!objp || !((page = virt_to_page(objp))))
+       if (!objp || !((page = virt_to_page(objp))) || (unsigned
long)objp >= memory_end)
               return 0;

       if (PageSlab(page))
=============================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux