diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2020-11-21 02:14:19 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-21 15:52:47 +0300 |
| commit | 44f79df28b47749be944e0bea86ccd7ad9772636 (patch) | |
| tree | 4b9c0df52a1081cbf2bb4fd5a05be1e64c46eefa /include | |
| parent | 5091d051c51db83c15f3e0b493f1c0da30316a36 (diff) | |
| download | linux-44f79df28b47749be944e0bea86ccd7ad9772636.tar.xz | |
exec: Simplify unshare_files
[ Upstream commit 1f702603e7125a390b5cdf5ce00539781cfcc86a ]
Now that exec no longer needs to return the unshared files to their
previous value there is no reason to return displaced.
Instead when unshare_fd creates a copy of the file table, call
put_files_struct before returning from unshare_files.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-2-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-2-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fdtable.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index f1a99d3e5570..b32ab2163dc2 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h @@ -109,7 +109,7 @@ struct task_struct; struct files_struct *get_files_struct(struct task_struct *); void put_files_struct(struct files_struct *fs); void reset_files_struct(struct files_struct *); -int unshare_files(struct files_struct **); +int unshare_files(void); struct files_struct *dup_fd(struct files_struct *, unsigned, int *) __latent_entropy; void do_close_on_exec(struct files_struct *); int iterate_fd(struct files_struct *, unsigned, |
