From: davej@codemonkey.org.uk
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Add __copy_from_user checks to emu10k1
Date: Mon, 24 Mar 2003 16:42:01 +0000 [thread overview]
Message-ID: <200303241642.h2OGgE35008361@deviant.impure.org.uk> (raw)
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;
}
reply other threads:[~2003-03-24 16:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200303241642.h2OGgE35008361@deviant.impure.org.uk \
--to=davej@codemonkey.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®