Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\file.c Create Date:2022-07-28 20:08:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Install a file pointer in the fd array.* The VFS is full of places where we drop the files lock between* setting the open_fds bitmap and installing the file in the file* array. At any such point, we are vulnerable to a dup2() race

Proto:void __fd_install(struct files_struct *files, unsigned int fd, struct file *file)

Type:void

Parameter:

TypeParameterName
struct files_struct *files
unsigned intfd
struct file *file
592  _read_lock_sched() - mark the beginning of a RCU-sched critical section* This is equivalent of rcu_read_lock(), but disables preemption.* Read-side critical sections can also be introduced by anything else
594  If Value for the false possibility is greater at compile time(resize_in_progress) Then
595  _read_unlock_sched - marks the end of a RCU-classic critical section* See rcu_read_lock_sched for more information.
596  spin_lock( & written part on a separate cache line in SMP)
597  fdt = files_fdtable(files)
598  BUG_ON( current fd array [fd] != NULL)
599  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( current fd array [fd], file)
600  spin_unlock( & written part on a separate cache line in SMP)
601  Return
604  smp_rmb()
605  fdt = fetch RCU-sched-protected pointer for dereferencing(fdt)
606  BUG_ON( current fd array [fd] != NULL)
607  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization( current fd array [fd], file)
608  _read_unlock_sched - marks the end of a RCU-classic critical section* See rcu_read_lock_sched for more information.
Caller
NameDescribe
fd_install