lkml.org 
[lkml]   [2011]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] Routine for generating an safe ID for kernel pointer
On Tue, Nov 15, 2011 at 03:36:33PM +0400, Pavel Emelyanov wrote:
> +unsigned long gen_object_id(void *ptr)
> +{
> + if (!ptr)
> + return 0;
> +
> + if (unlikely(!ptr_poison)) {
> + spin_lock(&ptr_poison_lock);
> + if (!ptr_poison)
> + get_random_bytes(&ptr_poison, sizeof(ptr_poison));
> + spin_unlock(&ptr_poison_lock);
> + }

One thing that worries me about this is that there's one ptr_poison
for all id's and any single leak of a pointer value will make all ids
vulnerable. If we're going to do this, let's segregate different id
spaces and use different poison values for each.

Thank you.

--
tejun


\
 
 \ /
  Last update: 2011-11-15 16:23    [W:0.087 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site