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: <20110504213850.GA16685@cmpxchg.org>
Date:	Wed, 4 May 2011 23:38:50 +0200
From:	Johannes Weiner <hannes@...xchg.org>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	akpm@...ux-foundation.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, Andi Kleen <ak@...ux.intel.com>,
	rientjes@...gle.com, Michal Hocko <mhocko@...e.cz>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	Balbir Singh <balbir@...ibm.com>
Subject: Re: [PATCH] Allocate memory cgroup structures in local nodes v2

On Wed, May 04, 2011 at 01:26:23PM -0700, Andi Kleen wrote:
> diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
> index 9905501..a362215 100644
> --- a/mm/page_cgroup.c
> +++ b/mm/page_cgroup.c
> @@ -134,7 +134,7 @@ static void *__init_refok alloc_page_cgroup(size_t size, int nid)
>  {
>  	void *addr = NULL;
>  
> -	addr = alloc_pages_exact(size, GFP_KERNEL | __GFP_NOWARN);
> +	addr = alloc_pages_exact_node(nid, GFP_KERNEL | __GFP_NOWARN, size);

alloc_pages_exact_node is not the 'specify node as well'-version of
alloc_pages_exact, it refers to 'exact node'.  Thus the
free_pages_exact call is no longer the right counter-part.

alloc_pages_exact_node takes an order, not a size argument.

alloc_pages_exact_node returns a pointer to the struct page, not to
the allocated memory, like all other alloc_pages* functions with the
exception of alloc_pages_exact.

I don't think any of those mistakes even triggers a compiler warning.
Wow.  This API is so thoroughly fscked beyond belief that I think the
only way to top this is to have one of the functions invert the bits
of its return value depending on the parity of the uptime counter.
--
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