Re: sparse annotation question

From: David Miller
Date: Wed Jul 12 2006 - 03:20:18 EST


From: Keith Owens <kaos@xxxxxxxxxx>
Date: Wed, 12 Jul 2006 16:42:44 +1000

> I tried various combinations of __force, but kept getting this:
>
> warning: incorrect type in argument 1 (different address spaces)
> expected unsigned long *addr
> got unsigned long [noderef] [force] *[addressable] bsp<asn:1>
>
> What finally worked was
>
> unsigned long i, *bsp, __user *ubsp;
> ...
> ubsp = (unsigned long __user *) bsp;
> put_user(*contents, ubsp);
>

Right, I guess if you try to do the cast in the put_user() macro
argument, you'll run into troubles because the __chk_user_ptr(ptr)
call wants an absolutely pure __user pointer, not one that is part of
a __force cast.
-
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/