Re: [RFC c/r 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v7

From: Cyrill Gorcunov
Date: Fri Jan 27 2012 - 13:11:23 EST


On Fri, Jan 27, 2012 at 10:05:18AM -0800, H. Peter Anvin wrote:
> + */
> > +static int kcmp_ptr(long v1, long v2, enum kcmp_type type)
> > +{
> > + long ret;
> > +
> > + ret = kptr_obfuscate(v1, type) - kptr_obfuscate(v2, type);
> > +
> > + return (ret < 0) | ((ret > 0) << 1);
> > +}
> > +
>
> I just want to point out that we could do hard cryptography, too --
> using DES or AES and compare the result since symmetric cryptography is
> an isomorphism. One would have to compare the whole result, obviously,
> not a truncated one, so using memcmp() or the similar.
>
> I'll leave it up to the security guys to worry about if that is needed,
> but since it is something that can be slotted in without changing the
> API it seems reasonably safe.
>

Yes, it's internal operations not visible to user-space. Actually I thought
to even introduce kind of sysctl later so admin would be able to refresh
cookies manually when needed or completely disable this interface as well.
But not in this patch ;)

Cyrill
--
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/