Re: + syscalls-x86-add-__nr_kcmp-syscall-v8.patch added to -mm tree

From: H. Peter Anvin
Date: Tue Apr 10 2012 - 20:08:52 EST


On 04/10/2012 04:58 PM, Valdis.Kletnieks@xxxxxx wrote:
>
> I'm not able to convince myself that "less than" and "greater than"
> mean anything - do we have a good proof that for all v1 and v2, the
> obfuscated pointers have the same ordering as the original
> pointers?
>

No, of course they don't.

That's the point.

The whole point is that kcmp() exports an ordered set, but the
ordering is explicitly and intentionally different than the actual
ordering in memory. It is still valid for sorting, in particular.

> Hmm... consider the simplified example v1 = 5 and v2= 16., and
> cookies[0] is also 16. Then obfus(v1) == 21, and obfus(v2) == 0,
> and the ordering is different. So I'm thinking 0 and 3 are the
> only sane return values?
>
> Or do I need more caffeine?

You need more caffeine. You're thinking about the problem wrong.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/