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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090615021457.GA3388@cr0.nay.redhat.com>
Date:	Mon, 15 Jun 2009 10:14:57 +0800
From:	Amerigo Wang <xiyou.wangcong@...il.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Amerigo Wang <xiyou.wangcong@...il.com>,
	Tao Ma <tao.ma@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [Patch BUGFIX] kcore: fix its wrong size on x86_64

On Fri, Jun 12, 2009 at 09:20:50PM -0700, Eric W. Biederman wrote:
>Amerigo Wang <xiyou.wangcong@...il.com> writes:
>
>> Fix wrong /proc/kcore size on x86_64.
>
>How does that change anything?

Please check the description below.

>
>> x86_64 uses __va() macro to caculate the virtual address passed to kclist_add()
>> but decodes it with its own macro kc_vadd_to_offset(). This is wrong.
>>
>> Also, according to Documentation/x86/x86_64/mm.txt, kc_vaddr_to_offset()
>> is wrong too.
>>
>> So just remove them, use the generic macro.
>>
>> BTW, the man page for /proc/kcore is wrong, its size can be more than
>> the physical memory size, because it also contains memory area of
>> vmalloc(), vsyscall etc...
>
>The set of offsets that are usable sure.

We have generic kc_vaddr_to_offset() etc. in fs/proc/kcore.c.


>
>However the size from stat is:
>          proc_root_kcore->size = (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
>
>Which can not be different than the physical memory size.

I never say this is not different, of course they are same, but what Tao
reported is the wrong size after a read operation, please try the following:

#ls -l /proc/kcore
#readelf -l /proc/kcore
#ls -l /proc/kcore

You will find the *second* 'ls -l /proc/kcore' reports a size much more
than the physical mem size.

And you will notice the difference of it after this patch applied.

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