]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
syscalls-x86-add-__nr_kcmp-syscall-v8 comment update
authorCyrill Gorcunov <gorcunov@openvz.org>
Wed, 25 Apr 2012 01:04:53 +0000 (11:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:43 +0000 (15:17 +1000)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kcmp.c

index 2a9df754afc5eded5b9e944a122aa494464d675e..c1247da415707654bd54c2d8b1e4fdbfb57d1c1d 100644 (file)
  * 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;