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] [day] [month] [year] [list]
Date:	Fri, 13 Jun 2008 00:43:59 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	David Howells <dhowells@...hat.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Christoph Lameter <clameter@....com>,
	Bryan Wu <cooloney@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] nommu: Correct kobjsize() page validity checks.

On Thu, Jun 12, 2008 at 11:20:53AM +0100, David Howells wrote:
> Here kobjsize() returns 16384 (PAGE_SIZE) when it should return something a
> lot smaller.  This appears related to SLOB not setting PG_slab, so
> /proc/pic/status gets messed up:
> 
> 	Mem:      983040 bytes
> 	Slack:     44112 bytes
> 	Shared:  1687552 bytes
> 
> SLAB returns 64 at this point, and in /proc/pid/status shows:
> 
> 	Mem:      594016 bytes
> 	Slack:     44112 bytes
> 	Shared:  1638688 bytes
> 
> with or without the patch, which might even be correct.
> 
Yes, this is the fundamental problem with kobjsize() as it is today.
Without the setting of PG_slab, non-compound page objects default to
PAGE_SIZE. Pekka posted a series of patches that hooked PG_slab in to
SLUB and SLOB that get the same degree of accuracy that SLAB has today,
but there was opposition to merging those.

> Maybe on SLOB we want kobjsize() to become sizeof() where we're dealing with
> fixed size units such as structs.  On the other hand, getting rid of
> kobjsize() entirely would be good.
> 
I think for the time being we have to live with the innacuracy, and
simply focus on getting rid of kobjsize() entirely. Without additional
help from the various allocators, there's really not that much we can do.
Rather than papering over that, bringing nommu more in line with MMU
semantics is certainly a preferable option.

This patch in particular is unrelated to the inaccuracy issues, although
it should fix the cases where kobjsize() would mistakenly account
reserved pages.
--
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