Re: [patch 11/12] sound/oss/emu10k1/* - compile warning cleanup

From: Andrew Morton
Date: Sun Mar 06 2005 - 19:57:21 EST


domen@xxxxxxxxxxxx wrote:
>
> @@ -316,7 +320,10 @@ static void copy_block(u8 __user *dst, u
>
> for (i = 0; i < len; i++) {
> byte = src[2 * i] ^ 0x80;
> - __copy_to_user(dst + i, &byte, 1);
> + if (__copy_to_user(dst + i, &byte, 1)) {
> + printk( KERN_ERR "emu10k1: %s: copy_to_user failed\n",__FUNCTION__);
> + return;
> + }
> }

This allows users to spam the logs without bounds, which is normally
something we try to avoid. If it's a privileged operation then OK. But it
would be better to propagate an error back to userspace.

I'll drop the patch for now.
-
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/