Re: is avoiding compat ioctls possible?

From: Arnd Bergmann
Date: Thu Oct 29 2009 - 04:27:34 EST


On Wednesday 28 October 2009, Maciej W. Rozycki wrote:
>
> On Wed, 28 Oct 2009, Andi Kleen wrote:
>
> > > I'm just amazed that compat_ioctl should be required for all new code.
> > >
> > > DrNick on irc suggested just doing:
> > > if (is_compat_task()) ptr &= 0x00000000FFFFFFFF;
> >
> > Such hacks often have problems on BE.
>
> And then some platforms (i.e. MIPS) require sign-extension rather than
> zero-extension, that is:
>
> if (is_compat_task()) ptr = ((ptr & 0xffffffff) ^ 0x80000000) - 0x80000000;
>
> if doing this explicitly (with compat stuff hardware will do the right
> thing automagically).

Such conversion should *only* ever take place in compat_ptr().

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