mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 11:11:22 -04:00
staging: tidspbridge: check return code of get_user
Function get_user may fail. Check for it. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2fac6c290f
commit
b04462a143
@@ -872,7 +872,11 @@ u32 procwrap_load(union trapped_args *args, void *pr_ctxt)
|
||||
/* number of elements in the envp array including NULL */
|
||||
count = 0;
|
||||
do {
|
||||
get_user(temp, args->args_proc_load.user_envp + count);
|
||||
if (get_user(temp,
|
||||
args->args_proc_load.user_envp + count)) {
|
||||
status = -EFAULT;
|
||||
goto func_cont;
|
||||
}
|
||||
count++;
|
||||
} while (temp);
|
||||
envp = kmalloc(count * sizeof(u8 *), GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user