linux: Check for copyout errors in linux_fixup()
This is in preparation for annotating copyin() and related functions with __result_use_check. Reviewed by: olce, dchagin MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43104
This commit is contained in:
parent
7b68fb5ab2
commit
3fde275167
|
@ -126,11 +126,14 @@ linux_fixup(uintptr_t *stack_base, struct image_params *imgp)
|
||||||
argv = base;
|
argv = base;
|
||||||
envp = base + (imgp->args->argc + 1);
|
envp = base + (imgp->args->argc + 1);
|
||||||
base--;
|
base--;
|
||||||
suword(base, (intptr_t)envp);
|
if (suword(base, (intptr_t)envp) != 0)
|
||||||
|
return (EFAULT);
|
||||||
base--;
|
base--;
|
||||||
suword(base, (intptr_t)argv);
|
if (suword(base, (intptr_t)argv) != 0)
|
||||||
|
return (EFAULT);
|
||||||
base--;
|
base--;
|
||||||
suword(base, imgp->args->argc);
|
if (suword(base, imgp->args->argc) != 0)
|
||||||
|
return (EFAULT);
|
||||||
*stack_base = (uintptr_t)base;
|
*stack_base = (uintptr_t)base;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue