[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <df54053fca85900fab7864e0f05ed2c8@mvista.com>
Date: Thu, 7 Dec 2006 17:53:06 -0800
From: david singleton <dsingleton@...sta.com>
To: Andrew Morton <akpm@...l.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: new procfs memory analysis feature
On Dec 7, 2006, at 5:46 PM, Andrew Morton wrote:
> On Thu, 7 Dec 2006 17:07:22 -0800
> david singleton <dsingleton@...sta.com> 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 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