Commit 82852538 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] zoran user-pointer fix

From: Hollis Blanchard <hollis@austin.ibm.com>

Fix a user pointer deref, found by the Stanford checker.
parent b129cd76
...@@ -119,7 +119,10 @@ static int zoran_write_proc(struct file *file, const char *buffer, unsigned long ...@@ -119,7 +119,10 @@ static int zoran_write_proc(struct file *file, const char *buffer, unsigned long
printk(KERN_ERR "%s: write_proc: can not allocate memory\n", zr->name); printk(KERN_ERR "%s: write_proc: can not allocate memory\n", zr->name);
return -ENOMEM; return -ENOMEM;
} }
memcpy(string, buffer, count); if (copy_from_user(string, buffer, count)) {
vfree(string);
return -EFAULT;
}
string[count] = 0; string[count] = 0;
DEBUG2(printk(KERN_INFO "%s: write_proc: name=%s count=%lu data=%x\n", zr->name, file->f_dentry->d_name.name, count, (int) data)); DEBUG2(printk(KERN_INFO "%s: write_proc: name=%s count=%lu data=%x\n", zr->name, file->f_dentry->d_name.name, count, (int) data));
ldelim = " \t\n"; ldelim = " \t\n";
......
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