]> git.hungrycats.org Git - linux/commitdiff
[PATCH] janitor: unchecked copy_from_user in ieee1394/amdtp
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 19 Jul 2003 01:35:58 +0000 (18:35 -0700)
committerSteve French <cifs.adm@hostme.bitkeeper.com>
Sat, 19 Jul 2003 01:35:58 +0000 (18:35 -0700)
author: Daniele Bellucci <bellucda@tiscali.it>

Fix an unchecked copy_from_user in ieee1394/amdtp.

drivers/ieee1394/amdtp.c

index 524c66f2597c55c8ae50bc01b885d08358c4fa0d..a947de74a92628c71eaf5bcbfe1f4ac96ff9628f 100644 (file)
  * - Maybe make an ALSA interface, that is, create a file_ops
  *   implementation that recognizes ALSA ioctls and uses defaults for
  *   things that can't be controlled through ALSA (iso channel).
+ *
+ *   Changes:
+ *
+ * - Audit copy_from_user in amdtp_write.
+ *                           Daniele Bellucci <bellucda@tiscali.it>
+ *
  */
 
 #include <linux/module.h>
@@ -1112,7 +1118,8 @@ static ssize_t amdtp_write(struct file *file, const char *buffer, size_t count,
 
        for (i = 0; i < count; i += length) {
                p = buffer_put_bytes(s->input, count - i, &length);
-               copy_from_user(p, buffer + i, length);
+               if (copy_from_user(p, buffer + i, length))
+                       return -EFAULT;
                if (s->input->length < s->input->size)
                        continue;