[lkml]   [2020]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 5/7] exec: Factor bprm_execve out of do_execve_common
On Tue, Jul 14, 2020 at 08:30:30AM -0500, Eric W. Biederman wrote:
> Currently it is necessary for the usermode helper code and the code
> that launches init to use set_fs so that pages coming from the kernel
> look like they are coming from userspace.
> To allow that usage of set_fs to be removed cleanly the argument
> copying from userspace needs to happen earlier. Factor bprm_execve
> out of do_execve_common to separate out the copying of arguments
> to the newe stack, and the rest of exec.
> In separating bprm_execve from do_execve_common the copying
> of the arguments onto the new stack happens earlier.
> As the copying of the arguments does not depend any security hooks,
> files, the file table, current->in_execve, current->fs->in_exec,
> bprm->unsafe, or creds this is safe.
> Likewise the security hook security_creds_for_exec does not depend upon
> preventing the argument copying from happening.
> In addition to making it possible to implement kernel_execve that
> performs the copying differently, this separation of bprm_execve from
> do_execve_common makes for a nice separation of responsibilities making
> the exec code easier to navigate.
> Signed-off-by: "Eric W. Biederman" <>

Reviewed-by: Kees Cook <>

Kees Cook

 \ /
  Last update: 2020-07-14 23:38    [W:0.139 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site