[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120411063957.GA11629@moon>
Date: Wed, 11 Apr 2012 10:39:57 +0400
From: Cyrill Gorcunov <gorcunov@...nvz.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Pavel Emelyanov <xemul@...allels.com>,
Andrey Vagin <avagin@...nvz.org>,
KOSAKI Motohiro <kosaki.motohiro@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Glauber Costa <glommer@...allels.com>,
Andi Kleen <andi@...stfloor.org>, Tejun Heo <tj@...nel.org>,
Matt Helsley <matthltc@...ibm.com>,
Pekka Enberg <penberg@...nel.org>,
Eric Dumazet <eric.dumazet@...il.com>,
Vasiliy Kulikov <segoon@...nwall.com>,
Alexey Dobriyan <adobriyan@...il.com>, Valdis.Kletnieks@...edu,
Michal Marek <mmarek@...e.cz>,
Frederic Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org, Jonathan Corbet <corbet@....net>
Subject: Re: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree
On Wed, Apr 11, 2012 at 01:42:06AM +0200, Oleg Nesterov wrote:
> On 04/10, H. Peter Anvin wrote:
> >
> > On 04/10/2012 04:08 PM, Oleg Nesterov wrote:
> > >
> > > OK, since this is discussed again...
> > >
> > > Can this comment can also explain why do we obfuscate the pointers
> > > by type? I mean, I don't really understand why the one-dimensional
> > > cookies[2] is "not enough" from security pov.
> >
> > Because it's cheap. "Just enough" is not what you want to shoot for,
> > ever, you want to get past the "just enough" point and then consider
> > "what can I get for cheap at this point"?
>
> OK, I am not arguing. Just I thought that the small note like
> "we are doing this per-type to obfuscate even more" can help.
> I wouldn't have asked, but Cyrill rewrites this comment anyway.
>
> Perhaps this is just me, but my first (and wrong) impression was
> that somehow this is needed for correctness.
Hi Oleg, would the form below sounds good?
---
Subject: Add a comment on kcmp obfuscation method
Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
---
kernel/kcmp.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: linux-2.6.git/kernel/kcmp.c
===================================================================
--- linux-2.6.git.orig/kernel/kcmp.c
+++ linux-2.6.git/kernel/kcmp.c
@@ -17,6 +17,20 @@
* reasons, still the comparison results should be suitable for
* sorting. Thus, we obfuscate kernel pointers values and compare
* the production instead.
+ *
+ * The obfuscation is done in two steps. First -- we use xor on
+ * kernel pointer with random value, which puts pointer into
+ * a new position in reordered space. Second -- we multiply
+ * the xor production with big odd random number to permute
+ * bits even more (the odd multiplier guarantees that the product
+ * is unique ever after the high bits are truncated, since any odd
+ * number is relative prime to 2^n).
+ *
+ * The obfuscation is done with per-type cookie values to increase
+ * initial entropy of results.
+ *
+ * Note also the obfuscation itself is invisible to user-space
+ * and if needed it can be changed to any suitable scheme.
*/
static unsigned long cookies[KCMP_TYPES][2] __read_mostly;
--
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