Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\selinux\hooks.c Create Date:2022-07-28 18:56:17
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Derived from fs/exec.c:flush_old_files.

Proto:static inline void flush_unauthorized_files(const struct cred *cred, struct files_struct *files)

Type:void

Parameter:

TypeParameterName
const struct cred *cred
struct files_struct *files
2454  struct file * file, * devnull = NULL
2456  drop_tty = 0
2459  tty = get_current_tty()
2460  If tty Then
2461  spin_lock( & protects tty_files list )
2472  file = file
2476  spin_unlock( & protects tty_files list )
2477  tty_kref_put(tty)
2480  If drop_tty Then no_tty()
2484  n = iterate_fd(files, 0, match_file, cred)
2485  If Not n Then Return
2488  devnull = dentry_open( & selinux_null, O_RDWR, cred)
2489  If IS_ERR(devnull) Then devnull = NULL
2492  Do
2493  replace_fd(n - 1, devnull, 0)
2494  When (n = iterate_fd(files, n, match_file, cred)) != 0 cycle
2495  If devnull Then fput(devnull)
Caller
NameDescribe
selinux_bprm_committing_credsPrepare a process for imminent new credential changes due to exec