Re: new procfs memory analysis feature

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

 




On Dec 7, 2006, at 5:46 PM, Andrew Morton wrote:

On Thu, 7 Dec 2006 17:07:22 -0800
david singleton <[email protected]> wrote:

Attached is the 2.6.19 patch.

It still has the overflow bug.
+       do {
+               ptent = *pte;
+               if (pte_present(ptent)) {
+                       page = vm_normal_page(vma, addr, ptent);
+                       if (page) {
+                               if (pte_dirty(ptent))
+ mapcount = -page_mapcount(page);
+                               else
+ mapcount = page_mapcount(page);
+                       } else {
+                               mapcount = 1;
+                       }
+               }
+               seq_printf(m, " %d", mapcount);
+
+       } while (pte++, addr += PAGE_SIZE, addr != end);

Well that's cute.  As long as both seq_file and pte-pages are of size
PAGE_SIZE, and as long as pte's are more than three bytes, this will not
overflow the seq_file output buffer.

hm.  Unless the pages are all dirty and the mapcounts are all 10000.  I
think it will overflow then?


I guess that could happen?    Any suggestions?

-
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