函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\tomoyo\common.c Create Date:2022-07-27 21:06:17
Last Modify:2020-03-18 09:15:18 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:moyo_open_control - open() for /sys/kernel/security/tomoyo/ interface.*@type: Type of interface.*@file: Pointer to "struct file".* Returns 0 on success, negative value otherwise.

函数原型:int tomoyo_open_control(const u8 type, struct file *file)

返回类型:int

参数:

类型参数名称
const u8type
struct file *file
2416  head等于分配内存并置零
2418  如果非head则返回:负ENOMEM
2420  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & Exclusive lock for this structure. )
2421  Type of this interface. 等于type
2423  :type恒等于TOMOYO_DOMAINPOLICY
2425  write等于moyo_write_domain - Write domain policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
2426  read等于moyo_read_domain - Read domain policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock().
2427  退出
2428  :type恒等于TOMOYO_EXCEPTIONPOLICY
2430  write等于moyo_write_exception - Write exception policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
2431  read等于moyo_read_exception - Read exception policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock().
2432  退出
2433  :type恒等于TOMOYO_AUDIT
2435  poll等于moyo_poll_log - Wait for an audit log.*@file: Pointer to "struct file".*@wait: Pointer to "poll_table". Maybe NULL.* Returns EPOLLIN | EPOLLRDNORM when ready to read an audit log.
2436  read等于moyo_read_log - Read an audit log.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing.
2437  退出
2438  :type恒等于TOMOYO_PROCESS_STATUS
2440  write等于moyo_write_pid: Specify PID to obtain domainname.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0.
2441  read等于moyo_read_pid - Get domainname of the specified PID
2442  退出
2443  :type恒等于TOMOYO_VERSION
2445  read等于moyo_read_version: Get version.*@head: Pointer to "struct tomoyo_io_buffer".* Returns version information.
2446  Size of read buffer. 等于128
2447  退出
2448  :type恒等于TOMOYO_STAT
2450  write等于moyo_write_stat - Set memory quota.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0.
2451  read等于moyo_read_stat - Read statistic data.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing.
2452  Size of read buffer. 等于1024
2453  退出
2454  :type恒等于TOMOYO_PROFILE
2456  write等于moyo_write_profile - Write profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.
2457  read等于moyo_read_profile - Read profile table.*@head: Pointer to "struct tomoyo_io_buffer".* Returns nothing.
2458  退出
2459  :type恒等于TOMOYO_QUERY
2460  poll等于moyo_poll_query - poll() for /sys/kernel/security/tomoyo/query.*@file: Pointer to "struct file".*@wait: Pointer to "poll_table".* Returns EPOLLIN | EPOLLRDNORM when ready to read, 0 otherwise.
2461  write等于moyo_write_answer - Write the supervisor's decision.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, -EINVAL otherwise.
2462  read等于moyo_read_query - Read access requests which violated policy in enforcing mode.*@head: Pointer to "struct tomoyo_io_buffer".
2463  退出
2464  :type恒等于TOMOYO_MANAGER
2466  write等于moyo_write_manager - Write manager policy.*@head: Pointer to "struct tomoyo_io_buffer".* Returns 0 on success, negative value otherwise.* Caller holds tomoyo_read_lock().
2467  read等于moyo_read_manager - Read manager policy.*@head: Pointer to "struct tomoyo_io_buffer".* Caller holds tomoyo_read_lock().
2468  退出
2470  如果非f_mode按位与le is open for reading 的值则
2475  read = NULL
2476  poll = NULL
2477  否则如果非poll
2479  如果非Size of read buffer. Size of read buffer. 等于4096乘2
2481  Buffer for reading. 等于分配内存并置零
2482  如果非Buffer for reading.
2483  释放内存
2484  返回:负ENOMEM
2487  如果非f_mode按位与le is open for writing 的值则
2492  write = NULL
2493  否则如果write
2494  Size of write buffer. 等于4096乘2
2495  Buffer for writing. 等于分配内存并置零
2496  如果非Buffer for writing.
2497  释放内存
2498  释放内存
2499  返回:负ENOMEM
2508  如果type恒等于TOMOYO_QUERYatomic_inc( & Number of "struct file" referring /sys/kernel/security/tomoyo/query* interface.)
2510  needed for tty driver, and maybe others 等于head
2511  tomoyo_notify_gc(head, true)
2512  返回:0
调用者
名称描述
tomoyo_openmoyo_open - open() for /sys/kernel/security/tomoyo/ interface.*@inode: Pointer to "struct inode".*@file: Pointer to "struct file".* Returns 0 on success, negative value otherwise.