Commit 90141a75 authored by Randy Dunlap's avatar Randy Dunlap Committed by Steve French

[PATCH] janitor: unchecked copy_from_user in ieee1394/amdtp

author: Daniele Bellucci <bellucda@tiscali.it>

Fix an unchecked copy_from_user in ieee1394/amdtp.
parent 94221ccb
......@@ -62,6 +62,12 @@
* - 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment