[RFC PATCH 2/3] exec: delay clone(CLONE_FILES) if task associated with current files_struct is exec'ing

2018-08-27 Thread Jeff Layton
In a later patch, we're going to move the unshare_files call in __do_execve_file to later in the process, but this opens up a potential race with clone(CLONE_FILES). We could end up bumping the refcount on the files_struct after we've checked to see if it was shared. What we really want to do in

[RFC PATCH 2/3] exec: delay clone(CLONE_FILES) if task associated with current files_struct is exec'ing

2018-08-27 Thread Jeff Layton
In a later patch, we're going to move the unshare_files call in __do_execve_file to later in the process, but this opens up a potential race with clone(CLONE_FILES). We could end up bumping the refcount on the files_struct after we've checked to see if it was shared. What we really want to do in