lkml.org 
[lkml]   [2003]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectAdd __copy_from_user checks to emu10k1
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/sound/oss/emu10k1/cardwo.c linux-2.5/sound/oss/emu10k1/cardwo.c
--- bk-linus/sound/oss/emu10k1/cardwo.c 2003-03-22 12:36:23.000000000 +0000
+++ linux-2.5/sound/oss/emu10k1/cardwo.c 2003-03-22 12:41:48.000000000 +0000
@@ -408,14 +408,17 @@ static void copy_block(void **dst, u32 s

if (len > PAGE_SIZE - pgoff) {
k = PAGE_SIZE - pgoff;
- __copy_from_user((u8 *)dst[pg] + pgoff, src, k);
+ if (__copy_from_user((u8 *)dst[pg] + pgoff, src, k))
+ return;
len -= k;
while (len > PAGE_SIZE) {
- __copy_from_user(dst[++pg], src + k, PAGE_SIZE);
+ if (__copy_from_user(dst[++pg], src + k, PAGE_SIZE))
+ return;
k += PAGE_SIZE;
len -= PAGE_SIZE;
}
- __copy_from_user(dst[++pg], src + k, len);
+ if (__copy_from_user(dst[++pg], src + k, len))
+ return;

} else
__copy_from_user((u8 *)dst[pg] + pgoff, src, len);
@@ -440,7 +443,8 @@ static void copy_ilv_block(struct woinst

while (len) {
for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) {
- __copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample);
+ if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample))
+ return -EFAULT;
src += woinst->format.bytespervoicesample;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.030 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site