diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-09-10 17:48:00 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-10-05 13:11:47 +0200 |
| commit | 31116e528f19545220250209fc5ee71a5a2295ec (patch) | |
| tree | 3a18c4c840d014fa16ef0d228333be53a640f904 /include/linux | |
| parent | f192beb5479a3a87541f3cf8d845abc8ee9959bd (diff) | |
fs: add switch_files_struct()
Add switch_files_struct() to install another table on a task. It
consumes the reference to the new table and puts the old one. Convert
every place that switches a descriptor table except unshare_files().
No functional changes.
Link: https://patch.msgid.link/20260910-work-coredump-unlock-self-v4-2-a5c1800dc930@kernel.org
Reviewed-by: NeilBrown <neil@brown.name>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fdtable.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index afdfaad381df..270ee830f206 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h @@ -100,6 +100,7 @@ static inline bool close_on_exec(unsigned int fd, const struct files_struct *fil struct task_struct; void put_files_struct(struct files_struct *fs); +void switch_files_struct(struct task_struct *tsk, struct files_struct *files); int unshare_files(void); enum fd_range_flags { /* Leave behind all descriptors outside of the specified range. */ |
