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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Jan 2012 09:54:34 -0800
From:	Tejun Heo <tj@...nel.org>
To:	Christoph Lameter <cl@...ux.com>
Cc:	Dmitry Antipov <dmitry.antipov@...aro.org>,
	Rusty Russell <rusty@...tcorp.com.au>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, patches@...aro.org,
	linaro-dev@...ts.linaro.org
Subject: Re: [PATCH 1/3] percpu: use ZERO_SIZE_PTR / ZERO_OR_NULL_PTR

Hello, Christoph.

On Mon, Jan 30, 2012 at 11:52:23AM -0600, Christoph Lameter wrote:
> We have two possibilities now:
> 
> 1. We say that the value returned from the per cpu allocator is an opaque
> value.
> 
> 	This means that we have to remove the NULL check from the free
> 	function. And audit the kernel code for all occurrences where
> 	a per cpu pointer value of NULL is assumed to mean that no per
> 	cpu allocation has occurred.

No, NULL is never gonna be a valid return from any allocator including
percpu.  Percpu allocator doesn't and will never do so.

> 2. We say that there are special values for the per cpu pointers (NULL,
> 	ZERO_SIZE_PTR)
> 
> 	Then we would have to guarantee that the per cpu allocator never
> 	returns those values.
> 
> 	Plus then the ZERO_SIZE_PTR patch will be fine.
> 
> 	The danger exist of these values being passed as
> 	parameters to functions that do not support them (per_cpu_ptr
> 	etc). Those would need VM_BUG_ONs or some other checks to detect
> 	potential problems.

I'm saying we don't have this for ZERO_SIZE_PTR in any meaningful way
at this point.  If somebody wants to implement it properly, please
feel free to, but simply applying ZERO_SIZE_PTR without other changes
doesn't make any sense.

Thanks.

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