From 207d85c3003f0a5bc66408e4af4884a6cf378a75 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Fri, 13 Apr 2012 08:52:37 +1000 Subject: [PATCH] syscalls-x86-add-__nr_kcmp-syscall-v8 comment update Signed-off-by: Cyrill Gorcunov Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton --- kernel/kcmp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/kcmp.c b/kernel/kcmp.c index 2a9df754afc5..c1247da41570 100644 --- a/kernel/kcmp.c +++ b/kernel/kcmp.c @@ -18,6 +18,17 @@ * 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). + * + * 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; -- 2.39.2