Re: strict copy_from_user checks issues?

From: H. Peter Anvin
Date: Tue Jan 05 2010 - 16:49:45 EST


On 01/05/2010 07:20 AM, Arnd Bergmann wrote:
>
> You mean like this?
>
> It adds some complexity and about 200 bytes of object code,
> I'm not sure it's worth it.
>

What's much worse is that it adds churn to an otherwise-tested code path.

We almost need a copy_from/to_user_audited() to override the warning.
Not that errors can't creap back in...

> --
> [UNTESTED PATCH] tun: avoid copy_from_user size warning
>
> For 32 bit compat code, the tun driver only copies the
> fields it needs using a short length, which copy_from_user
> now warns about. Moving the copy operation outside of the
> main ioctl function lets us avoid the warning.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

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