mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
configfs: Return -EFBIG from configfs_write_bin_file.
The check for writing more than cb_max_size bytes does not 'goto out' so
it is a no-op which allows users to vmalloc an arbitrary amount.
Fixes: 03607ace80 ("configfs: implement binary attributes")
Cc: [email protected]
Signed-off-by: Phil Turnbull <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
024c7e3756
commit
42857cf512
1 changed files with 1 additions and 0 deletions
|
|
@ -333,6 +333,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf,
|
|||
if (bin_attr->cb_max_size &&
|
||||
*ppos + count > bin_attr->cb_max_size) {
|
||||
len = -EFBIG;
|
||||
goto out;
|
||||
}
|
||||
|
||||
tbuf = vmalloc(*ppos + count);
|
||||
|
|
|
|||
Loading…
Reference in a new issue